How to solve this integral using the method of residues? Using the method of residues, verify the following.
$$\int_0^{\pi} \frac{d \theta}{(3+2cos \theta)^2} = \frac{3 \pi \sqrt{5}}{25}$$
I tried doing this but can't get the correct answer, here is my attempt:
first I substituted $cos \theta = \frac{z+ \frac{1}{z}}{2}$ and $d \theta = \frac{dz}{iz}$ and got $\int_0^{\pi} \frac{dz}{iz(3+z+\frac{1}{z})^2}$  
then I multiplied top and bottom my $iz$ so that the $i$ moves to the top and on the bottom I'll have $z^2$ so I can distribute it into the rest of it and get $-i \int_0^{\pi} \frac{zdz}{(3z+z^2+1)^2}$
the denominator has two zeroes at $-\frac{3}{2} \pm \sqrt{\frac{5}{4}}$, since the denominator is squared the function has poles here of order two.
The I used Cauchy's Residue theorem but first I needed to find the residue at $-\frac{3}{2} + \sqrt{\frac{5}{4}}$ because only this pole is inside the unit circle.
I found the residue using theorem 1 on pdf page 324/579 from this textbook
http://english-c.tongji.edu.cn/_SiteConf/files/2014/05/05/file_53676237d7159.pdf
After finding the residue using that formula and applying cauchy's residue theorem I do not get an answer close to $\frac{3 \pi \sqrt{5}}{25}$  
I am not sure how to handle the fact that the integral is from $0$ to $\pi$ rather then from $0$ to $2\pi$, and I am not sure if I made any mistakes when finding the poles and residues.

Note
$$\int_0^{\pi} \frac{d \theta}{(3+2\cos \theta)^2} = \frac12\int_0^{2\pi} \frac{d \theta}{(3+2\cos \theta)^2}.$$
Let $z=e^{i\theta}$ and hence one has
\begin{eqnarray}
&&\int_0^{\pi} \frac{d \theta}{(3+2\cos \theta)^2}\\
&=&\frac12\int_0^{2\pi} \frac{d \theta}{(3+2\cos \theta)^2}\\
&=&\frac12\int_{|z|=1}\frac{1}{(3+z+z^{-1})^2}\frac{dz}{iz}\\
&=&\frac1{2i}\int_{|z|=1}\frac{z}{(z^2+3z+1)^2}dz\\
&=&\pi\text{Res}(f(z),z=\frac{1}{2}(-3+\sqrt5))\\
&=& \frac{3 \pi \sqrt{5}}{25}
\end{eqnarray}
where $f(z)=\frac{z}{(z^2+3z+1)^2}$ has only one pole $z=\frac{1}{2}(-3+\sqrt5)$ inside $|z|=1$.
