Reduction formula for $I_{n}=\int {\cos{nx} \over \cos{x}}\rm{d}x$

The complex exponential approach described by Gerry Myerson is very nice, very natural. Here are a couple of first-year calculus approaches. The first is kind of complicated, but introduces some useful facts. The second one, given at the very end, is quick.

Instead of doing a reduction formula directly, we separate out a fact that is far more important than our integral.

Lemma: There is a polynomial $P_n(x)$ such that $$\cos(nx)=P_n(\cos x)$$ Moreover, $P_n$ contains only terms of odd degree if $n$ is odd, and only terms of even degree if $n$ is even.

Proof: The cases $n=1$ and $n=2$ are familiar. Suppose we know the result for $n$. We establish the result for $n+2$. Note that $$\cos((n+2)x)=\cos(2x)\cos(nx)-\sin(2x)\sin(nx)$$ The $\cos(2x)\cos(nx)$ part is expressible as a polynomial in $\cos x$, by the induction hypothesis.

But $\sin(nx)$ is the derivative of $(-1/n)\cos(nx)$, so it is $(-1/n)(2\sin x)P_n'(\cos x)$. Thus $$\sin(2x)\sin(nx)=(-1/n)(2\sin x\cos x)(\sin x)P_n'(\cos x)$$ and now we replace $\sin^2 x$ by $1-\cos^2 x$. As we do the induction, we can easily check that all degrees are even or all are odd as claimed. Or else we can obtain the degree information afterwards from symmetry considerations.

Now to the integral! If $n$ is odd, then $\cos(nx)=P_n(\cos x)$, where $P_n(x)$ has only terms of odd degree. Then $\frac{\cos(nx)}{\cos x}$ is a polynomial in $\cos x$, and can be integrated using the standard reduction procedure.

If $n$ is even, pretty much the same thing happens, except that $P_n(x)$ has a non-zero constant term. Divide as in the odd case. We end up with a polynomial in $\cos x$ plus a term of shape $k/(\cos x)$. The integral of $\sec x$, though mildly unpleasant, is standard.

Remark: If $n$ is odd, then $\sin(nx)$ is a polynomial in $\sin x$, with only terms of odd degree. If $n$ is even, then $\sin(nx)$ is $\cos x$ times a polynomial in $\sin x$, with all terms of odd degree.

Added: I should also give the simple reduction formula that was asked for, even at the risk people will not get interested in the polynomials.

Recall that $$\cos(a-b)+\cos(a+b)=2\cos a \cos b$$ Take $a=(n-1)x$ and $b=x$, and rearrange a bit. We get $$\cos(nx)=2\cos x\cos((n-1)x)-\cos((n-2)x)$$ Divide through by $\cos x$, and integrate. $$\int\frac{\cos(nx)}{\cos x}dx =2\int \cos((n-1)x)dx-\int\frac{\cos((n-2)x)}{\cos x}dx $$ The first integral on the right is easy to evaluate, and we get our recurrence, and after a while arrive at the case $n=0$ or $n=1$. Now working "forwards" we can even express our integral as a simple explicit sum.


$\displaystyle \cos x=(e(x)+e(-x))/2$, where $e(x)$ abbreviates $\displaystyle e^{ix}$. $$\cos (nx)=(e(nx)+e(-nx))/2$$ $$\begin{align} \frac{\cos (nx)}{\cos x} &=\dfrac{(e(nx)+e(-nx))}{(e(x)+e(-x))} \\[2ex] & =\dfrac{e((1-n)x)(e(2nx)+1)}{(e(2x)+1)} \\[1.5ex] & =e\left((1-n)x\right)\,\left(e\left((2n-2)x\right)-e\left((2n-4)x\right)+\cdots+1\right) \end{align}$$

if $n$ is odd, and now you can integrate term-by-term.