# Evaluating $\int^\pi_{-\pi} \cos^3(x) \cos(ax)~dx$

I need to evaluate $I = \int^\pi_{-\pi} \cos^3(x) \cos(ax)~dx$ where $a$ is some integer.

I get: $\dfrac{2a(a^2-7)\sin(\pi a)}{a^4 - 10a^2 + 9}$. However $\sin(\pi a)$ is $0$ for all $a$ so $I=0$. But as noted by an answer, there are answers for $a = 1,3,-1,-3$.

• If you reach that line then it means $I=0$ whenever $a$ does not satisfy $a^3-7a^2-3a+9=0$. – user85798 Mar 26 '14 at 14:00
• Can you not solve that for $I$... – JP McCarthy Mar 26 '14 at 14:00
• How come reaching what you say you reached "doesn't help finding the solution"? Of course it does! :$$I=\frac{7a^2+3a-9}{a^3}I$$ and this means $\;I=0\;$ , with $\;a\neq 0\;$ and with $\;a\;$ s.t. the right hand's coefficient isn't one, of course – DonAntonio Mar 26 '14 at 14:00
• @DonAntonio $I$ does not equal $0$ when $a=1$, for example – user85798 Mar 26 '14 at 14:02
• Although maybe OP's equation isn't correct because when $a=3$, WA gives $I=\pi/4$ – user85798 Mar 26 '14 at 14:07

It tells you everything. After you factorize, it tells you either

$$I=0$$

or

$$1+\frac{9}{a^3}-\frac{3}{a^2}-\frac{7}{a}=0$$

Which is true for $a=1$. For this case, you can perform the integration by hand.

$a=3$ is also nonzero, but your expression seems not to show that. Check your equations again.

HINT:

We can use $$\cos3x=4\cos^3x-3\cos x\implies \cos^3x=\frac{\cos3x+3\cos x}4$$

Then use Werner Formulas

Also, observe that $ax+x, ax-x$ have same parity like $3x+ax,3x-ax$

$$I=\int_{-\pi}^\pi \cos^3 x \cos(ax) dx=\frac{2a(7-a^2)\sin(a\pi)}{a^4-10a^2+9}$$ It doesn't matter that $\sin(a\pi)$ will give zero for all a, since the denominator also gives zero for some values of a! For ex: a=1, the denominator is also zero. Thus the 0/0 works in your favor and you get a result when you take the limit as $a \to 1$.

We can show this by $$I=\int_{-\pi}^\pi \cos^3 x \cos(ax) dx=\Re \bigg(\int_{-\pi}^\pi e^{iax} \cos^3x dx\bigg)=\Re \bigg(\int_{-\pi}^\pi e^{iax}(1-\sin^2 x)\cos xdx\bigg)$$ where I used $\cos x= \Re(e^{ix})$ and the identity $\cos^2 x=1-\sin^2 x$. We obtain $$I=\Re\bigg(\int_{-\pi}^\pi e^{iax}\cos x dx-\int_{-\pi}^\pi e^{iax}\sin^2 x \cos x dx\bigg).$$ These integrals are tedious but can be done using partial integration(first one) and the second one by writing everything as exponentials, we obtain $$I=\Re\bigg(\frac{2a\sin(a\pi)}{1-a^2}-\frac{1}{8}\int_{-\pi}^\pi e^{iax}\left(e^{ix}+e^{-ix}-e^{-3ix}-e^{3ix} \right)dx\bigg)=\Re\bigg(\frac{2a\sin(a\pi)}{1-a^2}-\frac{4 a \sin(a\pi)}{a^4-10a^2+9}\bigg)=\frac{2a(7-a^2)\sin(a\pi)}{a^4-10a^2+9}.$$ Thus we have shown that $${\boxed{I=\frac{2a(7-a^2)\sin(a\pi)}{a^4-10a^2+9}}}$$