How to calculate $\int \frac{x^2 }{(x^2+1)^2} dx$? I'm trying  to calculate $\int \frac{x^2 }{(x^2+1)^2} dx$ by using the formula:
$$ \int udv = uv -\int vdu $$
I supposed that $u=x$ s.t $du=dx$, and also that $dv=\frac{x}{(x^2+1)^2}dx$, but I couldn't calculate the last integral. what is the tick here? 


the answer must be: $ \frac{1}{2}arctan\ x - \frac{x}{2(1+x^2)} $ + C 


 A: First, you used parts: with $u = x$ and $dv = \frac{x}{(x^2+1)^2}dx$, you got $$\int\frac{x^2}{(x^2+1)^2}dx = xv - \int v\,dx.\tag{1}$$
From here, I suggested the substitution $t = x^2$ in order to integrate $dv$ and get $v$. 
Doing this, we see that $dt = 2x\,dx$, so $x\,dx = \frac{1}{2}dt$.
Thus $$v = \int dv = \int \frac{x}{(x^2+1)^2}dx = \frac{1}{2} \int \frac{dt}{(t + 1)^2}.$$
This latter integral is easy: if you can't guess it, let $s = t + 1$. 
In any case, we get $$v = -\frac{1}{2(t+1)} = -\frac{1}{2(x^2+1)}.$$
Going back to $(1)$,
$$\int\frac{x^2}{(x^2+1)^2}dx = -\frac{x}{2(x^2+1)} + \frac{1}{2} \int \frac{dx}{x^2+1}$$
and you should recognize the final integral as $\arctan{x}$.
Putting it all together, the answer is 
$$\frac{1}{2}\arctan{x} - \frac{x}{2(x^2+1)} + C.$$
A: HINT:
Use trigonometric substitution  $x=\tan\theta$ 
$\int\dfrac{x^2}{(x^2+1)^2}dx=\cdots=\dfrac12\int(1-\cos2\theta)d\theta$
$\sin2\theta=\dfrac{2\tan\theta}{1+\tan^2\theta}$
A: $$\int\dfrac{x^2}{(x^2+1)^2}dx$$
$$=x\int\dfrac x{(x^2+1)^2}dx-\int\left[\frac{dx}{dx}\cdot\int\dfrac x{(x^2+1)^2}dx\right]dx$$
$$=x\cdot\frac{-1}{1+x^2}+\int\dfrac{dx}{1+x^2}=\cdots$$
