Evaluate $\int_{0}^{2\pi} \frac{d\theta}{1+\sin(\theta)\cos(\alpha)}$, ($\alpha = $ const.) by contour integration I'm having trouble with this one. Letting $z = e^{i\theta}$ lets me rearrange the equation to $$\int_{0}^{2\pi} \frac{2dz}{2iz+(z^2-1)\cos(\alpha)}$$ where the roots are  $$z= \frac{-i\pm i|\sin(\alpha)|}{\cos(\alpha)}$$
However when finding the residue from here I get an extra factor of $\cos(\alpha)$ where there shouldn't be one. Any help is appreciated!
 A: It is more practical to perform a preliminary manipulation to simplify the integrand function. Since $\sin(\pi+\theta)=-\sin(\theta)$,  $\sin(\theta)=\sin(\pi-\theta)$, $\sin(\pi/2-\theta)=\cos(\theta)$ and $\cos^2(\arctan t)=\frac{1}{1+t^2}$,
$$\begin{eqnarray*} I(\alpha)&=&\int_{0}^{2\pi}\frac{d\theta}{1+\sin(\theta)\cos(\alpha)}\\ &=& 2\int_{0}^{\pi/2}\frac{d\theta}{1-\sin^2(\theta)\cos^2(\alpha)}\\ &=& 4\int_{0}^{\pi/2}\frac{d\theta}{1-\sin^2(\theta)\cos^2(\alpha)}\\ &=& 4\int_{0}^{\pi/2}\frac{d\theta}{1-\cos^2(\theta)\cos^2(\alpha)}\\(\theta=\arctan t)\quad&=&4\int_{0}^{+\infty}\frac{dt}{1+t^2-\cos^2(\alpha)}\\&=&4\int_{0}^{+\infty}\frac{dt}{\sin^2(\alpha)+t^2}\\(t=|\sin(\alpha)|u)\quad&=&\frac{4}{|\sin(\alpha)|}\int_{0}^{+\infty}\frac{du}{1+u^2}=\color{red}{\frac{2\pi}{|\sin(\alpha)|}}. \end{eqnarray*}$$
Obviously we need to assume $\alpha\not\in\pi\mathbb{Z}$.
A: Using contour integration ... 
\begin{eqnarray*}
\oint \frac{2dz}{2iz+(z^2-1)\cos(\alpha)}
\end{eqnarray*}
where the contour of the integral is the unit circle (as stated in the question ?). Rearrange to
\begin{eqnarray*}
\frac{2}{\cos(\alpha)} \oint \frac{dz}{\left( z+i\frac{1+\mid\sin(\alpha)\mid}{\cos(\alpha)} \right)\left( z+i\frac{1-\mid\sin(\alpha)\mid}{\cos(\alpha)} \right)}
\end{eqnarray*}
Now Doug M is right one of these poles is inside the unit circle & the other is outside. Either way they both give the same residue ...
\begin{eqnarray*}
\frac{\cos(\alpha)}{2i \mid \sin(\alpha) \mid}
\end{eqnarray*}
Now $2 \pi i $ times the sum of the residues (Cauchy's Integral Theorem) and we have
\begin{eqnarray*}
\int_{0}^{2\pi} \frac{d\theta}{1 + \sin\theta \cos\alpha}=\frac{2 \pi}{\mid \sin \alpha \mid}.
\end{eqnarray*}
