<s>[INST] $\int\frac1{(x^2+1)^2}\ dx$ by partial fraction decomposition Is there any possible way to calculate the integral of $\frac{1}{(x^2+1)^2}$ by partial fraction decomposition? I do not know the formulas for the trigonometric method.
Thank you!
 [/INST] Up to my knowledge no.
I see 3 ways : 


*

*a change of variables : $x = \tan t$,

*modify the numerator $\frac{1}{(1+x^2)^2} = \frac{1+x^2-x^2}{(1+x^2)^2} = \frac{1}{(1+x^2)} + \frac{x}{2}\frac{-2x}{(1+x^2)^2} = \arctan'(x) + \frac{x}{2}\left(\frac{1}{1+x^2}\right)'$ and integrate by part the second quantity,

*method by residues theorem.


To integrate by parts, use : $\int u'v = uv - \int uv'$ with $u = \frac{1}{1+x^2}$ and $v=\frac{x}{2}$, thus
$$
\begin{array}{rcl}
\displaystyle\int\frac{1}{(1+x^2)^2}\mathrm{d}x &=& \displaystyle\int \arctan'(x) + \frac{x}{2}\left(\frac{1}{1+x^2}\right)'\mathrm{d}x\\
& =& \displaystyle \arctan(x) + \frac{1}{2}\frac{x}{1+x^2} - \frac{1}{2}\int \frac{1}{1+x^2}\mathrm{d}x\\
&=& \displaystyle\frac{1}{2} \left(\arctan(x) + \frac{x}{1+x^2}\right) + \mathsf{cte}
\end{array}
$$
</s>