<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] Hermite's algorithm essentially does what you want.  You can read about it here.  Rather than replicate that work...
Observe 
$$  \frac{1}{(x^2+1)^2} = \frac{(1/2)(1-x^2)}{(x^2+1)^2} + \frac{1/2}{x^2+1}  $$
and
$$  \frac{\mathrm{d}}{\mathrm{d}x} \frac{x}{x^2+1} = \frac{1-x^2}{(x^2 +1)^2}  \text{.}  $$
Another way to get to the second fact is to use https://math.stackexchange.com/a/68512/123905 .
Therefore, \begin{align*}
\int \frac{1}{(x^2+1)^2} \,\mathrm{d}x
    &= \frac{1}{2} \int \frac{1-x^2}{(x^2+1)^2} + \frac{1}{x^2+1} \,\mathrm{d}x  \\
    &= \frac{1}{2}\left( \int \frac{1-x^2}{(x^2+1)^2}  \,\mathrm{d}x + \int \frac{1}{x^2+1} \,\mathrm{d}x \right)  \\
    &= \frac{1}{2}\left( \frac{x}{x^2+1} + \tan^{-1}x + C \right)  \\
    &= \frac{1}{2}\left( \frac{x}{x^2+1} + \tan^{-1}x \right) + C  \text{.}
\end{align*}
</s>