Solve this integral:$\int_0^\infty\frac{\arctan x}{x(x^2+1)}\mathrm dx$ I occasionally found that $\displaystyle\int_0^{\Large\frac{\pi}{2}}\dfrac{x}{\tan x}=\dfrac{\pi}{2}\ln 2$.
I tried that 
$$\int_0^{\Large\frac{\pi}{2}}\dfrac{x}{\tan x}=\int_0^{\Large\frac{\pi}{2}}x   \ \mathrm d(\ln \sin x)=-\int_0^{\Large\frac{\pi}{2}}\ln (\sin x)=\dfrac{\pi}{2}\ln 2$$
Then I tried another method 
$$\int_0^{\Large\frac{\pi}{2}}\dfrac{x}{\tan x}=\int_0^\infty\dfrac{\arctan x}{x(x^2+1)}\mathrm dx$$
I tried to expand $\arctan x$ and $\dfrac{1}{1+x^2}$, but got nothing, also I was confused that whether $\displaystyle\int_0^\infty$ and $\displaystyle\sum_{i=0}^\infty$ can exchange or not? If yes, on what condition?
Sincerely thanks your help!


I just want to seek ways that have nothing to do with $\ln (\sin x)$.

Hint. You may consider
$$
I(a):=\int_0^\infty\frac{\arctan (ax)}{x(x^2+1)}\:\mathrm dx,\quad 0<a<1, \tag1
$$
and  obtain
$$
I'(a)=\int_0^\infty\frac1{(x^2+1)(a^2x^2+1)}\:\mathrm dx.
$$ By using partial fraction decomposition, we have
$$
\frac1{(x^2+1)(a^2x^2+1)}=\frac1{\left(1-a^2\right) \left(x^2+1\right)}-\frac{a^2}{\left(1-a^2\right) \left(a^2 x^2+1\right)}
$$ giving
$$
\begin{align}
I'(a)&=\frac1{\left(1-a^2\right)}\int_0^\infty\!\frac1{x^2+1}\:\mathrm dx-\frac{a^2}{\left(1-a^2\right)}\int_0^\infty\frac1{a^2x^2+1}\:\mathrm dx\\\\
&=\frac1{\left(1-a^2\right)}[\arctan x]_0^\infty-\frac{a^2}{\left(1-a^2\right)}\left[\frac{\arctan (ax)}a\right]_0^\infty\\\\
&=\frac1{\left(1-a^2\right)}\frac{\pi}2-\frac{a}{\left(1-a^2\right)}\frac{\pi}2\\\\
&=\frac{\pi}2\frac1{1+a} \tag2
\end{align}
$$ Since $I(0)=0$, by integrating $(2)$, you easily get

$$
\int_0^\infty\frac{\arctan (ax)}{x(x^2+1)}\:\mathrm dx=\frac{\pi}2\: \ln (a+1), \qquad 0\leq a <1,
$$ 

from which, by letting $a \to 1^-$, you deduce

$$
\int_0^\infty\frac{\arctan x}{x(x^2+1)}\:\mathrm dx=\frac{\pi}2 \ln 2
$$ 

as announced.
