<s>[INST] How to compute $\int \frac{1}{(x^2+1)^2}dx$? Suppose we know $\int \frac{1-x^2}{(x^2+1)^2}=\frac{x}{x^2+1}+C$
How to compute $\int \frac{1}{(x^2+1)^2}dx$?
I tried writing it as $\frac{1+x^2-x^2}{(x^2+1)^2}=\frac{1-x^2}{(x^2+1)^2}+\frac{x^2}{(x^2+1)^2}$. But then how do you deal with $\frac{x^2}{(x^2+1)^2}$?
Some ideas?
 [/INST] The approach shown by Elliot G is perfectly fine, but if you like a viable alternative, you may consider that:
$$ \frac{1}{x^2+1} = \frac{1}{(x+i)(x-i)} = \frac{1}{2i}\left(\frac{1}{x-i}-\frac{1}{x+i}\right) $$
hence by squaring both sides:
$$ \frac{1}{(x^2+1)^2} = -\frac{1}{4}\left(\frac{1}{(x-i)^2}+\frac{1}{(x+i)^2}-\frac{2}{x^2+1}\right)$$
so:
$$ \int\frac{dx}{(x^2+1)^2} = C+\frac{1}{4}\left(\frac{1}{x-i}+\frac{1}{x+i}\right)+\frac{1}{2}\arctan x $$
or:

$$ \int\frac{dx}{(x^2+1)^2} = C+\frac{1}{2}\left(\frac{x}{x^2+1}+\arctan x\right).$$

</s>