TITLE: Evaluate $\int_{0}^{\pi} \frac{d\theta}{(2+\cos\theta)^2}$
QUESTION [7 upvotes]: How can one evaluate $\displaystyle\int_{0}^{\pi} \frac{d\theta}{(2+\cos\theta)^2}$?
My attempt:
$$\int_{0}^{\pi} \frac{d\theta}{(2+\cos\theta)^2} =  \frac{1}{2}\int_{0}^{2\pi} \frac{d\theta}{(2+\cos\theta)^2}$$
To find the singularity, I solve:
$ (2+\cos\theta)^2 = 0 $ and therefore, $\cos\theta =  -2$.
Substituting: $\cos z = \frac{e^{iz} + e^{-iz}}{2} = \frac{z + \frac{1}{z}}{2}$,
I find that $z = -2 + \sqrt{3} $ is the singular point that lies in the unit circle $|z| = 1$.
From this point, I have little idea how to go about solving this problem. I know I have to find the residue and then just sum them but to get the expression that would cancel out the pole is where I am currently stuck.

REPLY [3 votes]: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[10px,#ffd]{\int_{0}^{\pi}{\dd\theta \over \bracks{2 + \cos\pars{\theta}}^{\,2}}} =
\left.-\,\totald{}{\mu}\int_{0}^{\pi}{\dd\theta \over \mu + \cos\pars{\theta}}
\right\vert_{\ \mu\ =\ 2}
\\[5mm] = &\
-\,\totald{}{\mu}\braces{\int_{0}^{\pi/2}{\dd\theta \over \mu + \cos\pars{\theta}} +
\int_{-\pi/2}^{0}{\dd\theta \over \mu - \cos\pars{\theta}}}_{\mu\ =\ 2}
\\[5mm] = &\
\left.-\,\totald{}{\mu}\int_{0}^{\pi/2}{2\mu \over
\mu^{2} - \cos^{2}\pars{\theta}}\,\dd\theta\,\right\vert_{\ \mu\ =\ 2}
\\[5mm] = &\
\left.-2\,\totald{}{\mu}\int_{0}^{\pi/2}{\mu \over
\mu^{2}\sec^{2}\pars{\theta} - 1}
\,\sec^{2}\pars{\theta}\,\dd\theta\,\right\vert_{\ \mu\ =\ 2}
\\[5mm] = &\
\left.-2\,\totald{}{\mu}\int_{0}^{\infty}{\mu \over
\mu^{2}t^{2} + \mu^{2} - 1}
\,\dd t\,\right\vert_{\ \mu\ =\ 2}
\\[5mm] = &
\left.-\pi\,\totald{}{\mu}{1 \over \root{\mu^{2} - 1}}\right\vert_{\ \mu\ =\ 2} =
\bbx{\ds{{2\root{3} \over 9}\,\pi}}
\end{align}