<s>[INST] Help evaluating $\int \frac{dx}{(x^2 + a^2)^2}$ I have following integral and it should be simple, however whatever substitution I use and no matter how many times I integrate it by parts (or combine both) I never get the correct solution (or any alternative solution):
$$\int \frac{dx}{(x^2 + a^2)^2}$$
I'm looking for what is on the Wolfram|Alpha in the alternative solutions section:
$$\frac{\arctan(\frac{x}{a})}{2a^3} + \frac{x}{2a^2(a^2 + x^2)} $$
 [/INST] After a linear substitution we may instead look at
$$\frac{1}{(1+x^2)^2}= \frac{(1+x^2)}{(1+x^2)^2}-\frac{x^2}{(1+x^2)^2}=\frac{1}{1+x^2}-\frac{x^2}{(1+x^2)^2}$$
where the first term is easy. For the second term we may try integration by parts 
$$\int x\cdot\frac{x}{(1+x^2)^2}dx=\left[x\cdot\frac{-1}{2(1+x^2)}\right]+\frac{1}{2}\int\frac{1}{1+x^2}dx=-\frac{x}{2(1+x^2)}+\frac12\arctan x$$
Ending up with 
$$\int\frac{dx}{(1+x^2)^2} = \frac12\arctan x +\frac{x}{2(1+x^2)}$$
</s>