Help evaluating $ \int_{0}^{π} \frac{1}{({3+cosθ})^2}dt $ $\int_{0}^{π} \frac{1}{({3+cosθ})^2}dt $ 
so I approached  
$\frac{1}{2}\int_{0}^{2π} \frac{1}{({3+cosθ})^2}dt $ 
$z=e^{iθ}$,
$\\dθ=\frac{1}{iz}dz\\\cosθ = \frac{e^{iθ}+e^{-iθ}}{2} =\frac{z+z^{-1}}{2}$ 
$\frac{2}{i}\oint\frac{z}{(z^2+6z+1)^2}dz$
then I cannot solve the problem....
 A: It's easy to see that your contour is the unit circle. Find zeros of $z^2+6z+1=0$ inside the unit disk, then you only have one $z_0=-3+2\sqrt{2}$. Let $z_1=-3-2\sqrt{2}$ be another zero, so $\displaystyle \frac{z}{(z^2+6z+1)^2}=\frac{\frac{z}{(z-z_1)^2}}{(z-z_0)^2}$. Use Cauchy's formula or the residue formula.
A: A geometric approach: since $\rho(\theta)=\frac{1}{3+\cos\theta}$ is the polar equation of an ellipse with major axis $2a=\frac{1}{4}+\frac{1}{2}=\frac{3}{4}$ and semi-latus rectum $\frac{b^2}{a}=\frac{1}{3}$, we have:
$$ \int_{0}^{\pi}\rho(\theta)^2\,d\theta = \frac{1}{2}\int_{0}^{2\pi}\rho(\theta)^2\,d\theta = \pi a b = \pi\cdot\frac{3}{8}\cdot\frac{1}{2\sqrt{2}}=\color{red}{\frac{3\pi}{16\sqrt{2}}} $$
since $\int_{0}^{2\pi}\frac{\rho(\theta)^2}{2}\,d\theta$ is the area enclosed by such ellipse.
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{{#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}
\int_{0}^{\pi}{\dd\theta \over \bracks{3 + \cos\pars{\theta}}^{\, 2}} & =
\int_{0}^{\pi}
{\dd\theta \over \braces{3 + \bracks{2\cos^{2}\pars{\theta/2} - 1}}^{\, 2}} =
{1 \over 2}\int_{0}^{\pi/2}
{\dd\theta \over \bracks{1 + \cos^{2}\pars{\theta}}^{\, 2}}
\\[5mm] & =
{1 \over 2}\int_{0}^{\pi/2}
{\sec^{4}\pars{\theta} \over \bracks{\sec^{2}\pars{\theta} + 1}^{\, 2}}
\,\dd\theta =
{1 \over 2}\int_{0}^{\infty}
{t^{2} + 1  \over \pars{t^{2} + 2}^{\, 2}}\,\dd t
\\[5mm] & =
{1 \over 2}\bracks{\int_{0}^{\infty}{\dd t  \over t^{2} + 2} -
\int_{0}^{\infty}{\dd t  \over \pars{t^{2} + 2}^{2}}}
\\[5mm] & =
\left.{1 \over 2}\pars{1 + \partiald{}{a}}
\int_{0}^{\infty}{\dd t  \over t^{2} + a}\,\right\vert_{\,a\ =\ 2} =
\left.{1 \over 2}\pars{1 + \partiald{}{a}}
\pars{a^{-1/2}\,{\pi \over 2}}\,\right\vert_{\,a\ =\ 2}
\\[5mm] & =
{1 \over 4}\,\pi\,{\root{a} \over a}
\left.\pars{1 - {1 \over 2a}}\,\right\vert_{\,a\ =\ 2} =
\bbx{\ds{{3\root{2} \over 32}\,\pi}} \approx 0.4165
\end{align}
A: The poles of the function are $z_1 = 2\sqrt{2}-3$ and $z_2 = -3-2\sqrt{2}$. Only $z_1$ lies inside the unit circle.
You must find the residue of this pole. It's easy to see that its a pole of order $2$, so, the residue has a value of $\displaystyle \frac{-3i}{16\sqrt{2}}$
Hence, the value of your integral is $\displaystyle \pi i \left(\frac{-3i}{16\sqrt{2}}\right) = \frac{3\pi}{16\sqrt{2}}$
