Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having trouble with this problem:

Consider the integral: $$\tag 1\int_0^{2\pi}\cos(mx)\cos(nx)dx$$

a. Write $\cos(mx)$ and $\cos(nx)$ in terms of complex exponentials and compute $\cos(mx)\cos(nx)$

b. Show that, for integer $L$: $$\int \exp(iLx)dx = \begin{cases} 2\pi, & \text{ if } L=0 \\ 0, & \text{otherwise}, \end{cases}$$ (where i is a complex number)

c. Compute the integral in $(1)$ by using the above.

share|cite|improve this question
That's a pretty good program you have here. Have you tried to apply it? – 1015 Feb 19 '13 at 3:02
"where $i$ is a complex number" -- I'm sure that in this context $i$ is a square root of $-1$, not just any complex number. – Jonas Meyer Feb 19 '13 at 3:10
@julian: why should Leslie try, if people here will solve it for him/her, within 10 minutes? – GEdgar Feb 19 '13 at 3:26

Using complex exponentials, or more elementarily the cosine addition laws $\cos(A+B)=\cos A\cos B-\sin A\sin B$ and its twin $\cos(A-B)=\cos A\cos B+\sin A\sin B$, we find that $$\cos(mx)\cos(nx)=\frac{1}{2}\left(\cos((m+n)x)+\cos((m-n)x)\right).$$ Integrate. Be careful about the case $m=n$.

share|cite|improve this answer
and also about $m+n=0?$ – lab bhattacharjee Feb 19 '13 at 4:40
That too, if we are interested in negative integers. In the trigonometric series context, which this question usually belongs to, the integers are non-negative. – André Nicolas Feb 19 '13 at 4:44


$$\cos kx=\frac{e^{ikx}+e^{-ikx}}{2}\Longrightarrow \cos mx\cos nx=\frac{1}{4}\left(e^{i(m+n)x}+e^{-i(m+n)x}+e^{i(m-n)x}+e^{-i(m-n)x}\right)$$

share|cite|improve this answer

Recall that

$$\cos x = \frac{e^{ix}+e^{-ix}}{2}$$

Then expand

$$\cos (mx)\cos (nx) = \left(\frac{e^{imx}+e^{-imx}}{2}\right) \left(\frac{e^{inx}+e^{-inx}}{2}\right)$$

so it becomes a sum of complex exponentials.

For the second part, merely find the antiderivative of $\exp(i L x), \, \forall L \neq 0$ and then find that the definite integral over $[0, 2\pi]$. Then do the same for when $L = 0$.

Combine the two above results to conclude what the integral of the cosines is.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.