Evaluate $\int_0^\infty\frac{x^2\ln x}{x^4+x^2+1}dx$ by the residue theorem The result should be $\frac{\pi^2}{12}$.
Edit: I have tried to reproduce the image, but limitations of MathJax required some reformatting. Here is the original image.
$$
\begin{align}
\int_0^\infty\frac{x^2\ln x\,\mathrm{d}x}{x^4+x^2+1}&=\int_0^\infty\frac{x^2\ln x}{\left(x^2+x+1\right)\left(x^2-x+1\right)}\\
&\text{poles}\left\{\begin{array}{}
\boxed{\textstyle\frac12+\frac{i\sqrt3}2}&\raise{5pt}{\text{lies inside}\\\text{contour}}\\
\frac12-\frac{i\sqrt3}2\\
\boxed{\textstyle-\frac12+\frac{i\sqrt3}2}&\raise{5pt}{\text{lies inside}\\\text{contour}}\\
-\frac12-\frac{i\sqrt3}2\\
\end{array}\right.
\end{align}
$$
$$
\begin{align}
\int_{-\infty}^0\frac{x^2\ln x\,\mathrm{d}x}{x^4+x^2+1}+\int_0^\infty\frac{x^2\ln x\,\mathrm{d}x}{x^4+x^2+1}&=2\pi i\sum\text{Res}\\
\int_0^\infty\frac{x^2\ln(-x)\,\mathrm{d}x}{x^4+x^2+1}+\int_0^\infty\frac{x^2\ln(x)\,\mathrm{d}x}{x^4+x^2+1}&=\qquad"\\
\int_0^\infty\frac{x^2(i\pi+\ln x)\,\mathrm{d}x}{x^4+x^2+1}+\int_0^\infty\frac{x^2\ln(x)\,\mathrm{d}x}{x^4+x^2+1}&=\qquad"\\
\int_0^\infty\frac{x^2(i\pi)\,\mathrm{d}x}{x^4+x^2+1}+2\int_0^\infty\frac{x^2\ln(x)\,\mathrm{d}x}{x^4+x^2+1}&=\qquad"\\
\end{align}
$$
We need to find the residue
Then we can compare RHS & LHS side
 A: The Residues
$\newcommand{\Res}{\operatorname*{Res}}$
If we have $g(z)$ with a simple zero at $z=z_0$, then
$$
\begin{align}
\Res_{z=z_0}\left(\frac{f(z)}{g(z)}\right)
&=\lim_{z\to z_0}\frac{(z-z_0)f(z)}{g(z)}\tag{1a}\\
&=\frac{f(z_0)}{g'(z_0)}\tag{1b}
\end{align}
$$
Applying $(1)$, we get
$$
\begin{align}
\Res_{z=e^{\pi i/3}}\left(\frac{z^2}{z^4+z^2+1}\right)
&=\frac1{4z+2/z}\tag{2a}\\
&=\frac{3-i\sqrt3}{12}\tag{2b}
\end{align}
$$
$$
\begin{align}
\Res_{z=e^{\pi i/3}}\left(\frac{z^2\color{#C00}{\log(z)}}{z^4+z^2+1}\right)
&=\frac{3-i\sqrt3}{12}\color{#C00}{\frac{\pi i}3}\tag{3a}\\
&=\pi\frac{\sqrt3+3i}{36}\tag{3b}
\end{align}
$$
$$
\begin{align}
\Res_{z=e^{2\pi i/3}}\left(\frac{z^2}{z^4+z^2+1}\right)
&=\frac1{4z+2/z}\tag{4a}\\
&=\frac{-3-i\sqrt3}{12}\tag{4b}
\end{align}
$$
$$
\begin{align}
\Res_{z=e^{2\pi i/3}}\left(\frac{z^2\color{#C00}{\log(z)}}{z^4+z^2+1}\right)
&=\frac{-3-i\sqrt3}{12}\color{#C00}{\frac{2\pi i}3}\tag{5a}\\
&=\pi\frac{2\sqrt3-6i}{36}\tag{5b}
\end{align}
$$

Applying the Residues
You had gotten
$$
\int_{-\infty}^\infty\frac{z^2\log(z)\,\mathrm{d}z}{z^4+z^2+1}
=2\int_0^\infty\frac{z^2\log(z)\,\mathrm{d}z}{z^4+z^2+1}
+\frac{\pi i}2\int_{-\infty}^\infty\frac{z^2\,\mathrm{d}z}{z^4+z^2+1}\tag6
$$
which gives
$$
\begin{align}
\int_0^\infty\frac{z^2\log(z)\,\mathrm{d}z}{z^4+z^2+1}
&=\frac12\int_{-\infty}^\infty\frac{z^2\log(z)\,\mathrm{d}z}{z^4+z^2+1}-\frac{\pi i}4\int_{-\infty}^\infty\frac{z^2\,\mathrm{d}z}{z^4+z^2+1}\tag{7a}\\
&=\pi i\left(\pi\frac{\sqrt3-i}{12}\right)+\frac{\pi^2}2\left(-\frac{i\sqrt3}6\right)\tag{7b}\\
&=\frac{\pi^2}{12}\tag{7c}
\end{align}
$$
Explanation:
$\text{(7a)}$: algebraic manipulation of $(6)$
$\text{(7b)}$: apply $(3)$ and $(5)$ to the first integral
$\phantom{\text{(7b):}}$ and $(2)$ and $(4)$ to the second integral
$\text{(7c)}$: evaluate
We used an upper half-plane semi-circular contour in both integrals on the right-hand side of $\text{(7a)}$. Therefore, we included the residues from the poles at $e^{\pi i/3}$ and $e^{2\pi i/3}$.
A: You can use Feynman's method to evaluate.
Let
$$I(a)=\int_0^\infty\frac{x^a}{x^4+x^2+1}dx.$$
Then
\begin{eqnarray}
I(a)&=&\int_0^1\frac{x^a+x^{2-a}}{x^4+x^2+1}dx\\
&=&\int_0^1\frac{(1-x^2)(x^a+x^{2-a})}{1-x^6}dx\\
&=&\int_0^1\sum_{n=0}^\infty(1-x^2)(x^a+x^{2-a})x^{6n}dx\\
&=&\sum_{n=0}^\infty\int_0^1(1-x^2)(x^a+x^{2-a})x^{6n}dx\\
&=&\sum_{n=0}^\infty\int_0^1(x^{6n+a}+x^{6n+2-a}-x^{6n+2+a}-x^{6n+4-a})dx\\
&=&\sum_{n=0}^\infty\bigg(\frac{1}{6n+a+1}+\frac{1}{6n+3-a}-\frac{1}{6n+3+a}-\frac{1}{6n+5-a}\bigg)
\end{eqnarray}
and hence
\begin{eqnarray}
I'(2)&=&\sum_{n=0}^\infty\bigg(-\frac{2}{(6n+3)^2}+\frac{1}{(6n+1)^2}+\frac{1}{(6n+5)^2}\bigg)\\
&=&-\frac{2}{9}\sum_{n=0}^\infty\frac{1}{(2n+1)^2}+\sum_{n=0}^\infty\bigg(\frac{1}{(6n+1)^2}+\frac{1}{(6n+5)^2}\bigg)\\
&=&-\frac{2}{9}\sum_{n=0}^\infty\frac{1}{(2n+1)^2}+\sum_{n=-\infty}^\infty\frac{1}{(6n+1)^2}\\
&=&-\frac{2}{9}\frac{\pi^2}{8}+\frac{\pi^2}{9}\\
&=&\frac{\pi^2}{12}.
\end{eqnarray}
Here
$$ \sum_{n=0}^\infty\frac{1}{(2n+1)^2}=\frac{\pi^2}{8},\sum_{n=-\infty}^\infty\frac{1}{(6n+1)^2}=\frac{\pi^2}{9} $$
are used.
