<s>[INST] 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.
 [/INST] 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.
</s>