TITLE: Evaluate the integral $\int_0^\infty \frac{x (\ln(x))^2}{x^4 + x^2 + 1}\text{ d}x$
QUESTION [10 upvotes]: What is the value of $\displaystyle\int_0^\infty \frac{x (\ln(x))^2}{x^4 + x^2 + 1}\text{ d}x$?
This is a question I came up with myself. It is not homework.
I constructed this example to make the following technique work:

 Integrate $\frac{z (\log(z))^3}{z^4 + z^2 + 1}$ along a "key-hole" contour. The argument can be made rigorous by splitting the contour into two parts, and using two different branch cuts for each part. Warning: This method is time-consuming and not for the faint-hearted

REPLY [3 votes]: $\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{\dsc}[1]{\displaystyle{\color{red}{#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{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\norm}[1]{\left\vert\left\vert\, #1\,\right\vert\right\vert}
 \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{\int_{0}^{\infty}{x\ln^{2}\pars{x} \over x^4 + x^2 + 1}\,\dd x:\ {\large ?}}$.

\begin{align}&\color{#66f}{\large%
\int_{0}^{\infty}{x\ln^{2}\pars{x} \over x^4 + x^2 + 1}\,\dd x}
=\int_{0}^{1}{x\ln^{2}\pars{x} \over x^4 + x^2 + 1}\,\dd x\
+\ \overbrace{\int_{1}^{\infty}{x\ln^{2}\pars{x} \over x^4 + x^2 + 1}\,\dd x}
^{\ds{\dsc{x}\ \mapsto\ \dsc{1 \over x}}}
\\[5mm]&=2\ \overbrace{\int_{0}^{1}{x\ln^{2}\pars{x} \over x^4 + x^2 + 1}\,\dd x}
^{\ds{\dsc{x}\ \mapsto\ \dsc{x^{1/2}}}}\ =\
={1 \over 4}\int_{0}^{1}{\ln^{2}\pars{x} \over x^2 + x + 1}\,\dd x
=\ \overbrace{{1 \over 4}\int_{0}^{1}{\pars{1 - x}\ln^{2}\pars{x} \over 1 - x^{3}}\,\dd x}
^{\ds{\dsc{x}\ \mapsto\ \dsc{x^{1/3}}}}
\\[5mm]&={1 \over 4}\int_{0}^{1}{\pars{1 - x^{1/3}}\ln^{2}\pars{x^{1/3}} \over 1 - x}\,
{1 \over 3}\,x^{-2/3}\,\dd x
={1 \over 108}\int_{0}^{1}{\pars{x^{-2/3} - x^{-1/3}}\ln^{2}\pars{x} \over 1 - x}\,
\,\dd x
\\[5mm]&={1 \over 108}\lim_{\mu\ \to\ 0}\ \partiald[2]{}{\mu}
\int_{0}^{1}{x^{\mu - 2/3} - x^{\mu - 1/3} \over 1 - x}\,\,\dd x
\\[5mm]&={1 \over 108}\lim_{\mu\ \to\ 0}\ \partiald[2]{}{\mu}\pars{%
\int_{0}^{1}{1 - x^{\mu - 1/3} \over 1 - x}\,\,\dd x
-\int_{0}^{1}{1 - x^{\mu - 2/3} \over 1 - x}\,\,\dd x}
\\[5mm]&={1 \over 108}\lim_{\mu\ \to\ 0}\ \partiald[2]{}{\mu}\bracks{%
\Psi\pars{\mu + {2 \over 3}} - \Psi\pars{\mu + {1 \over 3}}}
\end{align}
where $\ds{\Psi}$ is the Digamma Function.

Then,
\begin{align}&\color{#66f}{\large%
\int_{0}^{\infty}{x\ln^{2}\pars{x} \over x^4 + x^2 + 1}\,\dd x}
={1 \over 108}\bracks{\Psi''\pars{2 \over 3} - \Psi''\pars{1 \over 3}}
\end{align}
With Euler Reflection Formula
$\ds{\Psi''\pars{1 - z}
     =\Psi''\pars{z} + 2\pi^{3}\cot\pars{\pi z}\csc^{2}\pars{\pi z}}$:
\begin{align}&\color{#66f}{\large%
\int_{0}^{\infty}{x\ln^{2}\pars{x} \over x^4 + x^2 + 1}\,\dd x}
={1 \over 54}\,\pi^{3}\ \overbrace{\cot\pars{\pi \over 3}}^{\dsc{1 \over \root{3}}}
\ \overbrace{\csc^{2}\pars{\pi \over 3}}^{\dsc{4 \over 3}}
\ = \color{#66f}{\large{2\root{3} \over 243}\,\pi^{3}}
\end{align}