# Show that $\int_1^{\infty } \frac{(\ln x)^2}{x^2+x+1} \, dx = \frac{8 \pi ^3}{81 \sqrt{3}}$

I have found myself faced with evaluating the following integral: $$\int_1^{\infty } \frac{(\ln x)^2}{x^2+x+1} \, dx.$$

Mathematica gives a closed form of $8 \pi ^3/(81 \sqrt{3})$, but I have no idea how to arrive at this closed form. I've tried playing around with some methods from complex analysis, but I haven't had much luck (it has been a while). Does anyone have any ideas? Thanks in advance!

• So, you've tried contour integration? – Mark Viola Mar 11 '15 at 22:40

Shocked, shocked! that there is no contour integration yet. So, without further ado...

Note that

$$f(x) = \frac{\log^2{x}}{x^2+x+1} \implies f \left ( \frac1{x} \right ) = x^2 f(x)$$

Thus, $$\int_1^{\infty} dx \frac{\log^2{x}}{x^2+x+1} = \int_0^{1} \frac{\log^2{x}}{x^2+x+1} = \frac12 \int_0^{\infty} dx \frac{\log^2{x}}{x^2+x+1}$$

Now consider

$$\oint_C dz \frac{\log^3{z}}{z^2+z+1}$$

where $C$ is a keyhole contour of outer radius $R$ and inner radius $\epsilon$. Taking the limit as $R \to \infty$ and $\epsilon \to 0$, we get that the contour integral is equal to

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

or

$$-i 6 \pi \int_0^{\infty} dx \frac{\log^2{x}}{x^2+x+1} + 12 \pi^2 \int_0^{\infty} dx \frac{\log{x}}{x^2+x+1} +i 8 \pi^3 \int_0^{\infty} dx \frac{1}{x^2+x+1}$$

Note that the first integral is what we seek, the second integral is zero (by the same trick we applied above), and the third integral is relatively easy to find:

$$\int_0^{\infty} \frac{dx}{x^2+x+1} = \int_0^{\infty} \frac{dx}{(x+1/2)^2+3/4} = \frac{2}{\sqrt{3}} \left [\arctan{\frac{2}{\sqrt{3}} \left ( x+\frac12 \right )} \right ]_0^{\infty} = \frac{2 \pi}{3 \sqrt{3}}$$

The contour integral is also equal to $i 2 \pi$ times the sum of the residues at the poles of the integrand, which are at $z_+ = e^{i 2 \pi/3}$ and $z_- = e^{i 4 \pi/3}$. The sum of the residues is

$$\frac{-i 8 \pi^3/27}{i \sqrt{3}} + \frac{-i 64 \pi^3/27}{-i \sqrt{3}} = \frac{56 \pi^3}{27 \sqrt{3}}$$

Then

$$-i 6 \pi \int_0^{\infty} dx \frac{\log^2{x}}{x^2+x+1} = i 2 \pi \frac{56 \pi^3}{27 \sqrt{3}} - i 8 \pi^3 \frac{2 \pi}{3 \sqrt{3}} = -i \frac{32 \pi^4}{27 \sqrt{3}}$$

Thus,

$$\int_1^{\infty} dx \frac{\log^2{x}}{x^2+x+1} = \frac12 \int_0^{\infty} dx \frac{\log^2{x}}{x^2+x+1} = \frac{8 \pi^3}{81 \sqrt{3}}$$

• Straight forward!! – Mark Viola Mar 12 '15 at 0:32
• Just what I was looking for, Thanks! – stochasm Mar 12 '15 at 2:42

It can be observed that $x^{2} + x + 1 = (x-a)(x-b)$ where $a = e^{2\pi i/3}$ and $b = e^{-2\pi i/3}$. Now \begin{align} I &= \int_{1}^{\infty} \frac{ (\ln(x))^{2} }{ (x-a)(x-b) } \, dx = \frac{1}{a-b} \, \int_{1}^{\infty} \left( \frac{1}{x-a} - \frac{1}{x-b} \right) \, (\ln(x))^{2} \, dx. \end{align} From Wolfram Alpha the integral \begin{align} \int \frac{ (\ln(x))^{2} }{ x - a } dx = -2 Li_{3}\left( \frac{x}{a} \right) +2 \log(x) \, Li_{2} \left( \frac{x}{a} \right) + \log^{2}(x) \log\left( 1-\frac{x}{a} \right) \end{align} for which the integral in question becomes \begin{align} I &= \left[ \frac{-2}{a-b} \left(Li_{3}\left( \frac{x}{a} \right) - Li_{3}\left(\frac{x}{b} \right) \right) + \frac{2}{a-b} \log(x) \, \left(Li_{2} \left( \frac{x}{a} \right) - Li_{2}\left( \frac{x}{b} \right) \right) + \frac{1}{a-b} \, \log^{2}(x) \log\left( \frac{a-x}{b-x} \right) \right]_{1}^{\infty} \\ &= \frac{-2}{a-b} \left[ Li_{3}\left( \frac{1}{a} \right) - Li_{3}\left(\frac{1}{b} \right) \right]. \end{align} This can then be seen as \begin{align} I &= \frac{-2i}{\sqrt{3}} \left[ Li_{3}\left( e^{2\pi i/3} \right) - Li_{3}\left( e^{- 2\pi i/3} \right) \right] \\ &= \frac{-2 i}{\sqrt{3}} \cdot \frac{4 \pi^{3} i}{81} = \frac{8 \pi^{3}}{81 \sqrt{3}}. \end{align}

