Updated: July 4, 2003

Associated Legendre Functions:

   To begin, it is important to note that there are two popular sign conventions for the associated Legendre functions. This results in additional factors of -1 when m is odd. Notably, our convention differs by a factor of (-1)m from that used in ciks.cbt.nist.gov, but we are in agreement with wolfram.mathworld.com, and Abramowitz and Stegun 1972. In particular:

ConventionSupported by: 
P11(x) = -sqrt(1-x2) This webpage
Abramowitz & Stegun 1972 (?) eq. 8.6.6
Gradshteyn & Rhyzhik (8.752.1)
Mathematica's LegendreP[l,m,z] function
wolfram.mathworld.com
Includes Condon-
Shortley phase
P1 1(x) = sqrt(1-x2) ciks.cbt.nist.gov
Schaum's outline of mathematical functions
Condon-Shortley
phase omitted

   The definition we use ( when m > 0 ) for the associated Legendre functions is:

Plm(x) = (-1)m (1-x2)m/2  dm
----
dxm
Pl(x)
[1]
The factor of (-1)m may appear arbitrary and unnecessary. The purpose for its inclusion is related to the use of Legendre functions in quantum mechanics.
   A commonly seen definition is:

Plm(x) = (1-x2)m/2  dm
----
dxm
Pl(x)
[2]
   To distinguish the two cases, Abramowitz and Stegun, "Handbook of Mathematical Functions..." 1972, page 332, define:
Plm = (-1)m Plm
[3]
which, unfortunately, is not standard notation among references that I found.
   In either case, negative m functions are defined by:

Pl-m(x) = (-1)m (l-m)!
-------
(l+m)!
Plm(x)
[4]
Equation (42) in http://wolfram.mathworld.com/LegendrePolynomial.html
Equation (30) in http://ciks.cbt.nist.gov/~garbocz/paper134/node10.html
Pll(x) = (-1)l (2l-1)!
-------------
2l-1(l-1)!
(1-x2)l/2
[5]
Pl-l(x) =   1
------
2 l l!
(1-x2)l/2
[6]
These relationships [5] and [6] were verified by varpr24b.cpp.

 d
---
Pll(cos(θ)) = (-1)l (2l-1)!
--------------
2l-1(l-1)!
l (sin(θ))l-1 cos(θ)
[7]
 d
---
Pl-l(x) =    1
-----
2l l!
l (sin(θ))l-1 cos(θ)
[8]


