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?

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.$$
