# How to solve $\int_0^\pi{\frac{\cos{nx}}{5 + 4\cos{x}}}dx$?

How can I solve the following integral? $$\int_0^\pi{\frac{\cos{nx}}{5 + 4\cos{x}}}dx, n \in \mathbb{N}$$

-
Use the formula $$\cos{nx}=2\cos{x}\cos{(n-1)x}-\cos{(n-2)x}$$. By singing $I_n=\int_0^\pi{\frac{\cos{nx}}{5 + 4\cos{x}}}dx$ try to find recursive formula for $I_n$. –  Salech Alhasov Mar 28 '12 at 10:11

Here is a solution without residue calculus:

Via partial fractions and geometric series one arrives at \eqalign{{1\over 5+4\cos x}&={1\over(2+e^{ix})(2+e^{-ix})}=\ldots\cr &={1\over 3}-{1\over3}{e^{ix}/2\over 1+e^{ix}/2}-{1\over3}{e^{-ix}/2\over 1+e^{-ix}/2}\cr &= {1\over3}+{1\over3}\sum_{k=1}^\infty(-1)^k{e^{ikx}\over 2^k} +{1\over3}\sum_{k=1}^\infty(-1)^k{e^{-ikx}\over 2^k}\cr &={1\over3}+{2\over3}\sum_{k=1}^\infty(-1)^k{\cos(k x)\over 2^k}\ .\cr} Therefore $$\int_0^\pi{\cos(n x)\over 5+4\cos x}\ dx={2(-1)^k\over3\cdot 2^n}{1\over2}\int_{-\pi}^\pi \cos^2(nx) dx={(-1)^n\over 3\cdot 2^n}\pi\qquad(n\geq0)\ .$$

-
A nice answer using the orthogonality of $\{\cos(nx)\}$ –  robjohn Mar 29 '12 at 7:34

Of course it can be solved easily with complex residues. Since $\cos x$ is even you replace it with 1/2 the integral from $0$ to $2 \pi$. Then you make the substitution $z=e^{i\theta}$. You end-up with an integral over the unit circle. You end-up with a function which has singularities only at $0$ and $-\frac{1}{2}$. Then find the residues.

-
Could you please elaborate a little on this solution? –  Paul Manta Mar 28 '12 at 11:59

To elaborate on Pantelis Damianou's answer \newcommand{\cis}{\operatorname{cis}} \begin{align} \int_0^\pi\frac{\cos(nx)}{5+4\cos(x)}\mathrm{d}x &=\frac12\int_{-\pi}^\pi\frac{\cos(nx)}{5+4\cos(x)}\mathrm{d}x\\ &=\frac12\int_{-\pi}^\pi\frac{\cis(nx)}{5+2(\cis(x)+\cis(-x))}\mathrm{d}x\\ &=\frac12\int_{-\pi}^\pi\frac{\cis(x)\cis(nx)}{2\cis^2(x)+5\cis(x)+2}\mathrm{d}x\\ &=\frac{1}{2i}\int_{-\pi}^\pi\frac{\cis(nx)}{2\cis^2(x)+5\cis(x)+2}\mathrm{d}\cis(x)\\ &=\frac{1}{2i}\oint\frac{z^n}{2z^2+5z+2}\mathrm{d}z \end{align} where the integral is counterclockwise around the unit circle and $\cis(x)=e^{ix}$.

Factor $2z^2+5z+2$ and use partial fractions. However, I only get a singularity at $z=-\frac12$ (and one at $z=-2$, but that is outside the unit circle, so of no consequence).

Now that a complete solution has been posted, I will finish this using residues: \begin{align} \frac{1}{2i}\oint\frac{z^n}{2z^2+5z+2}\mathrm{d}z &=\frac{1}{6i}\oint\left(\frac{2}{2z+1}-\frac{1}{z+2}\right)\,z^n\,\mathrm{d}z\\ &=\frac{1}{6i}\oint\frac{z^n}{z+1/2}\mathrm{d}z\\ &=\frac{\pi}{3}\left(-\frac12\right)^n \end{align}

-
Didn't you forget to write $\cos(nx)$ in the same way as in the denominator? Then you get singularity at 0. –  xen Mar 28 '12 at 14:03
@xcn: since $5+4\cos(x)$ is even, adding $i\sin(nx)$ to the numerator adds $0$ to the whole integral. That is, $$\frac12\int_{-\pi}^\pi\frac{\cos(nx)}{5+4\cos(x)}\mathrm{d}x=\frac12\int_{-\pi}^‌​\pi\frac{\cos(nx)+i\sin(nx)}{5+4\cos(x)}\mathrm{d}x$$ –  robjohn Mar 28 '12 at 14:25

Evaluating some $n$ ($n=5$), points at something like $\displaystyle \frac{(-1)^n \pi}{6\cdot 2^{n-1}}$...(tbc)

-
Good guess! :-) –  robjohn Mar 28 '12 at 13:32