\begin{align} \int_{1}^{\infty} \frac{ (\ln(x))^{2} }{ x^{2} + x + 1 } \, dx = \frac{8 \pi^{3}}{81 \sqrt{3}}. \end{align}

Hint: In general, $~I_n(k)~=~\displaystyle\int_0^\infty\frac{x^{k-1}}{1-x^n}~dx~=~\frac\pi n~\cot\bigg(k~\frac\pi n\bigg),~$ see Cauchy principal value.

At the same time, a simple substitution of the form $t=\dfrac1x$ shows that the original integral can be

written as $J=\displaystyle\int_1^\infty f(x)~dx~=~\int_0^1f(x)~dx~=~\frac12~\int_0^\infty f(x)~dx.~$ Then, by rewriting the

integrand using $\dfrac1{x^2+x+1}=\dfrac{1-x~}{1-x^3}~,~$ we have $J=\dfrac{I_3''(1)-I_3''(2)}2$.

Here is an approach.

Observe that $$I:=\int_1^{\infty } \frac{(\ln x)^2}{x^2+x+1} \, dx=\int_1^{\infty } \frac{(x-1)(\ln x)^2}{x^3-1} \, dx$$ and by the change of variable $x \to 1/x$ $$I=\int_0^1 \frac{(1-x)\color{blue}{(\ln x)^2}}{1-x^3} \, dx. \tag1$$ Since $\displaystyle \color{red}{\partial_s^2\color{red}{ (x^s)}|_{\large s=0}}=\color{blue}{(\ln x)^2}$, one may write that $$I=\left.\color{red}{\partial_s^2}\left(\int_0^1 \frac{x^s(1-x)}{1-x^3} \, dx\right)\right|_\color{red}{{\large s=0}} \tag2$$ Now \begin{align} \int_0^1 \frac{x^s(1-x)}{1-x^3} \, dx&=\frac13\int_0^1 \frac{u^{(s-2)/3}-u^{(s-1)/3}}{1-u} \, du\qquad (u=x^3,\,x=u^{1/3})\\\\ &=\frac13\int_0^1 \frac{(1-u^{(s-1)/3})-(1-u^{(s-2)/3})}{1-u} \, du\\\\ &=\frac13\int_0^1 \frac{1-u^{(s-1)/3}}{1-u} \, du-\frac13\int_0^1 \frac{1-u^{(s-2)/3}}{1-u} \, du\\\\ &=\frac13\psi\left(\frac{s+2}{3}\right)-\frac13\psi\left(\frac{s+1}{3}\right) \tag3 \end{align} where we have used the standard integral representation for the digamma function.

Then using $(2)$, we get $$I=\frac1{27}\psi''\!\!\left(\frac{2}{3}\right)-\frac1{27}\psi''\!\!\left(\frac{1}{3}\right)=\frac{8\pi^3}{81\sqrt{3}}$$ taking into account some special values of $\psi''$.

Note $$\int_0^1x^m(\ln x)^2dx=\frac{2}{(m+1)^3}$$ So \begin{eqnarray} I&=&\int_1^{\infty } \frac{(\ln x)^2}{x^2+x+1}dx\\ &=&\int_0^1\frac{(1-x)(\ln x)^2}{1-x^3}dx\\ &=&\int_0^1\sum_{n=0}^\infty(1-x)x^{3n}(\ln x)^2dx\\ &=&2\sum_{n=0}^\infty\left(\frac{1}{(3n+1)^3}-\frac{1}{(3n+2)^3}\right)\\ &=&2\sum_{n=-\infty}^\infty\frac{1}{(3n+1)^3} \end{eqnarray} Note \begin{eqnarray} \sum_{n=-\infty}^\infty\frac{1}{(3n+1)^3}=-\pi\text{Res}(\frac{1}{(z+1)^3}\cot(\pi z),-\frac{1}{3})=\frac{4\pi^3}{81\sqrt3} \end{eqnarray} and hence $$I=\frac{8\pi^3}{81\sqrt3}.$$