Evaluate $\int_0^\infty \frac{(\log x)^2}{1+x^2} dx$ using complex analysis
For this integral, you want to define you branch cut along the negative x axis and use a contour with a semi circle around the origin.
Also, note we are taking the real Cauchy Principal value. Then $$ \int_0^{\infty}\frac{(\ln(z))^2}{1+z^2}dz = \int_{\Gamma}f(z)dz+\int_{\gamma}f(z)dz + \int_{-\infty}^0f(z)dz + \int_0^{\infty}f(z)dz $$ Let $R$ be the radius of big semi circle, $\Gamma$ and $\delta$ the radius of the small semi circle $\gamma$. When $R\to\infty$, $\int_{\Gamma}\to 0$ and $\int_{\gamma}\to 0$ when $\delta\to 0$ by the estimation lemma. Then $$ \int_{-\infty}^0f(z)dz + \int_0^{\infty}f(z)dz = 2\pi i \sum\text{Res}_{\text{UHP}} $$ where UHP is the upper half plane. There is only one pole in the upper half plane and that is $z = i$ $$ \text{Re PV}\biggl[\int_{-\infty}^0\frac{(\ln|z| + i\pi)^2}{z^2+1}dz + \int_0^{\infty}\frac{(\ln|z| + i\cdot 0)^2}{z^2+1}dz\biggr] = 2\pi i\sum\text{Res}_{\text{UHP}} $$ Recall that $\ln(z) = \ln|z| + i\arg(z)$. Can you take it from here?
Mouse over for solution.
\begin{align}\text{Re PV}\biggl[\int_{-\infty}^0\frac{\ln^2|z| + 2\pi i\ln|z| - \pi^2}{z^2 + 1}dz +\int_0^{\infty}\frac{\ln^2|z|}{z^2 + 1}dz\biggr]&= 2\pi i\lim_{z\to i}(z - i)\frac{(\ln|z| + i\pi/2)^2}{z^2+1}\\2\int_0^{\infty}\frac{\ln^2(x)}{x^2 + 1}dx - \pi^2\int_0^{\infty}\frac{dx}{x^2+1} &= -\frac{\pi^3}{4}\\2\int_0^{\infty}\frac{\ln^2(x)}{x^2 + 1}dx - \frac{\pi^3}{2} &= -\frac{\pi^3}{4}\\\int_0^{\infty}\frac{\ln^2(x)}{x^2 + 1}dx &= \frac{\pi^3}{4} - \frac{\pi^3}{8}\\&= \frac{\pi^3}{8}\end{align}
$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$ $\ds{}$ \begin{align} \overbrace{\color{#66f}{\large\int_{0}^{\infty}{\ln^{2}\pars{x} \over 1 + x^{2}}\,\dd x}}^{\ds{\color{#c00000}{x^{2}\ \mapsto\ x}}}&\ =\ \int_{0}^{\infty}{\ln^{2}\pars{x^{1/2}} \over 1 + x}\,\half\,x^{-1/2}\,\dd x ={1 \over 8}\int_{0}^{\infty}{x^{-1/2}\ln^{2}\pars{x} \over 1 + x}\,\dd x \\[5mm]&={1 \over 8}\,\lim_{\mu\ \to\ -1/2}\totald[2]{}{\mu} \color{#c00000}{\int_{0}^{\infty}{x^{\mu} \over 1 + x}\,\dd x}\tag{1} \end{align}
\begin{align}&\color{#c00000}{% \int_{0}^{\infty}{x^{\mu} \over 1 + x}\,\dd x} =2\pi\ic\expo{\pi\mu\ic} -\int_{\infty}^{0}{x^{\mu}\expo{2\pi\mu\ic} \over 1 + x}\,\dd x =2\pi\ic\expo{\pi\mu\ic} +\expo{2\pi\mu\ic}\color{#c00000}{\int_{0}^{\infty}{x^{\mu} \over 1 + x}\,\dd x} \\[5mm]&\imp\color{#c00000}{\int_{0}^{\infty}{x^{\mu} \over 1 + x}\,\dd x} ={2\pi\ic\expo{\pi\mu\ic} \over 1 - \expo{2\pi\mu\ic}} =\pi\,{2\ic \over \expo{-\pi\mu\ic} - \expo{\pi\mu\ic}}=-\pi\csc\pars{\pi\mu} \end{align}
Replacing in $\pars{1}$: \begin{align} &\color{#66f}{\large\int_{0}^{\infty}{\ln^{2}\pars{x} \over 1 + x^{2}}\,\dd x} ={1 \over 8}\,\lim_{\mu\ \to\ -1/2}\totald[2]{\bracks{-\pi\csc\pars{\pi\mu}}}{\mu} \\[5mm]&={1 \over 8}\,\lim_{\mu\ \to\ -1/2}\braces{-\pi\bracks{% \pi^{2}\cot^{2}\pars{\pi\mu}\csc\pars{\pi\mu} + \pi^{2}\csc^{3}\pars{\pi\mu}}} \\[5mm]&={1 \over 8}\braces{-\pi\bracks{\pi^{2}\csc^{3}\pars{-\,{\pi \over 2}}}} =\color{#66f}{\large{\pi^{3} \over 8}} \end{align}
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} $$