double PLm(int L,int m,double x)
{ // PLm associated Legendre function
// Reference: http://ciks.cbt.nist.gov/~garbocz/paper134/node10.html
// "Appendix A: List of associated Legendre functions"
// Note that their sign convention differs from that of Wolfram.
double PLm1=-1234.5,s,x2,x3,x4,x5,x6,x7,x8,s2,s3,s4,s5,s6,s7,s8;
int am,floorhalfL,ik,ik2; double d3;
x2=x*x;
s = (-1.0)*sqrt(1-x2); // The factor of -1.0 has the effect of adding the Condon-Shortley phas s2=s*s;
am=abs(m);
if (am>L) {cout<<"* Error: PLm |m|>L *";exit(0);}
if (L>=9)
{ // L >= 9

floorhalfL = L/2; // intentional integer division
for (ik=0;ik<=L;ik++) plmc[ik]=0;
for (ik=0;ik<=floorhalfL;ik++)
{ // ik
if ((ik%2)==1)
plmc[L-2*ik] = -1;
else
plmc[L-2*ik] = 1;
plmc[L-2*ik]*= factlut[2*L-2*ik];
plmc[L-2*ik]/= factlut[L-ik];
plmc[L-2*ik]/= factlut[ik];
plmc[L-2*ik]/= factlut[L-2*ik];
} // ik
d3=pow7(2.0,L,3);
for (ik=0;ik<=L;ik++) plmc[ik]/=d3;

// Take derivative am times:
for (ik=0;ik { // ik
plmc[0]=0;
int minik2;
minik2=((am-ik-1)/2)*2;
if (minik2<0) minik2=0;
minik2=minik2+(1+L-ik)%2;
for (ik2=minik2;ik2 { // ik2
plmc[ik2]=plmc[ik2+1]*(ik2+1);
plmc[ik2+1]=0;
} // ik2
plmc[L-ik]=0;
} // ik

// Evaluate polynomial:
PLm1 = plmc[L-am];
for (ik=L-am;ik>=2;ik=ik-2)
{ //,,
PLm1 = x2*PLm1 + plmc[ik-2];
} //,,
if (((L-am)%2)==1) PLm1=PLm1*x;

// Multiply by prefactor:
if (am>0) PLm1 = PLm1 * pow7(s,am,6);

} // L >= 9
else
{ // L < 9
if (L>=3)
{ // >=3
x3=x2*x; s3=s2*s;
x4=x3*x; s4=s3*s;
if (L>=5)
{ // >=5
x5=x4*x; s5=s4*s;
x6=x5*x; s6=s5*s;
if (L>=7)
{ // >=7
x7=x6*x; s7=s6*s;
x8=x7*x; s8=s7*s;
if (L>=9)
{ // >=9
cout<<"* Error L>=9 here 5324 * ";exit(0);
} // >=9
} // >=7
} // >=5
} // >=3
// Note: unlike us, in ciks.cbt.nist.gov webpage, s = sqrt(1-x*x). They omit C-S phase

if (L==0) PLm1=1;
else if (L==1)
{ // L=1
if (am==0) PLm1=x;
else if (am==1) PLm1=s;
} // L=1
else if (L==2)
{ // L=2
if (am==0) PLm1=0.5*(3*x2-1.0);
else if (am==1) PLm1=3.0*x*s;
else if (am==2) PLm1=3.0*s2;
} // L=2
else if (L==3)
{ // L=3
if (am==0) PLm1=(1.0/2.0)*(5*x3-3.0*x);
else if (am==1) PLm1=(3.0/2.0)*(5.0*x2-1.0)*s;
else if (am==2) PLm1=15.0*x*s2;
else if (am==3) PLm1=15.0*s3;
} // L=3
else if (L==4)
{ // L=4
if (am==0) PLm1=(1.0/8.)*(35*x4-30*x2+3.0);
else if (am==1) PLm1=2.5*(7*x3-3.0*x)*s;
else if (am==2) PLm1=7.5*(7*x2-1)*s2;
else if (am==3) PLm1=105.0*x*s3;
else if (am==4) PLm1=105.0*s4;
} // L=4
else if (L==5)
{ // L= 5
if (am==0) PLm1=(1.0/8.0)*(63*x5-70*x3+15*x);
else if (am==1) PLm1=(15.0/8.0)*(21*x4-14*x2+1)*s;
else if (am==2) PLm1=(105.0/2.0)*(3*x3-x)*s2;
else if (am==3) PLm1=(105.0/2.0)*(9*x2-1)*s3;
else if (am==4) PLm1=945.0*x*s4;
else if (am==5) PLm1=945.0*s5;
} // L= 5
else if (L==6)
{ // L= 6
if (am==0) PLm1=(1.0/16.0)*(231*x6-315*x4+105*x2-5);
else if (am==1) PLm1=(21.0/8.0)*(33*x5-30*x3+5*x)*s;
else if (am==2) PLm1=(105.0/8.0)*(33*x4-18*x2+1)*s2;
else if (am==3) PLm1=(315.0/2.0)*(11*x3-3*x)*s3;
else if (am==4) PLm1=(945.0/2.0)*(11*x2-1.0)*s4;
else if (am==5) PLm1=10395.0*x*s5;
else if (am==6) PLm1=10395.0*s6;
} // L= 6
else if (L==7)
{ // L= 7
if (am==0) PLm1=(1.0/16.0)*(429*x7-693*x5+315*x3-35*x);
else if (am==1) PLm1=(7.0/16.0)*(429*x6-495*x4+135*x2-5)*s;
else if (am==2) PLm1=(63.0/8.0)*(143*x5-110*x3+15*x)*s2;
else if (am==3) PLm1=(315.0/8.0)*(143*x4-66*x2+3)*s3;
else if (am==4) PLm1=(3465.0/2.0)*(13*x3-3*x)*s4;
else if (am==5) PLm1=(10395.0/2.0)*(13*x2-1)*s5;
else if (am==6) PLm1=135135.0*x*s6;
else if (am==7) PLm1=135135.0*s7;
} // L= 7
else if (L==8)
{ // L= 8
if (am==0) PLm1=(1.0/128.0)*(6435*x8-12012*x6+6930*x4-1260*x2+35);
else if (am==1) PLm1=(9.0/16.0)*x*(715*x6-1001*x4+385*x2-35)*s;
else if (am==2) PLm1=(315.0/16.0)*(143*x6-143*x4+33*x2-1)*s2;
else if (am==3) PLm1=(3465.0/8.0)*x*(39*x4-26*x2+3)*s3;
else if (am==4) PLm1=(10395.0/8.0)*(65*x4-26*x2+1)*s4;
else if (am==5) PLm1=(135135.0/2.0)*(5*x3-x)*s5;
else if (am==6) PLm1=(135135.0/2.0)*(15*x2-1)*s6;
else if (am==7) PLm1=2027025.0*x*s7;
else if (am==8) PLm1=2027025.0*s8;
} // L= 8
} // L < 9

if (m<0)
{ // m<0
PLm1 = PLm1*factlut[L-am]/factlut[L+am];
if ((am%2)==1) PLm1*=-1;
} // m<0
// [ Strangely, PLm for plus m and minus m are not the same! ]
// P L ^-m (x) = (-1)^m (L-m)!/(L+m)! P L ^m (x)
// eq. (42) on http://mathworld.wolfram.com/LegendrePolynomial.html
// Also eq (30) in http://ciks.cbt.nist.gov/~garbocz/paper134/node10.html
// I am assuming that zero factorial is 1 in this.
return PLm1;
} // PLm associated Legendre function

Other references:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/legendre.shtml

Page 332 of Abramowitz and Stegun:
www.convertit.com

Nice way to do real spherical harmonics:
http://jilawww.colorado.edu/www/sro/thesis/redfield/appA.pdf

Condon-Shortley phase original reference:
Condon, E. U., and Shortley, G. H., The Theory of Atomic Spectra (Cambridge Univ. Press, Cambridge, England, 1951).

http://forums.wolfram.com/mathgroup/archive/2000/Oct/msg00276.html
> In Mathematica, the associated Legendre polynomial is defined as
>
> P(n,m,x) = (-1)^m (1-x^2)^(m/2) d^m/dx^m (P(n,x))
>
> while in Schaum's Outlines 'Mathematical Handbook of Formulas and
> tables' it is defined as
>
> P(n,m,x) = (1-x^2)^(m/2) d^m/dx^m (P(n,x))
>
>What is true (or doesn't it matter)?
In a matter of speaking, both are correct. You are seeing two types of notation: Mathematica is following the one favored by atomic spectra and electrodynamics textbooks (see chapter 3 of J. D. Jackson's Classical Electrodynamics, 2nd edition, 1975). Your Schaum's Outline follows the one used in Arfken's Mathematical Methods for Physicists (3rd edition, 1985). The factor (-1)^m is a phase factor, usually referred to as the Condon-Shortley phase. Its effect is to introduce an alternation of sign among the positive m spherical harmonics (Arfken; p. 682). It seems that the publishers of the Schaum's Outline share Arfken's idea that "This (-1)^m seems an unnecessary complication... It will be included in the definition of the spherical harmonics." (see footnote on page 668).
As long as it is present in either the Plm or the Ylm expression (but not in both), the expressions will be OK.
Mayra Martinez

http://itl.chem.ufl.edu/4412_u97/angular_mom/node7.html
[ has more explicit formulas ]

http://www.du.edu/~jcalvert/math/harmonic/harmonic.htm
[ Has an illustration of sectoral, zonal and tesseral harmonics ]

Daniel Murray
Associate Professor
Math, Stats & Physics Unit
University of British Columbia - Okanagan
Kelowna, BC, Canada
daniel "dot" murray "at" ubc "dot" ca

For a list of related articles click on the link.


Hosted by www.Geocities.ws

1