My solution for Midterm#1 Problem #4

The Problem: Associated Legendre polynomials using Mathematica.

This problem calls for using Mathematica and the Rodriquez formula to calculate Legendre polynomials and and the spherical harmonics for Y32, Y44, Y43, Y42, Y41, Y40. Why not?

The Solution: Mathematica.

First, allow me to attempt to explain what Legendre polynomials are. When dealing with differential equations, the last thing you what to do is actually solve them. Instead, you guess what the answer might be, or even better, you find a mathematician who has already guessed the solutions. Laplace's equation (which is used frequently in E&M), is a good example. The solutions of Laplace's equation, when one deals with cartesian coordinates, are Legendre polynomials. In spherical coordinates the solutions are associated Legendre polynomials, called Spherical Harmonics. In cylindrical coordinates the associated Legendre polynomials are known as Bessel functions.

Rodrigues equation is an equation which allows one to determine the Spherical Harmonics and Legendre polynomials.

Rodrigues' Formula is (Jackson, Eqn 3.50):

P(lm)=((-1)^m/(2^l)l!)*((1-x^2)^(m/2))*((d/dx)^(l+m))(x^2-1)^l

The equation to determine the Spherical Harmonic value is (Jackson, Eqn 3.53):

Y(lm)={SQRT[((2l+1)/(4*pi))*((l-m)!/(l+m)!)]}*P(lm)(cos theta)e^(i*m*theta)

I used Mathematica to was to determine the values. Mathematica's syntax is rather fussy. For Rodrigues Formula I used:

P(lm)=(((-1)^m)/((2^l)*(Factorial[l])))*((1-x^2)^(m/2))*(D[(x^2-1)^l,{x,(l+m)}])

And for Eqn 3.50 I used:

Sqrt[((2l+1)/(4*pi))*(Factorial[l-m]/Factorial[l+m])]

For Y(32) I got:

Y(32) = (15/4)*(7/(30*pi))^(1/2)*Cos(theta)*Sin(theta)*EXP(i*2*theta)

In argreement with what Jackson claims on page 100.

Continueing along this way (and it should be said that this is by no means a quick method), I got the following values for l = 4, m = 4,3,2,1,0:

The Table: Spherical Harmonics for l = 4.

l = 4
 		 3        1    105          2 2
m = 4   Y(44) = --- Sqrt(--) * ---- * x (1-x )  * EXP(i*4*theta)
		 2       pi     pi

		 3	  1      105	      2 3/2
m = 3   Y(43) = --- Sqrt(----) * ---- * x (1-x )     *EXP(i*3*theta)
		 4       5*pi    pi

		 1	   1	    1	       2          2            2
m = 2	Y(42) = --- Sqrt(-----) * ------ * (1-x ) [17280 x  + 2880(-1+x )] *EXP(i*2*theta)
		 4       10*pi	  384*pi

    		 3         1        1	       2 1/2         3               2
m = 1	Y(41) = --- Sqrt(-----) * ------ * (1-x )     [3840 x  + 2880 x (-1+x )] * EXP(i*theta)
		 4	  5*pi    384*pi


    		 3         1        1	       2        4         2     2            2 2
m = 0	Y(40) = --- Sqrt(-----) * ------ * (1-x ) [384 x  + 1152 x (-1+x ) + 144(-1+x ) ]
		 2	   pi     384*pi


Here, x = cos(theta), and I have taken the liberty of tacking on the exponential part, which I did not have Mathematica compute.

The Conclusion: A better mousetrap?

We have seen that Mathematica is quite capable of generating Spherical Harmonics, as we suspected.

BACK