Skip to main content

Law of Cosines and the Legendre Polynomials

This is so cool!!!

A few days ago I extolled the virtues of the law of cosines, taught in high schools the world over, and claimed that it turned up in all kinds of problems that you run into later in physics.  I gave one example of an electrostatics problem I was working on, but I had a nagging feeling in the back of my head that there were even cooler examples I'd forgotten about.  It turns out that there is a way cooler example of the importance of the law of cosines!  The law of cosines can be used to calculate the Legendre polynomials!!!

OK, so what are the Legendre polynomials?  They turn up repeatedly in graduate physics classes.  First of all, they're used to solve electrostatics problems[4].  The most noticeable place I saw them was in quantum mechanics, where they were derived as a special case of spherical harmonics.  Spherical harmonics are used to describe the wavefunction of an electron in a hydrogen atom, and ultimately to come up with graphs of the wave functions like the one shown below from Wikipedia[1]:

Now that we've got the gratuitously pretty pictures out of the way, here's a graph of the first few Legendre polynomials, also from Wikipedia[2].

The really cool part is that although these functions have been the bane of physics grad students forever, (depending on who you ask), they can be derived using two high school math tools... the law of cosines of course, and the binomial expansion.

So, what brought all this on, and what does it have to do with the law of cosines anyway, you ask?  This week, I remembered a passing, and, at the time, seemingly obscure statement made during math methods lecture last semester:

The generator of the Legendre polynomials is

If you look at the denominator, it resembles the law of cosines from last weeks post a bit.

I wasn't intuitive enough to put it all together, but fortunately for me, George Arfkin described the relationship  between the two quite nicely in "Mathematical Methods for Physicists".  If you perform the following manipulations you arrive at an equation that exactly matches the denominator of the "generator" function above

We'll throw out the a in front for now, we can always multiply it back in later when we're done.

Then, we'll just rename a few things

And finally, using our new names we get:

The law of cosines is the generator of the Legendre polynomials!!!

OK, OK, that's great, but how do we get from the law of cosines to the actual Legendre polynomials and what is a generator anyway?  A generator used in this context is just a formula that can be expanded/manipulated to calculate a set of other mathematical expressions like the Legendre polynomials.  Here's a list of the first few Legendre polynomials so we can see where we're headed.

Starting with our generator, we re-write it a few times and then re-group it

All I've really done is rewrite one over the square root as the guts of the square root raised to the one-half power.  Then, I put it in the form using b so that it was easier to see that we're about to use the second high school math trick, the binomial expansion.

The binomial expansion is, for our purposes, just a formula that allows us to rewrite the one plus b to the negative one half formula above as a sum of terms in powers of b.  Put concisely it says:

I found an excellent reference on the binomial expansion earlier today[3].  By excellent, I mean it doesn't get into too much detail, yet gives lots of concrete examples.  Using n equal negative one half for our problem gives the first few terms of

Then, substituting back in for b gives

If you look back at the list of Legendre functions, you'll see that we have the first three.  We can get more of them just by calculating more terms of the series.

