First consider $$I = \int \frac{dx}{(x^2+1)^{2}}$$ and the substitution $x=\tan\theta$. This leads to $dx = sec^{2}\theta \, d\theta$ and $x^2 + 1 = sec^{2}\theta$ and \begin{align} I &= \int \frac{sec^{2}\theta}{sec^{4}\theta} \, d\theta \\ &= \int \frac{d\theta}{sec^{2}\theta} \\ &= \int \cos^{2}\theta \, d\theta \\ &= \frac{1}{2} \, \int \left( 1 + \cos(2\theta) \right) \, d\theta\\ &= \frac{1}{2} \, \left[ \theta + \frac{1}{2} \, \sin(2\theta) \right] + c_{0} \end{align} Upon backward substitution this becomes \begin{align} I = \frac{1}{2} \, \tan^{-1}(x) + \frac{1}{4} \, \sin(2 \, \tan^{-1}(x)) + c_{0} \end{align}