Evaluate $\int\frac{1}{1+x^6} \,dx$

Here's a nice "trick" my former professor taught me

$$ \int\frac{dx}{1+x^6} = \frac{1}{2} \int \frac{(1-x^2+x^4)+x^2+(1-x^4)}{(1+x^2)(1-x^2+x^4)} dx \\ = \frac{1}{2}\int \frac{dx}{1+x^2} + \frac{1}{2} \int \frac{x^2}{1+x^6} dx + \frac{1}{2} \int \frac{1-x^2}{1-x^2+x^4} dx \\ = \frac{1}{2}\int \frac{dx}{1+x^2} + \frac{1}{2} \int \frac{x^2}{1+x^6} dx - \frac{1}{2} \int \frac{1-\frac{1}{x^2}}{x^2-1+\frac{1}{x^2}} dx $$

The first integral is simply the arctangent of $x$. The second can be solved by substituting $u = x^3$. The third can be solved by substituting $t = x + \frac{1}{x}$


With $1+x^6= (1+x^2)(x^4-x^2+1)$, decompose the integrand

\begin{align} & \int \frac{dx}{1+x^6} =\frac13\int \left( \frac{1}{1+x^2}+\frac12\frac{x^2+1}{x^4-x^2+1}- \frac32\frac{x^2-1}{x^4-x^2+1}\right)dx \\ &\hspace{15mm}=\frac13\int \frac{dx}{1+x^2}+\frac16\int \frac{d(x-\frac1x)}{(x-\frac1x)^2+1}dx - \frac12\int \frac{d(x+\frac1x)}{(x+\frac1x)^2-3} dx \\ \end{align}


Hint:

$$1+x^6$$ factors with the sixth roots of minus one, $\pm i$ and $\dfrac{\pm\sqrt3\pm i}2$ and by grouping the conjugate roots, we obtain a real factorization:

$$(1+x^2)(1+\sqrt3 x+x^2)(1-\sqrt3 x+x^2).$$

From this we deduce a decomposition in simple fractions,

$$\frac1{1+x^6}=a\frac{2x+b}{1+x^2}+c\frac{(2x+\sqrt3)+d}{1+\sqrt3x+x^2}+e\frac{(2x-\sqrt3)+f}{1-\sqrt3x+x^2}.$$

Then by shitfing the variables,

$$a\frac{2x+b}{1+x^2}+c\frac{2x'+d}{1+x'^2}+e\frac{2x''+f}{1+x''^2}$$ are easy to integrate.