How to solve the integral $\int \frac{1}{x^{8}\left(1+x^{2}\right)} \ \mathrm{d} x$? I encountered a very difficult problem, to calculate the answer of this formula:
$$
\int \frac{1}{x^{8}\left(1+x^{2}\right)} \ \mathrm{d} x
$$
Can you help me to find out how it solved?
 A: $$\frac{1}{x^8(1+x^2)}=\frac{1+x^2-x^2}{x^8(1+x^2)}=\frac{1}{x^8}-\frac{1}{x^6(1+x^2)}=\cdots$$
and so on, finally you will get:
$$\frac{1}{x^8(x^2 + 1)} = \frac{1}{x^8} - \frac{1}{x^6} + \frac{1}{x^4} - \frac{1}{x^2} + \frac{1}{x^2 + 1}.$$
A: Using partial fraction decomposition (left as an exercise for the reader), notice that $$\frac{1}{x^8(x^2 + 1)} = \frac{1}{x^8} - \frac{1}{x^6} + \frac{1}{x^4} - \frac{1}{x^2} + \frac{1}{x^2 + 1}.$$ Therefore, $$\int \frac{1}{x^8(x^2 + 1)} ~ dx = \int \left[ \frac{1}{x^8} - \frac{1}{x^6} + \frac{1}{x^4} - \frac{1}{x^2} + \frac{1}{x^2 + 1} \right] ~ dx.$$ From here, one can notice that the first $4$ terms have simple anti-derivatives, and the anti-derivative of the last term is $\arctan x.$ One can do a sanity check by computing the derivative of $\arctan x$ to see that it is indeed the case. Therefore, we have that $$\int \left[ \frac{1}{x^8} - \frac{1}{x^6} + \frac{1}{x^4} - \frac{1}{x^2} + \frac{1}{x^2 + 1} \right] ~ dx = \frac{1}{x} - \frac{1}{3x^3} + \frac{1}{5x^5} - \frac{1}{7x^7} + \arctan x + C.$$
A: We need to integrate:
$$
I = \int \frac{1}{x^{8}\left(1+x^{2}\right)} \ \mathrm{d} x
$$
Continuing from my comment, substitute $x = tan\theta$. Then, $dx = sec^2\theta. d\theta$. We also know that $1+ tan^2\theta = sec^2\theta$. Substituting back into the integral, we get:
$$I =\int \frac{sec^2\theta}{tan^{8}\theta \left(1+tan^{2}\theta\right)} \ \mathrm{d}\theta$$
$$ \implies I = \int \frac{1}{tan^{8}\theta} \ \mathrm{d}\theta$$
$$ \implies I =\int \cot^8\theta \ \mathrm{d}\theta$$
We can now handle this integral quite easily by repeatedly using the formula, $cot^2\theta = cosec^2\theta - 1$.
We finally get,
$$ I = -\frac{cot^7\theta}{7}+\frac{cot^5\theta}{5}-\frac{cot^3\theta}{3}+cot\theta\ + \theta + C$$
Now substitute back $\theta = tan^{-1}x$ for your final answer!
