<s>[INST] Can you solve $\int 1/(x^2+1)^2\, dx$ I know that the integral looks like like the anti-derivative of $\arctan$, but i don't know how to use this fact so I tried to use a fraction decomposition to: $$\frac{1}{(x^2+1)^2}$$
to solve the anti-derivative : $$\int \frac{1}{(x^2+1)^2}\, dx$$
so :$$\frac{1}{(x^2+1)^2}=\frac{A}{x^2+1}+\frac{B}{x^2+1}\iff \frac{1}{x^2+1}=A+B$$
$$1+0x^2=(A+B)x^2+(A+B)1$$
Thus I got this system of equations:
$$\cases{A+B=1 \\ A+B=0}$$ Which is impossible. I also tried to use substitution but it didn't help me.
 [/INST] There's multiple ways to do this integral including IBP, substitution... Here's one that uses Feynman's trick (differentiation under the integral sign)
We know the following antiderivative
$$I(a)=\int^x\frac{ dx'}{x'^2+a^2}=\frac{1}{a}\arctan(x/a)$$
You can see we introduced a parameter that did not exist before. We differentiate under the integral sign to obtain the desired integral form
$$J(a)=\int^x\frac{dx'}{(x'^2+a^2)^2}=-\frac{1}{2a}\frac{\partial I}{\partial a}=\frac{1}{2a^3}\left(\arctan(x/a)+\frac{a x}{x^2+a^2}\right)$$
$J(1)$ is the indefinite integral we seek.
EDIT: Here's a way that utilizes IBP.
Rewrite by adding and subtracting $x^2$ in the numerator
$$\int\frac{dx}{(x^2+1)^2}=\int \frac{dx}{x^2+1}-\int\frac{x^2dx}{(x^2+1)^2}$$
However note that
$$\int xdx\frac{x}{(x^2+1)^2}=-\frac{1}{2}\int dx~x \frac{d}{dx}\left(\frac{1}{x^2+1}\right)=-\frac{x}{2(x^2+1)}+\frac{1}{2}\arctan x$$
which yields the desired result
$$\int\frac{dx}{(x^2+1)^2}=\frac{1}{2}\arctan x+\frac{1}{2}\frac{x}{x^2+1}$$
</s>