Saturday, October 06, 2007

Yes or no?

Today I slowly coaxed myself into sorting my folder out. I am ashamed to admit that that is all I have done today. I haven't even finished sorting it out yet because I got side tracked. My notes for Vector Calculus have become rougher and rougher, and in them a lot of the results have been left for us to prove and confirm. That is why I decided to copy one page of the lecture notes in neat, and attempt to get the result that the lecturer gave us. I have been semi-succesful, and just need to check one during the example class.

Whilst I was in the mood for integration, I decided to do the example sheet for the class on Monday. The question is as follows:

\displaystyle \int^{2\pi}_{0} \sin (mx) \sin (nx) dx

where m, n \in \mathbb{Z} .

One way to do this is by parts, but that is long winded and it is easy to make mistakes. I managed to succesfully do it by parts, but having just completed question one, 'a trick' was fresh in my mind. Hence why I am now attempting the above question in a different way, using 'the trick'. That is by using complex exponentials and then 'playing around' and extracting the imaginary part.

We begin by re-writing the integral as: \int e^{i(mx)}e^{i(nx)} dx = \int e^{ix(m+n)} dx . (I have dropped the limits of the integral for the time being).

Having only started complex analysis (and not having defined integration yet!) I am tentatively attempting this question. (Google hasn't been much of a help). Your job is to tell me whether what I have written is ridiculous or not! Not that difficult a job I hope.

We begin by letting \displaystyle u=x(m+n)\text{ so } \frac{du}{dx} = m+n. \text{ Thus } dx= \frac{du}{m+n} .

This gives:

  \begin{array}{cccc} \displaystyle \int e^{ix(m+n)} dx & = & \displaystyle \frac{1}{(m+n)} \int e^{iu} du \\*[3ex] &=& \displaystyle \frac{e^{iu}}{(m+n)i}  \\*[3ex] &=&  \displaystyle  -\frac{ie^{iu}}{(m+n)}  & \text{ using } 1/i= -i \\*[3ex] &=& \displaystyle -\frac{i(\cos u + i\sin u)}{(m+n)} \\*[3ex] &=& \displaystyle -i\frac{\cos u}{(m+n)} - \frac{ \sin u}{(m+n)} \end{array}

EDIT: (It's meant to be plus the real part).
The imaginary part is required, which is: \displaystyle \frac{\cos u}{(m+n)}. .

Hence, if we now insert the limits we get the required answer:

\displaystyle \left[ \frac{\cos (m+n)x}{(m+n)} \right]^{2\pi}_{0}=0. .

How does that look? It seems a bit 'dodgy' to me; well the actual integration with the i involved does. Having LaTeXed this, I can't decide which method is worse than which! (I really like my work spread out, as you may have noticed.)

These integrals define my day. I was rather pleased when I managed to dig out question one though, since it was slightly tricky. The lecturer had given us a hint (humbug), which I had forgotten. I was going to sheepishly email him to ask him what he told us, but after I had written out the first few sums of the series, something clicked. You can try the question if you want:

Let S(x) =\displaystyle \sum_{n=1}^{\infty} a^n \sin(nx) , ( mod a is less than 1). Show that \displaystyle S(x) = \frac{a \sin x}{1 - 2a \cos x +a^2}.

Back to the folder now. What joy.

8 comments:

steve said...

sin(mx)sin(nx)=1/2(cos(m-n)x - cos(m+n)x) is then easy to integrate.
We used to have to learn by heart such formulae at school for A level, but that doesn't happen these days!

However, using the exponential form is nicer and saves learning trig formulae.

beans said...

Hi Steve,

I know the identity for sin(a+b)=sin(a)cos(a) + sin(b)cos(a) and cos(a+b)= cos(a)cos(b)-sin(a)sin(b), but can't recall coming across the one that you have written. We were never taught that one - and yeah, they all tend to be in the formula booklet! \sout{How do you derive it?}

I have just played around with the identities and obtained what you wrote, and will be sure to keep it in mind for the future! (I only remember the above two, and derive whichever one is neccesary.)

I can't believe that I initially did it by integration by parts! Thanks for that, and I think that both your way and the exponential form are nice.(Well anything is nicer compared to 'by parts'!)

steve said...

How do you derive it?

If you mean sin(a+b)=sin(a)cos(a) + sin(b)cos(a) and cos(a+b)= cos(a)cos(b)-sin(a)sin(b) then there's a really nice way to prove them by taking the real & imaginary parts of each side of e^{a+b}=e^a.e^b

beans said...

I meant the formula you posted, but I might as well try proving sin(a+b)=... and cos(a+b)=... .

Using complex exponentials does tend to simplify quite a lot of things. I remember using them to solve ODEs too (but that took a while to register, since I always had 1/i and didn't know what to do next!)

Bob the Bolder said...

Beans - forget complex exponentials. Too complex.

The best way is from cos(A-B)=cosAcosB+sinAsinB
where you remember the sign because if A=B it gives cos-squared plus sin-squared equals one.

Then of course
cos(A+B)=cosAcosB-sinAsinB
because sin(-B)=-sinB.

Now subtract to get
sinAsinB=(cos(A-B)-cos(A+B)/2)
and put A=mx, B=nx.

For Fourier Series you'll need to integrate cos(mx)cos(nx) too - can you get that from above?

And likewise sin(nx)cos(mx) - get that from the sin(A+B) plus sin(A-B) formulas.

Don't thank me. Just be nice to your teachers, OK?

beans said...

Hi Bob the Bolder,

It was done the way you and Steve have commented, in todays example class. (I don't think he meant for me to do it using complex exponentials!)

Yes, the cos(mx)cos(nx) and sin(nx)cos(mx) integrals were on the example sheet too. (Something to do with orthogonality).

And I would like to think that I am nice to my teachers... [Have I written anything which suggests otherwise? If so, I don't mean to be 'nasty' to any of my teachers- I find them cool!] Well I do like to have a joke or two with a few lecturers, but it is all in good nature (I hope). ;)

(Nice name BTW!)

Bob the Bolder said...

Beans my man, yes I mean keep on being nice - or even nicer! ;)

And yes again, it's all to do with orthogonality, as for ordinary geometrical vectors. But here the sin(mx) and cos(nx) are mutually orthogonal basis vectors for an infinite-dimensional linear space where functions are the vectors and the inner product (or dot product) is an integral.

beans said...

Oh, in that case I will try to be! :o (I think the word annoying can be added to your sentence too, unintentionally of course!)

I guess this flu has completely disorientated me - I had a really bad 'Real Analysis' day today too. I said so many stupid wrong things, when I knew the answer, but couldn't muster it out. I guess it is going to one of them weeks.

Having read your paragraph slowly, (and without having a panic), it sort of made sense. These fourier series are potentially annoying though!