How do I prove $\int^{\pi}_{0} \frac{\cos nx}{1+\cos\alpha \cos x} \mathrm{d}x = \frac{\pi}{\sin \alpha} (\tan \alpha - \sec \alpha)^n $? The result I wish to show is that for $n \in \mathbb{Z}$, $$\int^{\pi}_{0} \frac{\cos nx}{1+\cos\alpha \cos x} \mathrm{d}x  = \frac{\pi}{\sin \alpha} (\tan \alpha - \sec \alpha)^n $$
I have made a few attempts through the first techniques that came to my mind but I have not made any meaningful progress.

One approach is to use contour integration.
Assuming that $0 <\alpha < \pi $ and $n \in \mathbb{Z}_{\geq 0}$,
$$ \begin{align}\int_{0}^{\pi} \frac{\cos nx}{1+ \cos \alpha \cos x} \, dx &= \frac{1}{2} \, \text{Re} \int_{-\pi}^{\pi} \frac{e^{inx}}{1+\cos \alpha \cos x} \, dx \\ &= \frac{1}{2} \, \text{Re} \int_{|z|=1} \frac{z^{n}}{1+ \cos \alpha \left(\frac{z+z^{-1}}{2} \right)} \frac{dz}{iz} \tag{1}\\ &=   \frac{1}{\cos \alpha} \, \text{Re} \,  \frac{1}{i} \int_{|z|=1} \frac{z^{n}}{z^{2}+2z \sec \alpha + 1 } \\ &= \frac{2 \pi}{\cos \alpha} \, \text{Re} \,  \text{Res} \left[\frac{z^{n}}{z^{2}+2z \sec \alpha +1}, \tan \alpha - \sec \alpha \right] \\ &= \frac{2 \pi}{\cos \alpha} \,  \text{Re} \, \frac{(\tan \alpha -\sec \alpha)^{n}}{2(\tan \alpha - \sec \alpha)+ 2 \sec \alpha} \tag{2}\\ &= \frac{\pi}{\sin \alpha} \left(\tan \alpha - \sec \alpha \right)^{n}.\end{align}$$
For the case $\alpha = \frac{\pi}{2}$, the right side of the equation should be interpreted as a limit.

$(1)$ Let $z=e^{ix}$.
$(2)$ The pole at $z= -\tan \alpha - \sec \alpha$ is outside the unit circle since $0 < \alpha < \pi$.
