What is the simplest way to compute :$\int^{\pi}_0\bigl(\frac{\sin(x)}{5-4\cos(x)}\bigr)^2dx=\frac{\pi}{24}$ I am trying to compute the following integral.
$$\int^{\pi}_0\biggl(\frac{\sin(x)}{5-4\cos(x)}\biggr)^2dx$$
My attempt was to expand the integrand and make use of the standard change of variables $t =\tan x/2$. But it turns out to be a lengthy and exhausting computations. I can put all details here since it is not pleasant.
at the end I got the answer: 
$$\int^{\pi}_0\biggl(\frac{\sin(x)}{5-4\cos(x)}\biggr)^2dx =\frac{\pi}{24}$$
Maybe it is not correct so do not trust this result at 100%

I would like to know if there is an easiest way or trick that quickly leads to the answer?


Let $z=e^{ix}$ and then
\begin{eqnarray}
&&\int^{\pi}_0\bigg(\frac{\sin(x)}{5-4\cos(x)}\bigg)^2dx\\
&=&\frac12\int^{\pi}_{-\pi}\bigg(\frac{\sin(x)}{5-4\cos(x)}\bigg)^2dx\\
&=&\frac12\int_{|z|=1}\bigg(\frac{\frac{z-\frac1z}{2i}}{5-4\frac{z+\frac1z}{2}}\bigg)^2\frac{dz}{iz}\\
&=&\frac12\int_{|z|=1}\bigg(\frac{z^2-1}{2i(5z-2z^2-2)}\bigg)^2\frac{dz}{iz}\\
&=&-\frac1{8i}\int_{|z|=1}\bigg(\frac{z^2-1}{2z^2-5z+2}\bigg)^2\frac{dz}{z}\\
&=&-\frac1{8i}\int_{|z|=1}\frac{(z^2-1)^2}{z(2z-1)^2(z-2)^2}dz\\
&=&-\frac1{32i}\int_{|z|=1}\frac{(z^2-1)^2}{z(z-\frac{1}{2})^2(z-2)^2}dz\\
&=&-\frac1{32i}\cdot2\pi i\left(\text{Res}\bigg(\frac{(z^2-1)^2}{z(z-\frac{1}{2})^2(z-2)^2},z=0\bigg)+\text{Res}\bigg(\frac{(z^2-1)^2}{z(z-\frac{1}{2})^2(z-2)^2},z=\frac12\bigg)\right)\\
&=&-\frac\pi{16}(1-\frac{5}{3})\\
&=&\frac{\pi}{24}.
\end{eqnarray}
