# Integral $\int_0^{2\pi}\frac{dx}{2+\cos{x}}$

How do I integrate this?

$$\int_0^{2\pi}\frac{dx}{2+\cos{x}}, x\in\mathbb{R}$$

I know the substitution method from real analysis, $t=\tan{\frac{x}{2}}$, but since this problem is in a set of problems about complex integration, I thought there must be another (easier?) way.

I tried computing the poles in the complex plane and got $$\text{Re}(z_0)=\pi+2\pi k, k\in\mathbb{Z}; \text{Im}(z_0)=-\log (2\pm\sqrt{3})$$ but what contour of integration should I choose?

• Substitute $z = e^{ix}$. Things should fall into place then. – Daniel Fischer Nov 18 '14 at 12:19
• With @DanielFischer comment, you then have $\cos(z) = \frac{z + 1/z}{2}$. Now you can find the poles and residues at the poles in your integral. – dustin Nov 18 '14 at 12:22
• @DanielFischer side bar comment: you seem to be well versed in complex analysis, do you have any book recommendations for after Serge Lang's book on complex analysis> – dustin Nov 18 '14 at 13:01
• @dustin I haven't read Lang's book, so I don't know what is covered there (and how broadly/deeply), so I can't say what you should read to cover what Lang has left out/treated not extensively enough. Ahlfors and Rudin (RCA) are always good to read to get additional perspectives [and very likely some material not covered in what you've read before, no book covers all topics]. – Daniel Fischer Nov 18 '14 at 13:07

For completeness, we know that $\cos(x) = \frac{e^{ix}+e^{-ix}}{2}$ and from @danielfischer's comment, $z=e^{ix}$, we are able to obtain $\cos(z) = \frac{z + 1/z}{2}$. Then $dx =\frac{dz}{iz}$. Therefore, we have the following integral were $\gamma$ is to be taking counter clockwise such that $|z|=1$ $$\int_{\gamma}\frac{1}{2 + \frac{z + 1/z}{2}}\frac{dz}{iz} = \int_{\gamma}\frac{2z}{4z + z^2 + 1}\frac{dz}{iz}$$ Then the poles occur at $z^2 + 4z + 1$. However, we only need to consider the pole in the contour.
First note that $\displaystyle2+\cos x=\frac{3+\tan ^2 \frac{x}{2}}{1+\tan^2 \frac{x}{2}}$. Also note that for $\displaystyle f(x)=\frac{3+\tan ^2 \frac{x}{2}}{1+\tan^2 \frac{x}{2}}$, it holds that $\displaystyle f(x+\pi)=f(x)$ for $0<x<\pi$. Therefore \begin{align}\int_0^{2\pi}\frac{1}{2+\cos x}dx&=\int_0^{2\pi}\frac{1+\tan^2 \frac{x}{2}}{3+\tan ^2 \frac{x}{2}}dx\\ &=2\int_0^{\pi}\frac{1+\tan^2 \frac{x}{2}}{3+\tan ^2 \frac{x}{2}}dx \\ &=2\pi-4\int_0^{\pi}\frac{1}{3+\tan ^2 \frac{x}{2}}dx \\ &=2\pi-8\int_0^{\infty}\frac{1}{(3+u^2)(1+u^2)}du\\ &=2\pi-4\int_0^{\infty}\frac{1}{1+u^2}du+4\int_0^{\infty}\frac{1}{3+u^2}du\\ &=\frac{2\pi}{\sqrt{3}} \end{align}