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

2 Answers

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
• @john doe I have added a hint. – Sunyam Oct 16 '17 at 19:46
• 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
• Yes. That's it. – Sunyam Oct 16 '17 at 19:51
• But I haven't been taught residue theorem in the course – john doe Oct 16 '17 at 19:51

Not an answer strictly speaking, just a remark about real techniques, that turn out to be as effective as complex ones (maybe more) in this case.

$$\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}}}.$$