<s>[INST] Basic Integral question Prove that $$ \int_0^\pi \frac{dx}{\alpha - \cos(x)}\ = \frac{\pi}{\sqrt{\alpha^2 - 1}}$$ for $\alpha > 1$
 [/INST] Put $z = e^{ix}$ so that $dz = i e^{ix} dx$ and $dx = 1/z/i \,dz$. The integral becomes
$$\frac{1}{2} \int_{|z|=1} \frac{2}{2\alpha - z - 1/z} \frac{1}{iz} dz $$
Simplifying this yields
$$\frac{1}{2i} \int_{|z|=1} \frac{2}{2\alpha z - z^2 - 1} dz$$
The poles are at
$$z = \alpha \pm \sqrt{\alpha^2-1},$$
Of these, only the smaller one is inside the unit circle and the residue is
$$ \text{Res}_{z=\alpha - \sqrt{\alpha^2-1}} \frac{2}{2\alpha z - z^2 - 1} =
\frac{1}{\sqrt{\alpha^2-1}}.$$
Hence by the Cauchy Residue Theorem the integral is
$$ 2\pi i \frac{1}{2i} \frac{1}{\sqrt{\alpha^2-1}} = 
 \frac{\pi}{\sqrt{\alpha^2-1}}.$$
Here we have used the fact that
$$\text{Res}_{z=\rho_0} \frac{1}{(z-\rho_0)(z-\rho_1)} =
\lim_{z\rightarrow \rho_0} \frac{1}{z-\rho_1} = \frac{1}{\rho_0-\rho_1}.$$
</s>