# Trigonometric Integral Using Residue Theorem

Evaluate:

$$\int_{0}^{2\pi} \frac{1}{1+a^2-2a \cos(x)} dx$$

where $a>1$.

I am trying to transform the integral into a contour integral in which the Residue Theorem would apply, but am having trouble.

Hint: One way is to let $z=e^{ix}$ so that $\mathrm{d}x=\frac{\mathrm{d}z}{iz}$ and $\cos(x)=\frac12\left(z+z^{-1}\right)$. Then

\begin{align} \int_{|z|=1}\frac1{1+a^2-a\left(z+z^{-1}\right)}\frac{\mathrm{d}z}{iz} &=\frac ia\int_{|z|=1}\frac1{z^2-z\left(\frac1a+a\right)+1}\mathrm{d}z\\ &=\frac ia\int_{|z|=1}\frac1{(z-a)\left(z-\frac1a\right)}\mathrm{d}z \end{align}

• I did that, but then you end up with a denominator that isn't readily factorable. – Analysis15 Dec 5 '16 at 7:43
• It would be helpful to mention that in your question so that we know where to start. – robjohn Dec 5 '16 at 7:44
• The denominator looks pretty factorable. – robjohn Dec 5 '16 at 7:52

Another variant is applying Poisson's formula to the constant function $f(z)=1$ and the point $\frac1a$: $$1 = f(\tfrac1a) = \frac1{2\pi} \int_0^{2\pi} \frac{1-\frac1{a^2}}{1-\frac2a\cos x+\frac1{a^2}} f(e^{ix}) \,\mathrm{d}x = \frac{a^2-1}{2\pi} \int_0^{2\pi} \frac{\mathrm{d}x}{1-2a\cos x+a^2}$$ so $$\int_0^{2\pi} \frac{\mathrm{d}x}{1-2a\cos x+a^2} = \frac{2\pi}{a^2-1}.$$

Put

$$z=e^{ix}\implies dz=ie^{ix}=iz\,dx\implies dx=-\frac{i\,dz}z\;,\;\;\cos x=\frac{z+z^{-1}}2=\frac{z^2+1}{2z}\implies$$

$$\int_0^{2\pi}\frac{dx}{1+a^2-2a\cos x}=\oint_{|z|=1}-\frac{i\,dz}z\frac1{1+a^2-2a\frac{z^2+1}{2z}}=$$

$$=i\oint_{|z|=1}\frac{dz}{az^2-(a^2+1)z+a}=\frac ia\oint_{|z|=1}\frac{dz}{(z-a)\left(z-\frac1a\right)}$$

Can you finish now?

• I don't think you get $\cos(x)=\frac{ae^{ix}+a^{-1}e^{-ix}}{2}$. Also, $\mathrm{d}x=-\frac{i\,\mathrm{d}z}{z}$ without the $a$ in the denominator. – robjohn Dec 5 '16 at 7:59
• @robjohn Thanks, I shall check... Thanks, done: you were right. Edited. – DonAntonio Dec 5 '16 at 8:33