Calculate this integral, $\int_0^{\infty}\frac{\ln^2x}{1+x^2}dx$ $\displaystyle\int_0^{\infty}\dfrac{\ln^2x}{1+x^2}dx$
$x=\arctan\alpha$
$dx=\dfrac{1}{1+\alpha^2}d\alpha$
and try a lot items, but didnt arrived anywhere.
 A: We may prove through Euler's beta function and the reflection formula for the $\Gamma$ function that for any $a\in(-1,1)$ we have
$$ I(a)=\int_{0}^{+\infty}\frac{x^a}{x^2+1}\,dx = \frac{\pi}{2\cos\left(\frac{\pi a}{2}\right)} \tag{1}$$
hence:
$$ I''(0) = \int_{0}^{+\infty}\frac{\log^2(x)}{x^2+1}\,dx = \lim_{a\to 0}\frac{\pi^3(3-\cos(a\pi))}{16\cos^3\left(\frac{\pi a}{2}\right)}=\color{red}{\frac{\pi^3}{8}}.\tag{2}$$
I would like to point out a related fact, too.
A: Hint. A possible route. One may write, with the change of variable $x \to \frac1x$,
$$
\int_0^{\infty}\dfrac{\ln^2x}{1+x^2}dx=\int_0^1\dfrac{\ln^2x}{1+x^2}dx+\int_1^{\infty}\dfrac{\ln^2x}{1+x^2}dx=2\int_0^1\dfrac{\ln^2x}{1+x^2}dx
$$ then one may expand the integrand and integrate termwise, getting
$$
2\int_0^1\dfrac{\ln^2x}{1+x^2}dx=2\sum_{n=0}^\infty(-1)^n\int_0^1x^{2n}\ln^2xdx=4\sum_{n=0}^\infty\frac{(-1)^n}{(2n+1)^3}=\frac{\pi ^3}{8}.
$$
A: Let us evaluate it via the Mellin transform
\begin{equation}
\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} x^{s-1} f(x) \mathrm{d} x
\label{eq:1608132}
\tag{2}
\end{equation}
where
\begin{equation}
f(x) = \frac{1}{1+x^{2}}
\label{eq:1608133}
\tag{3}
\end{equation}
Applying the Mellin transform, yields
\begin{equation}
\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} \frac{x^{s-1}}{1+x^{2}} \mathrm{d} x = \frac{\pi}{2}\csc\left(\frac{\pi}{2}s\right)
\label{eq:1608134}
\tag{4}
\end{equation}
And thus
\begin{align}
\int\limits_{0}^{\infty} \frac{\mathrm{ln}^{2}(x)}{1+x^{2}} \mathrm{d} x & = \frac{\mathrm{d}^{2}}{\mathrm{d}s^{2}} \int\limits_{0}^{\infty} \frac{x^{s-1}}{1+x^{2}} \mathrm{d} x |_{s=1} \\
& = \frac{\mathrm{d}^{2}}{\mathrm{d}s^{2}} \frac{\pi}{2}\csc\left(\frac{\pi}{2}s\right) |_{s=1} \\
& = \frac{\pi^{3}}{16}[\cos(\pi s) + 3]\csc^{3}\left(\frac{\pi}{2}s\right)  |_{s=1} \\
& = \frac{\pi^{3}}{8}
\label{eq:1608135}
\tag{5}
\end{align}
