Finding $\int_{0}^{2\pi} \frac {(1+2\cos\theta)^n\cos(n\theta)}{3+2\cos\theta} \operatorname{d}\theta$ If $n$ is a positive integer find
$$
\int_{0}^{2\pi} \frac {(1+2\cos\theta)^n\cos(n\theta)}{3+2\cos\theta} \operatorname{d}\theta
$$
I know that I have to use contour integral with a circle of radius 1 centered at the origin, but I am having trouble converting the integral into the form $\int_{|z|}$
$$\int_{|z| = 1} \frac{(1+z+1/z)^n\cos(n\theta)}{3+(z+1/z)} \frac{1}{iz} \operatorname{d}z$$
I cant seem to find a way to expand $\cos(n\theta)$ into a function of $z$.
From the above equation, I can get that the poles of is at $z = -1.5 \pm \frac{\sqrt{5}}{2}$ and only the residual of $z = -1.5 + \frac{\sqrt{5}}{2}$ should be included. 

I don't know if it will be too late for the answer. What you need is to add $i\sin(n\theta)$ to the integral. Clearly
$$ \int_{0}^{2\pi} \frac {(1+2\cos\theta)^n\sin(n\theta)}{3+2\cos\theta} \operatorname{d}\theta=0. $$
Noting for $z=e^{i\theta}$, ones
$$ 1+2\cos\theta=|1+z|^2-1=(1+z)(1+\frac1z)-1=1+z+\frac1z, $$
and
$$3+2\cos\theta=1+(1+z)(1+\frac1z) $$
and hence
\begin{eqnarray}
&&\int_{0}^{2\pi} \frac {(1+2\cos\theta)^n\cos(n\theta)}{3+2\cos\theta} \operatorname{d}\theta\\
&=&\int_{0}^{2\pi} \frac {(1+2\cos\theta)^ne^{ni\theta }}{3+2\cos\theta} \operatorname{d}\theta\\
&=&-i\int_{|z|=1} \frac {(1+z+\frac1z)^{n}z^n}{1+(1+z)(1+\frac1z)}\frac{\operatorname{d}z}{iz}\\
&=&-i\int_{|z|=1} \frac {(z^2+z+1)^{n}}{z^2+3z+1}\operatorname{d}z\\
&=&-i\int_{|z|=1} \frac {(z^2+z+1)^{n}}{(z-z_1)(z-z_2)}\operatorname{d}z\\
&=&-i\cdot 2\pi i \cdot\text{Res}(\frac {(z^2+z+1)^{n}}{z-z_2},z=z_1)\\
&=&2\pi \frac {(z_1^2+z_1+1))^{n}}{z_1-z_2}\\
&=&\frac{2\pi(3-\sqrt5)^{n}}{\sqrt5}.
\end{eqnarray}
Here $z_1,z_2$ are two of $z^2+3z+1=0$,
$$ z_1=\frac{-3+\sqrt5}{2}, z_2=\frac{-3-\sqrt5}{2}. $$
