Dear Uncle Colin,

I’m trying to find a definite integral: 0πsin(kx)sin(mx)dx, where m and k are positive integers and the answer needs to be simplified as far as possible. I’ve wound up with [(k+m)sin((km)π)(km)sin((k+m)π)2(km)(k+m)], but it’s been marked wrong.

-- Flat Out Unhappy: Routine Integration Evidently Right

Hello, FOURIER – and thanks for your question!

You’re almost, but not quite right – and you’ve got a lot further than an awful lot of people would have done. You have, however, missed two slightly subtle wrinkles.

For the benefit of everyone else at the back of the class, here’s how I’d tackle the problem:

First, use the formulas-you-never-use, which include cos(A)cos(B)2sin(A+B2)(AB2).

If you work it through (ignoring the factor of -2 for the moment), A turns out to be (k+m)x and B is (km)x, making sin(kx)sin(mx)12(cos((k+m)x)cos((km)x)).

The first wrinkle is: you can only integrate this as it stands as long as km – otherwise you’d be dividing by 0, which is a bit of a no-no. We’ll need to come back to that case separately later; for now, let’s assume km.

Integrating gives 12[1k+msin((k+m)x)1kmsin((km)x)]0π.

Here’s the second wrinkle: sin(nπ)=0, for all integer values of n. This integral is zero, for all positive integer choices of k and m (as long as they’re different).

If they’re the same, the thing we’re integrating is 12(cos(2kx)1), because cos(0)=1.

This integrates to 12[12ksin(2kx)x]0π. Again, the first term vanishes, leaving a final answer of π2.

Your final answer should have been I={π2, k=m0, km.

Hope that makes sense!

-- Uncle Colin