Evaluating $\int_0^{\infty} \frac{\tan^{-1} x}{x(1+x^2)} dx$ The question is to evaluate $$\int_0^{\infty} \frac{\tan^{-1} x}{x(1+x^2)} dx$$
I used the substitution $x=\tan a$ then the given integral becomes $\int_0^{\pi/2} \frac{\tan^{-1}(\tan a)}{\tan a} da$
Now $\tan^{-1} (\tan a)=a \forall a \in [0,\pi /2]$ so that the integrand becomes $a/ \tan a$.i am facing trouble evaluating this.i tried using $a \to \pi/2 -a$ but couldn't simplify.Any ideas?

Instead of using Feynman's trick and differentiating under the integral sign as @Robert Israel did, in a very similar manner one may evaluate the integral by converting it to a double integral first.
Noting that
$$\int^1_0 \frac{dt}{1 + x^2 t^2} = \frac{\tan^{-1} x}{x},$$
the integral may be rewritten as
$$I = \int^\infty_0 \frac{\tan^{-1} x}{x(1 + x^2)} \, dx = \int^\infty_0 \int^1_0 \frac{1}{(1 + x^2 t^2)(1 + x^2)} \, dt dx.$$
Changing the order of integration then integrating yields
\begin{align*}
I &= \int^1_0 \int^\infty_0 \frac{1}{(1 + x^2 t^2)(1 + x^2)} \, dx dt\\
&= \int^1_0 \int^\infty_0 \left [\frac{1}{1 - t^2} \cdot \frac{1}{1 + x^2} - \frac{t^2}{1 - t^2} \cdot \frac{1}{1 + t^2 x^2} \right ] \, dx dt\\
&= \frac{\pi}{2} \int^1_0 \left [\frac{1}{1 - t^2} - \frac{t}{1 - t^2} \right ] \, dt\\
&= \frac{\pi}{2} \int^1_0 \frac{dt}{1 + t}\\
&= \frac{\pi}{2} \ln (1 + t) \Big{|}^1_0\\
&= \frac{\pi}{2} \ln (2).
\end{align*} 
