<s>[INST] How to integrate $\int_{0}^{\infty} \frac{x \arctan(x) \ dx}{(1+x^2)^2}$ I am asked to solve the following integral:

$$\int_{0}^{\infty} \frac{x \arctan(x) \ dx}{(1+x^2)^2}$$

I've made a couple of guesses but none of them took me anywhere. One of my ideas was to do, at first, an u-substitution:
$$
u = 1+x^2\\
du = 2x dx\\
\frac{du}{2} = x dx\\
\\
x = 0 \Rightarrow u = 1\\
x = a \Rightarrow u = 1+a^2 
$$
but then there's a $\arctan(x)$ left there untouched. Does anyone have an idea I can pursue?
Source: James Stewart's Calculus book.
Thank you.
 [/INST] Let us integrate by parts and put
$u'=\frac{x}{(1+x^2)^2}$
and
$v=arctan(x).$
thus
the integral becomes
$$I=[-\frac{1}{2(1+x^2)}arctan(x)]_0^\infty$$
$$+\frac{1}{2}\int_0^\infty\frac{dx}{(1+x^2)^2}$$
$$=\frac{1}{2}\int_0^\infty\frac{1+x^2-x^2}{(1+x^2)^2}dx$$
$$=\frac{\pi}{4}+\frac{1}{4}\int_0^\infty x \frac{-2x}{(1+x^2)^2}dx$$
$$=\frac{\pi}{4}+\frac{1}{4}([\frac{x}{1+x^2}]_0^\infty-\int_0^\infty\frac{1}{1+x^2}dx)$$
$$\color{red}{=\frac{\pi}{4}-\frac{\pi}{8}=\frac{\pi}{8}}$$
</s>