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!

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}$.
