TITLE: Evaluate $\int_0^\infty \frac{(\log x)^2}{1+x^2} dx$ using complex analysis
QUESTION [11 upvotes]: How do I compute 

$$\int_0^\infty \frac{(\log x)^2}{1+x^2} dx$$

What I am doing is take 
$$f(z)=\frac{(\log z)^2}{1+z^2}$$
and calculating 
$\text{Res}(f,z=i) = \dfrac{d}{dz} \dfrac{(\log z)^2}{1+z^2}$
which came out to be $\dfrac{\pi}{2}-\dfrac{i\pi^2}{8}+\dfrac{i\pi}{2}$
Im not too sure how to move on from here. the given answer is $\dfrac{\pi^3}{8}$
Any help will be appreciated. thank you in advanced.

REPLY [5 votes]: Using $\beta(3)=\frac{\pi^3}{32}$ from this answer, we can apply $x\mapsto e^{-x}$ to get
$$
\begin{align}
\int_0^\infty\frac{\log(x)^2}{1+x^2}\,\mathrm{d}x
&=\int_{-\infty}^\infty\frac{x^2}{1+e^{-2x}}\,e^{-x}\,\mathrm{d}x\\
&=2\int_0^\infty\frac{x^2}{1+e^{-2x}}\,e^{-x}\,\mathrm{d}x\\
&=2\sum_{k=0}^\infty\int_0^\infty x^2(-1)^ke^{-(2k+1)x}\,\mathrm{d}x\\
&=2\sum_{k=0}^\infty\frac{(-1)^k}{(2k+1)^3}\Gamma(3)\\[6pt]
&=2\beta(3)\Gamma(3)\\[9pt]
&=\frac{\pi^3}8
\end{align}
$$