# Calculating integral using Cauchy's integral formula

I have to evaluate $\int _0^{2\pi} \frac {d\theta}{2+cos \theta}$ using Cauchy's integral formula. I have tried to find an $f(z)$ for $\frac1{2\pi i}\int_\gamma\frac {f(z)}{z-z_0}dz = f(z_0)$
I think $\gamma$ should be a circle but I can't find $f(z)$ and $z_0$

• Try the change of variables $z = e^{i\theta}$ and use De Moivre's formula. – Chee Han Oct 16 '17 at 18:58
• @CheeHan can you elaborate please? – john doe Oct 16 '17 at 19:16
• Are you talking about this - math.stackexchange.com/questions/399732/… ? – john doe Oct 16 '17 at 19:29

Use $z=e^{i\theta}_{}$, and convert integral over $\theta$ to $\oint dz$ where the contour is a unit circle around origin in complex z-plane which can be evaluated using Cauchy method. After few simplifications you get : $$\int_{0}^{2\pi} d \theta \frac{1}{2+\cos\theta}=\oint_{|z|=1}^{} dz \frac{-2i}{z^2+4z+1}$$ which can be solved by Cauchy method as : $$\int_{0}^{2\pi} d \theta \frac{1}{2+\cos\theta}=\oint_{|z|=1}^{} dz \frac{\frac{-2i}{z+2+\sqrt{3}}}{ z+2-\sqrt{3}}$$
• It leads to $\frac1{2\pi i}\int_0 ^{2\pi} \frac {f(e^{i\theta}) (ie^{i\theta}) d\theta}{cos\theta + i sin\theta - z_0}$, what should I do next? – john doe Oct 16 '17 at 19:05
• I got that, it has singularity at $-2+\sqrt3$ and $-2-\sqrt3$ one point is inside the unit circle, other is outside, but I have to use the residue theorem then. How is that using Cauchy theorem? – john doe Oct 16 '17 at 19:50
$$\int_{0}^{2\pi}\frac{d\theta}{2+\cos\theta}=2\int_{0}^{\pi}\frac{d\theta}{2+\cos\theta} = 2\int_{0}^{\pi/2}\left(\frac{1}{2+\cos\theta}+\frac{1}{2-\cos\theta}\right)\,d\theta$$ hence: $$\int_{0}^{2\pi}\frac{d\theta}{2+\cos\theta}=8\int_{0}^{\pi/2}\frac{d\theta}{4-\cos^2\theta}\stackrel{\theta\mapsto\arctan t}{=} 8\int_{0}^{+\infty}\frac{dt}{-1+4(1+t^2)}=\color{blue}{\frac{2\pi}{\sqrt{3}}}.$$