# How do I evaluate this integral $\int_0^\pi{\frac{{{x^2}}}{{\sqrt 5-2\cos x}}}\operatorname d\!x$?

Show that $$\int\limits_0^\pi{\frac{{{x^2}}}{{\sqrt 5-2\cos x}}}\operatorname d\!x =\frac{{{\pi^3}}}{{15}}+2\pi \ln^2 \left({\frac{{1+\sqrt 5 }}{2}}\right).$$

I don't have any idea how to start, but maybe I could use the Polylogarithm.

• How would it use "polylogarithms"? – Don Larynx Sep 23 '13 at 3:20
• Where did this problem come from? – Mhenni Benghorbal Sep 23 '13 at 4:34
• Hello,This problem is creat by china (tian27546),But he can't tell me solution – china math Sep 23 '13 at 5:18

This is a more difficult integral than it appears. Let's define

$$J(a) = \int_{-\pi}^{\pi} dx \frac{e^{i a x}}{\sqrt{5}-2 \cos{x}}$$

Then the integral we seek is

$$-\frac12 J''(0) = \int_0^{\pi} dx \frac{x^2}{\sqrt{5}-2 \cos{x}}$$

To evaluate $J(a)$, consider the following contour integral in the complex plane:

$$\oint_C dz \frac{z^a}{z^2-\sqrt{5} z+1}$$

where $C$ is a "keyhole" unit circle, with the keyhole being about the negative real axis, as pictured below.

By the residue theorem, this contour integral is equal to

$$-i 2 \pi \phi^a$$

where $\phi = (\sqrt{5}-1)/2$ is the golden ratio. On the other hand, the integral is also equal to

$$-i J(a) + i 2 \sin{\pi a} \, \int_0^1 dx \frac{x^a}{x^2+\sqrt{5} x+1}$$

Note that the portion of the integral that goes about the center goes to zero. Therefore we have

$$J(a) = 2 \pi \phi^a + 2 \sin{\pi a} \, \int_0^1 dx \frac{x^a}{x^2+\sqrt{5} x+1}$$

With some quick work, the integral we seek is then

$$-\frac12 J''(0) = -\pi \log^2{\phi} - 2 \pi \int_0^1 dx \frac{\log{x}}{x^2+\sqrt{5} x+1}$$

Using the fact that

$$\frac{1}{x^2+\sqrt{5} x+1} = \frac{1}{x+\phi}-\frac{1}{x+1/\phi}$$

$$\int_0^1 dx \frac{\log{x}}{x+a} = \text{Li}_2{\left ( -\frac{1}{a}\right)}$$

$$\text{Li}_2{\left ( -\frac{1}{\phi}\right)} = -\frac{\pi^2}{10} - \log^2{\phi}$$

$$\text{Li}_2{\left ( -\phi\right)} = -\frac{\pi^2}{15} +\frac12 \log^2{\phi}$$

We finally have

$$-\frac12 J''(0) = -\pi \log^2{\phi} - 2 \pi \left [\left ( -\frac{\pi^2}{10} - \log^2{\phi} \right ) - \left ( -\frac{\pi^2}{15} +\frac12 \log^2{\phi} \right ) \right ]$$

or

$$\int_0^{\pi} dx \frac{x^2}{\sqrt{5}-2 \cos{x}} = 2 \pi \log^2{\phi} + \frac{\pi^3}{15}$$

as was to be shown.

• Amazing answer! – Spine Feast Sep 23 '13 at 23:04
• @DepeHb: thanks very much. I hope to be able to derive the dilog results from scratch and provide a more self-contained answer. – Ron Gordon Sep 24 '13 at 11:33
• Play around with the common functional equations of the dilogarithm and you'll be able to determine those dilogarithm values. And sometimes you'll see this integral generalized as $\displaystyle \int_{0}^{\pi} \frac{x^{2}}{1-2a \cos x+a^{2}} \ dx$, although this integral is not quite in that form. – Random Variable Sep 24 '13 at 14:25
• @RandomVariable: thanks, that's great. – Ron Gordon Sep 24 '13 at 14:30
• @RandomVariable: Again, good idea, although in this case, the fraction doesn't fit the given integrand for any value of $a$. – Ron Gordon Feb 4 '14 at 2:06

