<s>[INST] How to calculate $\int \frac{dx}{(a^2 + x^2)^2}$? I'm trying to use a trig substitution but I'm stuck. Here's what I did so far: 
$$\int \frac{dx}{(a^2 + x^2)^2}$$
Let $x = a\sin \theta, dx = a\cos \theta d\theta$
$$\int \frac{a cos\theta d\theta}{(a^2 + a^2 sin^2 \theta)^2} = \int \frac{a\cos \theta d\theta}{(a^2(1+sin^2\theta))^2} $$
$$\int \frac{a\cos \theta d\theta}{(a^2 \cos^2\theta)^2} =\int \frac{d\theta}{a^3cos^3\theta}  $$
I don't know what to do anymore
 [/INST] Substituting $x=a\tan(u)$ gives
$$
\begin{align}
\int\frac{\mathrm{d}x}{\left(a^2+x^2\right)^2}
&=\frac1{a^3}\int\frac{\sec^2(u)\,\mathrm{d}u}{\sec^4(u)}\\
&=\frac1{a^3}\int\cos^2(u)\,\mathrm{d}u\\
&=\frac1{2a^3}\int(1+\cos(2u))\,\mathrm{d}u\\
&=\frac1{2a^3}(u+\sin(u)\cos(u))+C\\
&=\frac1{2a^3}\left(\tan^{-1}\left(\frac xa\right)+\frac{ax}{a^2+x^2}\right)+C\\
\end{align}
$$
</s>