I am asked to show that $\int \limits_{0}^{2\pi} \frac{\sin(x)^2}{5+4\cos(x)} dx=\frac{\pi}{4}$.
I substitute in $\sin(x)=\frac{1}{2i}(z-\frac{1}{z})$, $\cos(x)=\frac{1}{2}(z+\frac{1}{z})$ and $dx=\frac{1}{z i}dz$ to get: $\int_{|z|=1} \frac{i (z^2-1)^2}{4z^2(z+2)(2z+1)} dz$.
Now, the pole inside the unit circle are $z=0$ (double pole), $z=-\frac{1}{2}$. I get residues $-\frac{5i}{16}$ and $\frac{3}{8i}$, respectively. So the integral should be $2 \pi i (-\frac{5}{16i}+\frac{3}{8i})=\frac{\pi}{8}$. Where am i wrong? Calculating the residues?
Thanks
[I know a similar question has been already asked. However, I would like a pious man to check my calculation of the residues. I don't know where everything went tits up.]