Using the identity $$\sum_{k=0}^{\infty} a^{k} \cos(kx) = \frac{1- a \cos x}{1-2a \cos x + a^{2}} \ \ ( |a| <1) ,$$

one finds that $$1 + 2 \sum_{k=1}^{\infty} a^{k} \cos(kx) = \frac{1-a^{2}}{1-2a \cos x +a^{2}}.$$

Therefore

\begin{align} \int_{0}^{\pi} \frac{x^{2}}{1-2a \cos x+a^{2}} \ dx &= \frac{1}{1-a^{2}} \Big( \int_{0}^{\pi} x^{2} \ dx + 2 \int_{0}^{\pi}x^{2} \sum_{k=1}^{\pi} a^{k} \cos (kx) \ dx \Big) \\ &= \frac{1}{1-a^{2}} \Big(\frac{\pi^{3}}{3} + 2 \sum_{k=1}^{\infty} a^{k} \int_{0}^{\pi} x^{2} \cos(kx) \ dx \Big) \\ &=\frac{1}{1-a^{2}} \Big( \frac{\pi^{3}}{3} + 2 \sum_{k=1}^{\infty}a^{k} \frac{2 \pi (-1)^{k}}{k^{2}} \Big) \\ &= \frac{1}{1-a^{2}} \Big( \frac{\pi^{3}}{3} +4 \pi \sum_{k=1}^{\infty}\frac{(-a)^{k}}{k^{2}} \Big) \\ &= \frac{1}{1-a^{2}} \Big(\frac{\pi^{3}}{3} + 4 \pi \ \text{Li}_{2}(-a) \Big) . \end{align}

Now express the integral as $$\frac{1}{1+a^{2}} \int_{0}^{\pi} \frac{x^{2}}{1- \frac{2a}{1+a^{2}} \cos x} \ dx$$

and let $\displaystyle a = \frac{1}{\varphi}$ where $\varphi$ is the golden ratio.

Then we have\begin{align} \frac{1}{1+\varphi^{-2}} \int_{0}^{\pi} \frac{x^{2}}{1-\frac{2 \varphi^{-1}}{1+\varphi^{-2}} \cos x} \ dx &= \frac{1}{1+\varphi^{-2}} \int_{0}^{\pi} \frac{x^{2}}{1-\frac{2}{\sqrt{5}} \cos x} \ dx \\ &=\frac{\sqrt{5}}{1+\varphi^{-2}} \int_{0}^{\pi} \frac{x^{2}}{\sqrt{5}-2 \cos x} \ dx \\ &= \frac{1}{1-\varphi^{-2}} \Big(\frac{\pi^{3}}{3} + 4 \pi \ \text{Li}_{2} (- \frac{1}{\varphi}) \Big) \\ &= \frac{1}{1-\varphi^{-2}} \Big(\frac{\pi^{3}}{15} + 2 \pi \ln^{2} (\varphi) \Big) \end{align}

which implies \begin{align} \int_{0}^{\pi} \frac{x^{2}}{\sqrt{5}-2 \cos x} \ dx &= \frac{1}{\sqrt{5}} \frac{1+\varphi^{-2}}{1- \varphi^{-2}} \Big(\frac{\pi^{3}}{15} + 2 \pi \ln^{2} (\varphi) \Big) \\ & = \frac{1}{\sqrt{5}} \sqrt{5}\Big(\frac{\pi^{3}}{15} + 2 \pi \ln^{2} (\varphi) \Big) \\ &= \frac{\pi^{3}}{15} + 2 \pi \ln^{2} (\varphi) . \end{align}

• Nice job Feynman! – Ron Gordon Feb 4 '14 at 12:32
• Thanks. But I'm no Feynman. Not even remotely close. – Random Variable Feb 4 '14 at 17:38
• I hope you got the context (see the comment I made in the DUPLICATE entry about Feynman and integrals). That said, you may be no Feynman (and neither am I), but at least you did what nobody else bothered or was able to do for a while. (Although do not claim it is a completely non-complex method: try deriving the original series expression without complex numbers.) – Ron Gordon Feb 4 '14 at 17:42
• I knew the comment was made in jest. And challenge accepted. I'll edit my post if I come up with something. – Random Variable Feb 4 '14 at 17:47
• I just noticed that someone edited this thread right after my post and removed the $\textit{integration}$ and $\textit{definite-integrals}$ tags. I was wondering why I couldn't seem to find this thread anywhere. – Random Variable Feb 4 '14 at 18:30


