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

 [/INST] Tha tangent half-angle substitution is not so bad since using $t=\tan(\frac x2)$
$$I=\int\biggl(\frac{\sin(x)}{5-4\cos(x)}\biggr)^2dx=\int\frac{8 t^2}{\left(t^2+1\right) \left(9 t^2+1\right)^2}\,dt$$ Using partial fractions
$$\frac{8 t^2}{\left(t^2+1\right) \left(9 t^2+1\right)^2}=\frac{9}{8 \left(9 t^2+1\right)}-\frac{1}{\left(9 t^2+1\right)^2}-\frac{1}{8
   \left(t^2+1\right)}$$ The second term needs to be integrated by parts. So, we have
$$\int\frac{dt}{\left(9 t^2+1\right)}=\frac{1}{3} \tan ^{-1}(3 t)$$
$$\int\frac{dt}{\left(9 t^2+1\right)^2}=\frac{t}{2 \left(9 t^2+1\right)}+\frac{1}{6} \tan ^{-1}(3 t)$$
$$\int\frac{dt}{
   \left(t^2+1\right)}=\tan ^{-1}( t)$$ making
$$I=-\frac{t}{2 \left(9 t^2+1\right)}-\frac{1}{8} \tan ^{-1}(t)+\frac{5}{24} \tan ^{-1}(3 t)$$ Integrating between $0$ and $\infty$, the first term is $0$ and you are left with $$\frac 5 {24}\frac \pi 2-\frac 1 {8}\frac \pi 2=\frac \pi {24}$$
</s>