For What It's Worth, Legendre Polynomials and Graduate Education
With the +American Physical Society 2nd annual conference in education starting tomorrow, I thought I'd throw in a few thoughts on my experience with how Legendre polynomials are introduced.  I've seen them introduced in several classes in the same general way that went like this, (in contrast to Arfkin's more historically based explanation):

1.  Show how to solve a differential equation, (say the hydrogen atom for example) by splitting it into simpler differential equations by the separation of variables.
2.  Say that one of the resulting equations has a solution involving Legendre polynomials
3.  Spend a significant amount of time on Rodrigues' formula and other recurrence formulas to calculate lists of Legendre polynomials.
4.  Write down the law of cosines expression from above and offhandedly mention that it's the 'generator' of the Legendre polynomials

I may be speaking for the lower tier of graduate students, but the above method always left me with a general feeling of mystery about the Legendre polynomials.  I certainly didn't feel as though I owned them, and basically repeated the entire learning process with little retention each time I encountered them.

Here are some pointers that would have helped me to own the subject:
1.  Clarify the use of the term 'generator'.  After a few years in a physics program, most students have also heard the word generator used in an offhanded way to refer to group theory.  The meaning is different here, it simply means an expression that can be manually expanded to calculate, (generate), the Legendre polynomials.  I fell victim to this one myself on the first draft of this article.  I completely omitted the definition of what a generator is.

2.  If time allows, show how the generator comes from the law of cosines, ala Arfkin, with the following additional suggestions.

3.  From the number of students I've seen diligently working through trigonometry, I don't think I"m alone on this.  By the time we're in grad school, it's very possible we've forgotten we learned the law of cosines in high school.  Re-introduce it briefly just to get everyone feeling comfortable that they've known this since they were 16.  A simple diagram and a few words ought to do the trick.

4.  The same thing goes for the binomial expansion.  Also, keep it simple by avoiding the 'choose' notation for calculating the terms of the binomial expansion.  The notation looks cool, but when shooting for making folks feel comfortable that they've known something all along, introducing another notation, (that admittedly they should also know from high school), doesn't help.

5.  Force us to memorize the law of cosines and the binomial expansion with a quiz or with several quizzes.  The two topics come up repeatedly in all our classes.  Having them internalized is a huge help.

6.  Emphasize the fact that the Legendre polynomials can be constructed using high school math tools.



3.  binomial expansion reference

4.  deriving the Legendre polynomials to solve electrostatics problems

Picture of the Day:

From 1/30/13


Popular posts from this blog

Cool Math Tricks: Deriving the Divergence, (Del or Nabla) into New (Cylindrical) Coordinate Systems

The following is a pretty lengthy procedure, but converting the divergence, (nabla, del) operator between coordinate systems comes up pretty often. While there are tables for converting between common coordinate systems, there seem to be fewer explanations of the procedure for deriving the conversion, so here goes!

What do we actually want?

To convert the Cartesian nabla

to the nabla for another coordinate system, say… cylindrical coordinates.

What we’ll need:

1. The Cartesian Nabla:

2. A set of equations relating the Cartesian coordinates to cylindrical coordinates:

3. A set of equations relating the Cartesian basis vectors to the basis vectors of the new coordinate system:

How to do it:

Use the chain rule for differentiation to convert the derivatives with respect to the Cartesian variables to derivatives with respect to the cylindrical variables.

The chain rule can be used to convert a differential operator in terms of one variable into a series of differential operators in terms of othe…

Lab Book 2014_07_10 More NaI Characterization

Summary: Much more plunking around with the NaI detector and sources today.  A Pb shield was built to eliminate cosmic ray muons as well as potassium 40 radiation from the concreted building.  The spectra are much cleaner, but still don't have the count rates or distinctive peaks that are expected.
New to the experiment?  Scroll to the bottom to see background and get caught up.
Lab Book Threshold for the QVT is currently set at -1.49 volts.  Remember to divide this by 100 to get the actual threshold voltage. A new spectrum recording the lines of all three sources, Cs 137, Co 60, and Sr 90, was started at approximately 10:55. Took data for about an hour.
Started the Cs 137 only spectrum at about 11:55 AM

Here’s the no-source background from yesterday
In comparison, here’s the 3 source spectrum from this morning.

The three source spectrum shows peak structure not exhibited by the background alone. I forgot to take scope pictures of the Cs137 run. I do however, have the printout, and…

Unschooling Math Jams: Squaring Numbers in their own Base

Some of the most fun I have working on math with seven year-old No. 1 is discovering new things about math myself.  Last week, we discovered that square of any number in its own base is 100!  Pretty cool!  As usual we figured it out by talking rather than by writing things down, and as usual it was sheer happenstance that we figured it out at all.  Here’s how it went.

I've really been looking forward to working through multiplication ala binary numbers with seven year-old No. 1.  She kind of beat me to the punch though: in the last few weeks she's been learning her multiplication tables in base 10 on her own.  This became apparent when five year-old No. 2 decided he wanted to do some 'schoolwork' a few days back.

"I can sing that song... about the letters? all by myself now!"  2 meant the alphabet song.  His attitude towards academics is the ultimate in not retaining unnecessary facts, not even the name of the song :)

After 2 had worked his way through the so…