# A Definite Integral Using the Residue Theorem

1. Apr 12, 2014

### AppleFritters

1. The problem statement, all variables and given/known data
I'm trying to solve this definite integral using the residue theorem:

$$\int _0^\pi \frac{d \theta}{ (2+ \cos \theta)^2}$$​

2. Relevant equations

I got the residue theorem which says that
$$\oint_C f(z)dz = 2 \pi i \ \ \text{times the sum of the residues inside C}$$

3. The attempt at a solution
$$\int _0^\pi \frac{d \theta}{ (2+ \cos \theta)^2} = \frac{1}{2} \int _0 ^ {2\pi} \frac{d \theta}{ (2+ \cos \theta)^2} = \frac{1}{2} \int _0 ^ {2\pi} \frac{d \theta}{ (4+ 4 \cos \theta + \cos^2 \theta)} \\$$

I can rewrite $$\cos \theta$$ as $$\cos \theta = \frac{1}{2} (e^{i \theta} + e^{-i \theta})$$

So substituting this in, I get

$$\frac{1}{2} \int _0 ^ {2\pi} \frac{d \theta}{ (\frac{9}{2} + \frac{1}{4}e^{2i \theta} + \frac{1}{4}e^{-2i \theta} + 2e^{i \theta} + 2e^{-i\theta})}$$

Now I make the integral into a contour integral and also make a change of variables:

$$z=e^{i \theta}, \hspace{2ex} dz = izd\theta , \hspace{2ex} d \theta = \frac{1}{iz} dz\\ \frac{1}{2}\oint_{\text{unit circle}} \frac{1}{iz} \left(\frac{dz}{\frac{9}{2} + \frac{z^2}{4} + \frac{1}{4z^2} + 2z + \frac{2}{z}}\right) = \frac{1}{2i} \oint \frac{1}{z} \left( \frac{dz}{\frac{1}{4z^2} (z^4 + 8z^3 + 18z^2 + 8z + 1)} \right) = \frac{1}{2i} \oint \frac{zdz}{\frac{1}{4}(z^2 + 4z + 1)^2}$$

To find the singularities, I used the quadratic equation and got
$$z_1 = -2 + \sqrt{3} \\ z_2 = -2 - \sqrt{3}$$
$z_1$ lies inside the unit circle but $z_2$ does not. It looks like I'm going to have a second order pole at $z_1 = -2 + \sqrt{3}$ so now I'm going to find the residue at $z_1$

$$\frac{1}{2i} \oint \frac{zdz}{\frac{1}{4}(z^2 + 4z + 1)^2} = \frac{1}{2i} \oint \frac{zdz}{\frac{1}{4}((z + z_1)(z+z_2))^2}$$

Since this is a second order pole, to find the residue, I multiply $f(z)$ by $(z+z_1)^2$, then differentiate the result once.

$$(z+z_1)^2 f(z) = \frac{z(z+z_1)^2}{((z+z_1)(z+z_2))^2} = \frac{z}{(z+z_2)^2} \hspace{3ex} \rightarrow \hspace{3ex} \frac{d}{dz} \left( \frac{z}{(z+z_2)^2} \right) = -\frac{2z}{(z+z_2)^3} + \frac{1}{(z+z_2)^2}$$

Now take the limit as $z \rightarrow z_1$ or just evaluating the expression at $z=z_1$

$$-\frac{2(-2+\sqrt{3})}{(-2 + \sqrt{3} + -2 - \sqrt{3})^3} + \frac{1}{(-2 + \sqrt{3} + -2 - \sqrt{3})^2} = \frac{-2(-2 + \sqrt{3})}{(-4)^3} + \frac{1}{(-4)^2} = \frac{\sqrt{3}}{32}$$

So I get $\frac{\sqrt{3}}{32}$ for the residue. Now applying the residue theorem,

$$\frac{1}{2i} \oint \frac{zdz}{\frac{1}{4} (z^2+4z+1)^2} = \frac{1}{2i} 2 \pi i (4) \left( \frac{\sqrt{3}}{32} \right) = \boxed{\frac{\pi \sqrt{3}}{8}}$$

The answer is supposed to be $\frac{2 \pi}{3\sqrt{3}}$. I can't figure out what I did wrong. Can anyone please point out where I made a mistake? Thank you.

2. Apr 13, 2014

### vela

Staff Emeritus
Sign errors. In terms of $z_1$ and $z_2$, $f(z)$ is $\frac{z}{(z-z_1)^2(z-z_2)^2}$.

3. Apr 13, 2014

### AppleFritters

That was such a silly mistake. I kept reworking this problem so many times because of this simple mistake. Thank you so much