<s>[INST] Evaluate $\int \frac 1{x^{12}+1} \, dx$ 
Evaluate $\displaystyle \int \frac 1{x^{12}+1} \, dx$

I tried writing this in partial fractions.
$$\int \frac 1{x^{12}+1} \, dx=\int \frac{1}{[(x^6+1)+\sqrt{2}x^3][(x^6+1)-\sqrt{2}x^3]} \, dx$$
So I did:
\begin{align}
\frac{1}{[(x^6+1)+\sqrt{2}x^3][(x^6+1)-\sqrt{2}x^3]} &= \frac{Ax^5+Bx^4+Cx^3+Dx^2+Ex+F}{[(x^6+1)-\sqrt{2}x^3]}\\&{}\qquad+\frac{A_1x^5+B_1x^4+C_1x^3+D_1x^2+E_1x+F_1}{[(x^6+1)+\sqrt{2}x^3]}\end{align}
After messy work, I found $A=A_1=B=B_1=D=D_1=E=E_1=0$ and
$$C=-\frac 1{2\sqrt{2}},\qquad C_1=\frac 1{2\sqrt{2}},\qquad F=F_1=\frac 12$$
I now get the integral
$$\int  \frac{-\frac 1{2\sqrt{2}}x^3+\frac 12}{(x^6+1)-\sqrt{2}x^3}\, dx + \int \frac{\frac 1{2\sqrt{2}}x^3+\frac 12}{(x^6+1)+\sqrt{2}x^3} \, dx$$
But how can I go from here? I am stuck.
 [/INST] Decompose and arrange the integrand as follows
\begin{align}\frac{6}{1+x^{12}}
& =\frac2{x^4+1}-\frac{\sqrt3x^2-2}{x^4-\sqrt3x^2+1} 
 +\frac{\sqrt3x^2+2}{x^4+\sqrt3x^2+1} \\
 & =\frac{(1+x^2)+(1-x^2)}{x^4+1}+\frac{2+\sqrt3}2\left(\frac{1+x^2}{x^4+\sqrt3x^2+1}+\frac{1-x^2}{x^4-\sqrt3x^2+1} \right)\\
& \hspace{30mm}+\frac{2-\sqrt3}2\left(\frac{1+x^2}{x^4-\sqrt3x^2+1}+\frac{1-x^2}{x^4+\sqrt3x^2+1} \right)\\
\end{align}
Then
\begin{align}
\int \frac{dx}{1+x^{12}}
& =\frac16J(0)
+\frac{2+\sqrt3}{12}J(\sqrt3) +\frac{2-\sqrt3}{12}J(-\sqrt3) +C\\
\end{align}
where
\begin{align}
J(a)&= \int \left(\frac{1+x^2}{x^4+ax^2+1}+ \frac{1-x^2}{x^4-ax^2+1}\right)dx \\
&=\int \frac{d(x-\frac1x)}{(x-\frac1x)^2+(2+a)}+\int \frac{d(x+\frac1x)}{(2+a)-(x+\frac1x)^2}  \\
&=\frac1{\sqrt{2+a}}\left( \tan^{-1}\frac{x^2-1}{x\sqrt{2+a}} +\coth^{-1}\frac{x^2+1}{x\sqrt{2+a}} \right)\\
\end{align}
</s>