$$\color{#c00000}{\int_{0}^{\pi}{x^{2} \over \sqrt 5 - 2\cos\pars{x}}\,\dd x} =\half\int_{-\pi}^{\pi}{x^{2} \over 2\varphi - 1 - 2\cos\pars{x}}\,\dd x\tag{1}$$ where $\ds{\varphi \equiv {1 + \root{5} \over 2} \approx 1.6180}$ is the Golden Ratio.

\begin{align} &\color{#c00000}{\int_{0}^{\pi}{x^{2} \over \sqrt 5 - 2\cos\pars{x}}\,\dd x} =\half \int_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}\verts{{\rm Arg}\pars{z}}\ <\ \pi}} {-\ln^{2}\pars{z} \over 2\varphi - 1 -2\,\pars{z^{2} + 1}/\pars{2z}} \,{\dd z \over \ic z} \\[3mm]&=-\,\half\,\ic \int_{\verts{z}\ =\ 1 \atop {\vphantom{\Huge A}\verts{{\rm Arg}\pars{z}}\ <\ \pi}} {\ln^{2}\pars{z} \over z^{2} - \pars{2\varphi - 1}z + 1} \,\dd z\tag{2} \end{align} Zeros $\ds{z_{\pm}}$ of $\ds{z^{2} - \pars{2\varphi - 1}z + 1 = 0}$ are given by: $$z_{+} = \varphi > 1\,;\qquad\qquad z_{-} = {1 \over \varphi}\,,\quad 0 < z_{-} < 1$$

Expression $\pars{2}$ is reduced to: \begin{align} &\color{#c00000}{\int_{0}^{\pi}{x^{2} \over \sqrt 5 - 2\cos\pars{x}}\,\dd x} =-\,\half\,\ic\braces{2\pi\ic\lim_{z \to z_{-}}\bracks{% {\pars{z - z_{-}}\ln^{2}\pars{z} \over z^{2} - \pars{2\varphi - 1}z + 1}}} \\[3mm]&\mbox{}+ \half\,\ic\int_{-1}^{0} {\bracks{\ln\pars{-x} + \ic\pi}^{2} \over x^{2} - \pars{2\varphi - 1}x + 1}\,\dd x + \half\,\ic\int_{0}^{-1} {\bracks{\ln\pars{-x} - \ic\pi}^{2} \over x^{2} - \pars{2\varphi - 1}x + 1}\,\dd x \\[3mm]&=\pi\,{\ln^{2}\pars{1/\varphi} \over 2\pars{1/\varphi} - \pars{2\varphi - 1}} + \half\,\ic\int_{0}^{-1} {-4\pi\ic\ln\pars{-x} \over x^{2} - \pars{2\varphi - 1}x + 1}\,\dd x\tag{3} \end{align}

Since $\ds{2\,{1 \over \varphi} - \pars{2\varphi - 1} = -1}$, expression $\pars{3}$ becomes: \begin{align} &\color{#c00000}{\int_{0}^{\pi}{x^{2} \over \sqrt 5 - 2\cos\pars{x}}\,\dd x} =-\pi\ln^{2}\pars{\varphi} -2\pi\int_{0}^{1}{\ln\pars{x} \over x^{2} + \pars{2\varphi - 1}x + 1}\,\dd x \tag{4} \end{align} Roots of $\ds{x^{2} + \pars{2\varphi - 1}x + 1 = 0}$ are $\ds{-\varphi}$ and $\ds{-\,{1 \over \varphi}}$ such that $\pars{4}$ is written as:

\begin{align} &\color{#c00000}{\int_{0}^{\pi}{x^{2} \over \sqrt 5 - 2\cos\pars{x}}\,\dd x} \\[3mm]&=-\pi\ln^{2}\pars{\varphi} - 2\pi\int_{0}^{1}\ln\pars{x}\bracks{% \pars{{1 \over x + \varphi} - {1 \over x + 1/\varphi}}\ \overbrace{\pars{{1 \over \varphi} - \varphi}^{-1}}^{\ds{=\ -1}}}\,\dd x \\[3mm]&=-\pi\ln^{2}\pars{\varphi} + 2\pi\bracks{% \int_{0}^{1}{\ln\pars{x} \over \varphi + x}\,\dd x -\int_{0}^{1}{\ln\pars{x} \over 1/\varphi + x}\,\dd x}\tag{5} \end{align}

With $\ds{a > 0}$: \begin{align} \int_{0}^{1}{\ln\pars{x} \over a + x}\,\dd x&= -\int_{0}^{1}{\ln\pars{-a\bracks{-x/a}} \over 1 - \pars{-x/a}}\, \pars{-\,{\dd x \over a}} =-\int_{0}^{-1/a}{\ln\pars{-ax} \over 1 - x}\,\dd x \\[3mm]&=\left.\vphantom{\LARGE A} \ln\pars{1 - x}\ln\pars{-ax}\,\right\vert_{\,x\ =\ 0}^{\,x\ =\ -1/a} -\int_{0}^{-1/a}\ln\pars{1 - x}\,{-a \over -ax}\,\dd x \\[3mm]&=\int_{0}^{-1/a}{-\ln\pars{1 - x} \over x}\,\dd x =\int_{0}^{-1/a}{{\rm Li}_{1}\pars{x} \over x}\,\dd x\tag{6} \end{align} where $\ds{{\rm Li}_{s}\pars{z}}$ is the Polylogarithm Function which satisfies the recurrence relation $${\rm Li}_{s + 1}\pars{z} = \int_{0}^{z}{{\rm Li}_{s}\pars{t} \over t}\,\dd t\qquad\mbox{and} \qquad -\ln\pars{1 - z} = {\rm Li}_{1}\pars{z}$$ $$\mbox{Expression}\ \pars{6}\ \mbox{becomes}\quad \begin{array}{|c|}\hline\\ \quad\int_{0}^{1}{\ln\pars{x} \over x + a}\,\dd x ={\rm Li}_{2}\pars{-\,{1 \over a}}\quad \\ \\ \hline \end{array} \,,\qquad\qquad{\rm Li}_{2}\pars{0} = 0$$ such that $\ds{\pars{~\mbox{see expression}\ \pars{5}~}}$ $$\int_{0}^{1}{\ln\pars{x} \over x + \varphi}\,\dd x -\int_{0}^{1}{\ln\pars{x} \over x + 1/\varphi}\,\dd x ={\rm Li}_{2}\pars{-\,{1 \over \varphi}} -{\rm Li}_{2}\pars{-\varphi}$$

Expression $\pars{5}$ is reduced to: $$\color{#c00000}{\int_{0}^{\pi}{x^{2} \over \sqrt 5 - 2\cos\pars{x}}\,\dd x} =-\pi\ln^{2}\pars{\varphi} + 2\pi\bracks{% {\rm Li}_{2}\pars{-\,{1 \over \varphi}} - {\rm Li}_{2}\pars{-\varphi}}\tag{7}$$ With the identities \begin{align}&\left.\begin{array}{rcl} {\rm L_{i}}_{2}\pars{-\,{1 \over \varphi}} & = & -\,{\pi^{2} \over 15} + \half\,\ln^{2}\pars{\varphi} \\[1mm] {\rm L_{i}}_{2}\pars{-\varphi} & = & -\,{\pi^{2} \over 10} - \ln^{2}\pars{\varphi} \\[5mm] \mbox{we find}\quad {\rm Li}_{2}\pars{-\,{1 \over \varphi}} - {\rm Li}_{2}\pars{-\varphi} & = & {\pi^{2} \over 30} + {3 \over 2}\,\ln^{2}\pars{\varphi} \end{array}\right\rbrace \end{align}

the final result is given by: $$\color{#00f}{\large\int_{0}^{\pi}{x^{2} \over \sqrt 5 - 2\cos\pars{x}}\,\dd x} ={\pi^{3} \over 15} + 2\pi^{2}\ln\pars{\varphi} =\color{#00f}{\large{\pi^{3} \over 15} + 2\pi\ln^{2}\pars{\root{5} + 1 \over 2}}$$