The Student Room Group

Integration - sin(mx)sin(nx) etc

I've been asked to integrate sin(mx)sin(nx) from 0 to 2*Pi
and show that for positive integers m and n that the answer is Pi*d, where d is 1 if m=n and 0 otherwise.

I've worked it all the way through using the cos(a+b) and cos(a-b) formulas, replacing mx with a and nx with b.

However once I've worked it all the way through I do get zero for everything other than m=n but I do not get d=1, or rather an answer of Pi for m=n. This is due to having 2*(m-n) as one of the denominators.

Really can't see where I'm going wrong.

I also have to do the same but with cos(mx)cos(nx)
Reply 1
carpmasterjong
I do get zero for everything other than m=n but I do not get d=1, or rather an answer of Pi for m=n. This is due to having 2*(m-n) as one of the denominators.

Really can't see where I'm going wrong.The fact that you have (m-n) as one of the denominators when m=n should give you cause for concern...
Reply 2
I had the same annoying trouble, until I read the last post.

Start from the very beginning with m=n (so that you have a sine squared term) and integrate.
Reply 3
Perhaps you can see where I'm going wrong I obviously know that's the area where a problem arises.

We know cos(a+b)=cos(a)cos(b) - sin(a)sin(b)
and cos(a-b) = cos(a)cos(b) + sin(a)sin(b)

So I multiplied the first equation by (-1) then added the two equations giving

cos(a-b) - cos(a+b) = 2sin(a)sin(b)

Therefore giving integral of [cos((m-n)x)/2 - cos((m+n)x)/2]

Which when integrated gives

sin((m-n)x)/2(m-n) - sin((m+n)x)/2(m+n)

With the problem (m-n) being the denominator.
Reply 4
Okay, sorry Ben.S. I was in the middle of writing my post when you posted yours so did not see it, is my method okay for m not equal to n tho? I think it is.
Reply 5
Yes; I've done this question millions of times, but always forget it.
Reply 6
carpmasterjong
Okay, sorry Ben.S. I was in the middle of writing my post when you posted yours so did not see it, is my method okay for m not equal to n tho? I think it is.
Yes it's fine. In fact, it's OK for m=n as well, as long as you realise that

cos((mn)x)dx=x\int \cos((m-n)x) \,dx = x not sin((mn)xmn\displaystyle \frac{\sin((m-n)x}{m-n}.
Reply 7
Hi all, I know that is is an old thread...

I wanted to add a comment about the use of such an integral, since I have come upon it in PDE's and the theory of a lock-in amplifier.

please correct me if I am wrong...or add you input...

Fir the integral of sin(a)sin(b), will approach zero if you integrate long enough...this is because the wvae form produced from multiplying sin(a)sin(b) is an amplitude modulated
wave.

This wave still spends almost equal time above and below the vertical axis, thus the average of 0.

We encounter this type of integral when we are being asked to find the eigen values of a system. For a lock-in amp, or a PDE, we would need to find the inner product of
sin(nm)sin(mx) which means, is there a set of orthogonal vectors and what are they ?

For this case, there is only n=m....

what do you think ?

wbg
Reply 8
I'm not sure what you're asking, to be honest.

The only thing that's categorically clear is that the integral does NOT approach zero; the average value of the integral might tend to 0, but this is not the same thing.