# 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.

Hint:

Use the following relation

$$\frac{\sin\alpha}{1+\cos\alpha\cos x}=1+2\sum_{k=1}^\infty \left(\frac{\sin\alpha-1}{\cos\alpha}\right)^k\cos(kx)$$

It can be obtained by writing cosine in the denominator of the integrand out in exponential form as the following

$$\frac{A^2-B^2}{A^2-2AB\cos x+B^2}=\frac{A}{A-Be^{ix}}+\frac{Be^{-ix}}{A-Be^{-ix}}$$

where we use $A^2+B^2=1$, $-2AB=\cos\alpha$, and the geometric series in form of $\frac{1}{1-y}$. Then use the following relations

$$\int_0^\pi\cos nx\cos mx\ dx=\begin{cases} 0&, & \text{if}\ \ n\ne m \\[20pt] \dfrac{\pi}{2}&, & \text{if}\ \ n=m \end{cases}$$

• Thanks @JackD'Aurizio, but somehow my answer doesn't match the OP's answer. I have checked many times but still couldn't spot it. Can you help where I made mistake in my answer? – Sophie Agnesi Jun 10 '16 at 12:23
• I think there is a sign mistake inside the series, it should be $\frac{\sin(\alpha)-1}{\cos(\alpha)}.$ Maybe you have to check the computation for $A,B.$ OFF TOPIC COMMENT You have a very interesting surname (if it is your really surname) :D en.wikipedia.org/wiki/Maria_Gaetana_Agnesi – Marco Cantarini Jun 20 '16 at 8:44
• @MarcoCantarini Only my first name is the real one. Indeed, I took the surname of my user ID from her. – Sophie Agnesi Jun 21 '16 at 2:59

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