# Calculation of Complex Integral using residue theorem

I am calculating the following integral:

$$\int_{0}^{2\pi} \frac{1}{5-4\sin(x)} \,dx$$

So far I have the following:

Let $\sin(x) = \frac{1}{2i}$$(z - \frac{1}{z}) So the integral becomes: \oint\limits_{\Gamma} \frac{1}{2z^2 + i5z-2} \,dz The zeroes of the denominator are z = -2i, -\frac{i}{2} Since the first zero is out of the contour \Gamma (the unit circle), then we exclude it. Hence, the only singularity is the second. It is a simple pole. So, we use the residue theorem to say that the value is 2\pi i$$\operatorname{Res}f(z)$ at $z= -\frac{i}{2}$.

This is where I get stuck and get the wrong answer. So after application of the residue theorem, I get $2\pi i$$\operatorname{Res}f(z) = 2\pi i$$\frac{1}{z+2i}$ evaluated at $z = \frac{-i}{2}$, so final answer I get is $\frac{4\pi}{3}$. However, one can check with any software that it is half of that, or $\frac{2\pi}{3}$.

Question is, what am I missing?

Note that $2z^2 + 5iz - 2 = 2(z+2i)(z+\frac{i}{2})$, the $2$ factor shouldn’t be forgotten. So, we have $$2\pi i .\text{Res(f(z))} = 2\pi i \frac{1}{2(2i - \frac{i}{2})} = ??$$
• I see, thanks for pointing that out. So, then the denominator turns out to be $3i$ and so you get the true answer. Thanks! – LordVader007 Nov 30 '17 at 9:16
An alternative approach, driven by symmetry, is to consider that $$\int_{0}^{2\pi}\frac{d\theta}{5-4\sin\theta}=\int_{0}^{\pi}\left[\frac{1}{5-4\sin\theta}+\frac{1}{5+4\sin\theta}\right]\,d\theta =10\int_{0}^{\pi}\frac{d\theta}{25-16\sin^2\theta}$$ equals $$20\int_{0}^{\pi/2}\frac{d\theta}{25-16\cos^2\theta}\stackrel{\theta\mapsto\arctan u}{=}20\int_{0}^{+\infty}\frac{du}{25(1+u^2)-16}=\color{red}{\frac{2\pi}{3}}.$$