Help me to prove this integration Where the method used should be using complex analysis.
$$\int_{c}\frac{d\theta}{(p+\cos\theta)^2}=\frac{2\pi p}{(p^2-1)\sqrt{p^2-1}};c:\left|z\right|=1$$
thanks in advance 
 A: i do my self like this 
on $|z| = 1, z = e^{i\theta}, d\theta=\frac{dz}{iz}$
using substitution $\cos\theta=\frac{z+z^{-1}}{2}$
$\frac{1}{i}\int\frac{\frac{dz}{z}}{(p+\frac{z+{z}^{-1}}{2})(p+\frac{z+{z}^{-1}}{2})} or \frac{1}{i}\int\frac{1}{(2pz+z^2+1)(p+\frac{z+{z}^{-1}}{2})} $
and then multiple by $\frac{z}{z}$
$\frac{1}{i}\int\frac{z}{(2pz+z^2+1)(2pz+z^2+1)}$
the roots of $(2pz+z^2+1)$, $z_{1}=-p+\sqrt{p^2-1};z_{2}=-p-\sqrt{p^2-1}$
let  $z_{1}=a$ and $z_{2}=b$, 
so $a-b=2\sqrt{p^2-1}$ and $ a+b=-2p$
and then i use residue theorm, but the result on the right $\frac{\pi p}{2(p^2-1)\sqrt{p^2-1}}$
A: Hint: Let $z=e^{i \theta}$.  Then $d\theta = dz/(i z)$ and $\cos{\theta} = (1/2) (z+(1/z))$.  You should get a polynomial in the denominator in $z$ - the zeroes of these are the poles of the integrand.  Then use the Residue theorem to express the integral in terms of the residues of those poles within $C$.
A: Hint: 
$$\cos \theta = \frac {z + z^{-1}} 2$$
Plug this in and refer to classic tools in complex analysis, such as the Cauchy formula or the residue theorem.
A: On $|z| = 1$, we have $z = e^{i\theta}$, so $\frac{dz}{d\theta} = i e^{i\theta}$, and hence $d\theta = \frac{dz}{iz}$.
Also on $|z| = 1$, we have $\cos \theta = \frac12\left(z+\frac{1}{z}\right)$.
Putting this together, you get
$$\frac{1}{i} \int_{|z| = 1} \frac{1}{z\left(p+\frac12\left(z+\frac{1}{z}\right)\right)^2}\ dz.$$
Expand the denominator,
$$\begin{align*}
\frac{1}{i} \int_{|z| = 1} \frac{1}{z\left(p+\frac12\left(z+\frac{1}{z}\right)\right)^2}\ dz &= \frac{1}{i} \int_{|z| = 1} \frac{1}{z\left(p^2 + p(z+1/z) + \frac14(z+1/z)^2\right)} \\
&= \frac{1}{i} \int_{|z| = 1} \frac{1}{\left(p^2z + pz^2+p + \frac{z}{4}(z^2+2+1/z^2)
\right)} \\
&= \cdots
\end{align*} $$
Then, apply the residue theorem.
