1

I would just like to verify this is correct:

$$\int_{0}^{1}\sin(m \pi x)\cos(n \pi x) dx = -\frac{1}{2}\bigg[\frac{(-1)^{n+m}}{(n+m)\pi} + \frac{(-1)^{n-m}}{(n-m)\pi} -\frac{1}{(n+m)\pi} - \frac{1}{(n-m)\pi} \bigg]$$

and so the above integral is equal to zero only when $n+m$ is even.

  • Surely you can ask Wolfram Alpha for this. Be sure to tell it that $n$ and $m$ are integers. Note: when $n=m$ your expression has terms with zero denominator. – GEdgar Nov 01 '16 at 13:55
  • Ahh, I did ask. I did not specify that $m,n$ are integers though. In fact, I did not realise you could do this! Thanks for the information. –  Nov 01 '16 at 14:50

1 Answers1

1

Disclaimer: I assume that $m$ and $n$ are integers because of the usual notation and because the OP suggests studying their parity.


The integral is pretty straightforward when you start by using $$\sin a \cos b = \frac{\sin(a+b) + \sin(a-b)}2.$$

This converts it to $$\frac1{2\pi} \left( \int_0^\pi \sin((m+n)y)\,\mathrm{d}y + \int_0^\pi \sin((m-n)y)\,\mathrm{d}y \right)$$ from which the result you stated follows unless $m = \pm n$.

Edit: With some sign corrections, that is: $$\frac1{2\pi}\left( \frac{1 - (-1)^{m+n}}{m+n} + \frac{1 - (-1)^{m-n}}{m-n} \right).$$

In these cases ($m = \pm n$) the part of the formula which would divide by $m\pm n$ must be replaced by zero (because it's the result of integration of $\sin((m \mp n)y)$ in the case where that reduces to $\int 0\,\mathrm{d}y$).

This can become zero for several reasons.

  1. All of the terms are trivially zero: this happens when $m = n = 0$.

  2. Two of the terms are trivially zero and the other two cancel each other out: Let $m = \pm n$, the other terms are of the form: $$\frac1{2\pi} \frac{1 - (-1)^{m\mp n}}{m \mp n}.$$ This can only be zero if $m \mp n$ is even, which is equivalent to $m+n$ being even, as you found. A generalization of such condition covers the case (1) as well.

  3. None of the terms are trivially zero but they still cancel each out: This is a possibility you left out. It can happen than $$\frac{1-(-1)^{m+n}}{m+n} = -\frac{1-(-1)^{m-n}}{m-n}$$ for $m \not\equiv n \pmod 2$ if $m+n = -(m-n)$. That means, if $m = 0$. Indeed, in this case the sine term in the integral is constantly zero so the cosine can be anything.

So the overall result is zero if $m \equiv n \pmod 2$ (read: $m+n$ is even) or $m = 0$. The latter was missing from your analysis.

The Vee
  • 3,071