Question: How can we solve $\displaystyle\int\frac{1}{(x^2+1)^2}dx$ for Riemanian integration and Lebesgue integration mode?

Answer: 
**Hint:** Use the change of variables $x=\tan t$ to get

> 
> $$ \int \cos^2 t\, dt .$$
> 
> 
> 

I think you can finish it.

**Note:** The following identity is useful

> 
> $$ \cos(2x)=2\cos^2 x - 1 .$$
> 
> 
>
Here is a partial fraction expansion that may be useful

$$\frac{1}{(1+x^2)^2} = \frac{1}{2} \frac{1}{1+x^2} - \frac{1}{2} \frac{x^2-1}{(1+x^2)^2}$$

Riemannian integral is easily obtained as 
$$\frac{1}{2} atan(x) + \frac{1}{2} \frac{x}{1+x^2}$$

Hope this helps
BTW: I followed the usual approach to partial fractions and then regrouped the terms into something nice.