<s>[INST] Help with $\int\frac{1}{1+x^8}dx$ I'm not sure how to proceed. I tried factoring like you do to evaluate $\int\frac{1}{1+x^4}dx$, and since it came out nasty I checked out WolframAlpha to see if I was on the right track. In fact, Wolfram doesn't have a step-by-step solution for the integral in question, but the primitive is full of trig expressions like $\csc\frac{\pi}{8}$ and I'm not sure where these would come from.
 [/INST] Decompose the integrand as
\begin{align}\frac{1}{1+x^8}
&=\frac1{2\sqrt2}\left(\frac{x^2+\sqrt2}{x^4-\sqrt2x^2+1}
 - \frac{x^2-\sqrt2}{x^4+\sqrt2x^2+1}\right)\\
&=\frac{2+\sqrt2}8 \left( \frac{1+x^2}{x^4+\sqrt2x^2+1}
+\frac{1-x^2}{x^4-\sqrt2x^2+1}   \right)\\
 &\hspace{5mm}+\frac{2-\sqrt2}8 \left( \frac{1+x^2}{x^4-\sqrt2x^2+1}
+\frac{1-x^2}{x^4+\sqrt2x^2+1}   \right)
\end{align}
Then, integrate
$$\begin{align}
I_+(a)&=\int\frac{1+x^2}{x^4+ax^2+1}dx 
= \int\frac{d(x-\frac1x)}{(x-\frac1x)^2 +2+a}=\frac1{\sqrt{2+a}}\tan^{-1}\frac{x^2-1}{x\sqrt{2+a}} \\
 I_-(a)&=\int\frac{1-x^2}{x^4+ax^2+1}dx 
= \int\frac{d(x+\frac1x)}{2-a-(x+\frac1x)^2}=\frac1{\sqrt{2-a}}\coth^{-1}\frac{x^2+1}{x\sqrt{2-a}} \\
\end{align}$$
Thus
\begin{align}
\int \frac{1}{1+x^8}dx
&= \frac{2+\sqrt2}8 \left[ J_+(\sqrt2)+ J_-(-\sqrt2)  \right]
+\frac{2-\sqrt2}8 \left[ J_+(-\sqrt2)+ J_-(\sqrt2)  \right]\\
& =\frac{\sqrt{2+\sqrt2}}8 \left( \tan^{-1}\frac{x^2-1}{x\sqrt{2+\sqrt2}}
+ \coth^{-1}\frac{x^2+1}{x\sqrt{2+\sqrt2}}\right)\\
&\hspace{5mm}+\frac{\sqrt{2-\sqrt2}}8 \left( \tan^{-1}\frac{x^2-1}{x\sqrt{2-\sqrt2}}
+ \coth^{-1}\frac{x^2+1}{x\sqrt{2-\sqrt2}}\right)+C\\
\end{align}
</s>