We are going to evaluate the integral in a general form using Feynman’s Technique Integration by letting
$ \displaystyle I(a)=\int_{0}^{\infty} \frac{\tan ^{-1}(a x)}{x\left(x^{2}+b^{2}\right)} d x \text {, where } a, b \geqslant 0\tag*{} $
Differentiating $ I(a)$ w.r.t $ a$ yields
$ \begin{aligned}I^{\prime}(a) &=\int_{0}^{\infty} \frac{d x}{\left(1+a^{2} x^{2}\right)\left(x^{2}+b^{2}\right)} \\ \displaystyle &=\frac{1}{a^{2} b^{2}-1} \int_{0}^{\infty}\left(\frac{a^{2}}{1+a^{2} x^{2}}-\frac{1}{x^{2}+b^{2}}\right) d x \\ \displaystyle &=\frac{1}{a^{2} b^{2}-1}\left[a \tan ^{-1}(a x)-\frac{1}{b} \tan ^{-1}\left(\frac{x}{b}\right)\right]_{0}^{\infty} \\&=\frac{\pi}{2\left(a^{2} b^{2}-1\right)}\left(a-\frac{1}{b}\right) \\&=\frac{\pi}{2 b(a b+1)} \\ \displaystyle I(a) &=\frac{\pi}{2 b} \int \frac{d a}{a b+1} \end{aligned} \tag*{} $
Hence
$ \displaystyle \begin{array}{l} \displaystyle I(a)=\frac{\pi}{2 b^{2}} \ln (a b+1)+c \\ \displaystyle 0=I(0)=0+c \Rightarrow c=0 \end{array} \tag*{} $
We can conclude that
$\displaystyle \boxed{ \int_{0}^{\infty} \frac{\tan ^{-1}(a x)}{x\left(x^{2}+b^{2}\right)} d x =\frac{\pi}{2 b^{2}} \ln (a b+1)}\tag*{} $
When $a=b=1$, $$
\int_{0}^{\infty} \frac{\tan ^{-1} x}{x\left(1+x^{2}\right)} d x=\frac{\pi}{2} \ln 2
$$