# Different solutions to $\int^\pi_{-\pi} \cos^3(x) \cos(ax)~dx$ [duplicate]

Linked to my previous question, when solving the following integral ($a$ is an integer) I get:

$$\int^\pi_{-\pi} \cos^3(x) \cos(ax)~dx = \frac{2a(a^2-7)\sin(\pi a)}{a^4 - 10a^2 + 9}$$

However, trivially, $\sin(\pi a) = 0$ for all integer values of $a$. Therefore the integral is always equal to $0$. Wolfram Alpha agrees with this solution.

However, let us substitute $a=1$ and $a=3$ into the integral and then solve:

$$\int^\pi_{-\pi} \cos^3(x) \cos(x)~dx = \frac{3\pi}{4}$$ and $$\int^\pi_{-\pi} \cos^3(x) \cos(3x)~dx = \frac{\pi}{4}$$

• So the exercise is: What's $\sin(\pi a)/(a^4 - 10a^2+9)$ when $a=1$ or $a=3$? I think L'Hopital's rule will do it. – Michael Hardy Mar 26 '14 at 16:38
You have a removable singularity at $a=1$. Same for $a=3$. That is, you have $0/0$. Look at the denominator.