made with Mathematica technology MathWorld

Legendre Polynomial
DOWNLOAD Mathematica Notebook
LegendreP

The Legendre polynomials, sometimes called Legendre functions of the first kind, Legendre coefficients, or zonal harmonics (Whittaker and Watson 1990, p. 302), are solutions to the Legendre differential equation. If l is an integer, they are polynomials. The Legendre polynomials P_n(x) are illustrated above for x in [-1,1] and n=1, 2, ..., 5. They are implemented in Mathematica as LegendreP[n, x].

The Legendre polynomial P_n(z) can be defined by the contour integral

 P_n(z)=1/(2pii)∮(1-2tz+t^2)^(-1/2)t^(-n-1)dt,
(1)

where the contour encloses the origin and is traversed in a counterclockwise direction (Arfken 1985, p. 416).

The first few Legendre polynomials are

P_0(x)=1
(2)
P_1(x)=x
(3)
P_2(x)=1/2(3x^2-1)
(4)
P_3(x)=1/2(5x^3-3x)
(5)
P_4(x)=1/8(35x^4-30x^2+3)
(6)
P_5(x)=1/8(63x^5-70x^3+15x)
(7)
P_6(x)=1/(16)(231x^6-315x^4+105x^2-5).
(8)

When ordered from smallest to largest powers and with the denominators factored out, the triangle of nonzero coefficients is 1, 1, -1, 3, -3, 5, 3, -30, ... (Sloane's A008316). The leading denominators are 1, 1, 2, 2, 8, 8, 16, 16, 128, 128, 256, 256, ... (Sloane's A060818).

The first few powers in terms of Legendre polynomials are

x=P_1(x)
(9)
x^2=1/3[P_0(x)+2P_2(x)]
(10)
x^3=1/5[3P_1(x)+2P_3(x)]
(11)
x^4=1/(35)[7P_0(x)+20P_2(x)+8P_4(x)]
(12)
x^5=1/(63)[27P_1(x)+28P_3(x)+8P_5(x)]
(13)
x^6=1/(231)[33P_0(x)+110P_2(x)+72P_4(x)+16P_6(x)]
(14)
(15)

(Sloane's A008317 and A001790). A closed form for these is given by

 x^n=sum_(l=n,n-2,...)((2l+1)n!)/(2^((n-l)/2)(1/2(n-l))!(l+n+1)!!)P_l(x)
(16)

(R. Schmied, pers. comm., Feb. 27, 2005). For Legendre polynomials and powers up to exponent 12, see Abramowitz and Stegun (1972, p. 798).

The Legendre polynomials can also be generated using Gram-Schmidt orthonormalization in the open interval (-1,1) with the weighting function 1.

P_0(x)=1
(17)
P_1(x)=[x-(int_(-1)^1xdx)/(int_(-1)^1dx)]·1
(18)
=x
(19)
P_2(x)=x[x-(int_(-1)^1x^3dx)/(int_(-1)^1x^2dx)]-[(int_(-1)^1x^2dx)/(int_(-1)^1dx)]·1
(20)
=x^2-1/3
(21)
P_3(x)=[x-(int_(-1)^1x(x^2-1/3)^2dx)/(int_(-1)^1(x^2-1/3)^2dx)](x^2-1/3)-[(int_(-1)^1(x^2-1/3)^2dx)/(int_(-1)^1x^2dx)]x
(22)
=x^3-3/5x.
(23)

Normalizing so that P_n(1)=1 gives the expected Legendre polynomials.

The "shifted" Legendre polynomials are a set of functions analogous to the Legendre polynomials, but defined on the interval (0, 1). They obey the orthogonality relationship

 int_0^1P^__m(x)P^__n(x)dx=1/(2n+1)delta_(mn).
(24)

The first few are

P^__0(x)=1
(25)
P^__1(x)=2x-1
(26)
P^__2(x)=6x^2-6x+1
(27)
P^__3(x)=20x^3-30x^2+12x-1.
(28)

The Legendre polynomials are orthogonal over (-1,1) with weighting function 1 and satisfy

 int_(-1)^1P_n(x)P_m(x)dx=2/(2n+1)delta_(mn),
(29)

where delta_(mn) is the Kronecker delta.

The Legendre polynomials are a special case of the ultraspherical functions with alpha=1/2, a special case of the Jacobi polynomials P_n^((alpha,beta)) with alpha=beta=0, and can be written as a hypergeometric function using Murphy's formula

 P_n(x)=P_n^((0,0))(x)=_2F_1(-n,n+1;1;1/2(1-x))
(30)

(Bailey 1933; 1935, p. 101; Koekoek and Swarttouw 1998).

The Rodrigues representation provides the formula

 P_l(x)=1/(2^ll!)(d^l)/(dx^l)(x^2-1)^l,
(31)

which yields upon expansion

P_l(x)=1/(2^l)sum_(k=0)^(|_l/2_|)((-1)^k(2l-2k)!)/(k!(l-k)!(l-2k)!)x^(l-2k)
(32)
=1/(2^l)sum_(k=0)^(|_l/2_|)(-1)^k(l; k)(2l-2k; l)x^(l-2k)
(33)

where |_r_| is the floor function. Additional sum formulas include

P_l(x)=1/(2^l)sum_(k=0)^(l)(l; k)^2(x-1)^(l-k)(x+1)^k
(34)
=sum_(k=0)^(l)(l; k)(-l-1; k)((1-x)/2)^k
(35)

(Koepf 1998, p. 1). In terms of hypergeometric functions, these can be written

P_n(x)=((x-1)/2)^n_2F_1(-n,-n;1;(x+1)/(x-1))
(36)
(37)
P_n(x)=(2n; n)(x^n)/(2^n)_2F_1(-n/2,(1-n)/2;1/2-n;x^(-2))
(38)
(39)
P_n(x)=_2F_1(-n,n+1;1;(1-x)/2)
(40)
(41)

(Koepf 1998, p. 3).

A generating function for P_n(x) is given by

 g(t,x)=(1-2xt+t^2)^(-1/2)=sum_(n=0)^inftyP_n(x)t^n.
(42)

Take partialg/partialt,

 -1/2(1-2xt+t^2)^(-3/2)(-2x+2t)=sum_(n=0)^inftynP_n(x)t^(n-1).
(43)

Multiply (43) by 2t,

 -t(1-2xt+t^2)^(-3/2)(-2x+2t)=sum_(n=0)^infty2nP_n(x)t^n
(44)

and add (42) and (44),

 (1-2xt+t^2)^(-3/2)[(2xt-2t^2)+(1-2xt+t^2)]=sum_(n=0)^infty(2n+1)P_n(x)t^n
(45)

This expansion is useful in some physical problems, including expanding the Heyney-Greenstein phase function and computing the charge distribution on a sphere. Another generating function is given by

 sum_(n=0)^infty(P_n(x))/(n!)z^n=e^(xz)J_0(zsqrt(1-x^2)),
(46)

where J_0(x) is a zeroth order Bessel function of the first kind (Koepf 1998, p. 2).

The Legendre polynomials satisfy the recurrence relation

 (l+1)P_(l+1)(x)-(2l+1)xP_l(x)+lP_(l-1)(x)=0
(47)

(Koepf 1998, p. 2). In addition,

 (1-x^2)P_n^'(x)=-nxP_n(x)+nP_(n-1)(x)=(n+1)xP_n(x)-(n+1)P_(n+1)(x)
(48)

(correcting Hildebrand 1956, p. 324).

A complex generating function is

 P_l(x)=1/(2pii)int(1-2zx+z^2)^(-1/2)z^(-l-1)dz,
(49)

and the Schläfli integral is

 P_l(x)=((-1)^l)/(2^l)1/(2pii)int((1-z^2)^l)/((z-x)^(l+1))dz.
(50)

Integrals over the interval [x,1] include the general formula

 int_x^1P_m(x)dx=((1-x^2))/(m(m+1))(dP_m(x))/(dx)
(51)

for m!=0 (Byerly 1959, p. 172), from which the special case

int_0^1P_m(x)dx=(P_(m-1)(0)-P_(m+1)(0))/(2m+1)
(52)
={1 m=0; 0 m even !=0; (-1)^((m-1)/2)(m!!)/(m(m+1)(m-1)!!) m odd
(53)

follows (Sloane's A002596 and A046161; Byerly 1959, p. 172). For the integral over a product of Legendre functions,

 int_x^1P_m(x)P_n(x)dx=((1-x^2)[P_n(x)P_m^'(x)-P_m(x)P_n^'(x)])/(m(m+1)-n(n+1))
(54)

for m!=0 (Byerly 1959, p. 172), which gives the special case

 int_0^1P_m(x)P_n(x)dx={1/(2n+1)   m=n; 0   m!=n, m,n both even or odd; f_(m,n)   m even, n odd; f_(n,m)   m odd, n even
(55)

where

 f_(m,n)=((-1)^((m+n+1)/2)m!n!)/(2^(m+n-1)(m-n)(m+n+1)[(1/2m)!]^2{[1/2(n-1)]!}^2)
(56)

(Sloane's A078297 and A078298; Byerly 1959, p. 172). The latter is a special case of

 int_0^1P_mu(x)P_nu(x)dx=(Asin(1/2pinu)cos(1/2pimu)-A^(-1)sin(1/2pimu)cos(1/2pinu))/(1/2pi(nu-mu)(mu+nu+1)),
(57)

where

 A=(Gamma(1/2(mu+1))Gamma(1+1/2nu))/(Gamma(1/2(nu+1))Gamma(1+1/2mu))
(58)

and Gamma(z) is a gamma function (Gradshteyn and Ryzhik 2000, p. 762, eqn. 7.113.1)

Integrals over [-1,1] with weighting functions x and x^2 are given by

int_(-1)^1xP_L(x)P_N(x)dx={(2(L+1))/((2L+1)(2L+3)) for N=L+1; (2L)/((2L-1)(2L+1)) for N=L-1
(59)
int_(-1)^1x^2P_L(x)P_N(x)dx={(2(L+1)(L+2))/((2L+1)(2L+3)(2L+5)) for N=L+2; (2(2L^2+2L-1))/((2L-1)(2L+1)(2L+3)) for N=L; (2L(L-1))/((2L-3)(2L-1)(2L+1)) for N=L-2
(60)

(Arfken 1985, p. 700).

The Laplace transform is given by

 L[P_n(x)](s)={1/2sqrt(pi)[sqrt(2/z)I_(-n-1/2)(z)-1/2z_1F_2(1;2+1/2n,1/2(3-n);1/4z^2)]   for n even; 1/2sqrt(pi)[sqrt(2/z)I_(-n-1/2)(z)+_1F_2(1;1/2(3+n),1-1/2n;1/4z^2)]   for n odd,
(61)

where I_n(z) is a modified Bessel function of the first kind.

An sum identity is given by

 1-[P_n(x)]^2=sum_(nu=1)^n(1-x^2)/(1-x_nu^2)[(P_n(x))/(P_n^'(x_nu)(x-x_nu))]^2,
(62)

where x_nu is the nuth root of P_n(x) (Szegö 1975, p. 348). A similar identity is

 sum_(nu=1)^n(1-x_nu^2)/((n+1)^2[P_(n+1)(x_nu)]^2)=1,
(63)

which is responsible for the fact that the sum of weights in Legendre-Gauss quadrature is always equal to 2.

The associated Legendre polynomials P_l^m(x) and P_l^(-m) are solutions to the associated Legendre differential equation, where l is a positive integer and m=0, ..., l. They are implemented in Mathematica as LegendreP[l, m, x]. For positive m, they can be given in terms of the unassociated polynomials by

P_l^m(x)=(-1)^m(1-x^2)^(m/2)(d^m)/(dx^m)P_l(x)
(64)
=((-1)^m)/(2^ll!)(1-x^2)^(m/2)(d^(l+m))/(dx^(l+m))(x^2-1)^l,
(65)

where P_l(x) are the unassociated Legendre polynomials. The associated Legendre polynomials for negative m are then defined by

 P_l^(-m)(x)=(-1)^m((l-m)!)/((l+m)!)P_l^m(x).
(66)

There are two sign conventions for associated Legendre polynomials. Some authors (e.g., Arfken 1985, pp. 668-669) omit the Condon-Shortley phase (-1)^m, while others include it (e.g., Abramowitz and Stegun 1972, Press et al. 1992, and the LegendreP[l, m, z] command of Mathematica). Care is therefore needed in comparing polynomials obtained from different sources. One possible way to distinguish the two conventions is due to Abramowitz and Stegun (1972, p. 332), who use the notation

 P_(lm)(x)=(-1)^mP_l^m(x)
(67)

to distinguish the two.

Associated polynomials are sometimes called Ferrers' functions (Sansone 1991, p. 246). If m=0, they reduce to the unassociated polynomials. The associated Legendre functions are part of the spherical harmonics, which are the solution of Laplace's equation in spherical coordinates. They are orthogonal over [-1,1] with the weighting function 1

 int_(-1)^1P_l^m(x)P_(l^')^m(x)dx=2/(2l+1)((l+m)!)/((l-m)!)delta_(ll^'),
(68)

and orthogonal over [-1,1] with respect to m with the weighting function (1-x^2)^(-1),

 int_(-1)^1P_l^m(x)P_l^(m^')(x)(dx)/(1-x^2)=((l+m)!)/(m(l-m)!)delta_(mm^').
(69)

The associated Legendre polynomials also obey the following recurrence relations

 (l-m)P_l^m(x)=x(2l-1)P_(l-1)^m(x)-(l+m-1)P_(l-2)^m(x).
(70)

Letting x=costheta (commonly denoted mu in this context),

 (dP_l^m(mu))/(dtheta)=(lmuP_l^m(mu)-(l+m)P_(l-1)^m(mu))/(sqrt(1-mu^2))
(71)
 (2l+1)muP_l^m(mu)=(l+m)P_(l-1)^m(mu)+(l-m+1)P_(l+1)^m(mu).
(72)

Additional identities are

 P_l^l(x)=(-1)^l(2l-1)!!(1-x^2)^(l/2)
(73)
 P_(l+1)^l(x)=x(2l+1)P_l^l(x).
(74)

Including the factor of (-1)^m, the first few associated Legendre polynomials are

P_0^0(x)=1
(75)
P_1^0(x)=x
(76)
P_1^1(x)=-(1-x^2)^(1/2)
(77)
P_2^0(x)=1/2(3x^2-1)
(78)
P_2^1(x)=-3x(1-x^2)^(1/2)
(79)
P_2^2(x)=3(1-x^2)
(80)
P_3^0(x)=1/2x(5x^2-3)
(81)
P_3^1(x)=3/2(1-5x^2)(1-x^2)^(1/2)
(82)
P_3^2(x)=15x(1-x^2)
(83)
P_3^3(x)=-15(1-x^2)^(3/2)
(84)
P_4^0(x)=1/8(35x^4-30x^2+3)
(85)
P_4^1(x)=5/2x(3-7x^2)(1-x^2)^(1/2)
(86)
P_4^2(x)=(15)/2(7x^2-1)(1-x^2)
(87)
P_4^3(x)=-105x(1-x^2)^(3/2)
(88)
P_4^4(x)=105(1-x^2)^2
(89)
P_5^0(x)=1/8x(63x^4-70x^2+15).
(90)

Written in terms x=costheta (commonly written mu=costheta), the first few become

P_0^0(costheta)=1
(91)
P_1^0(costheta)=costheta
(92)
P_1^1(costheta)=-sintheta
(93)
P_2^0(costheta)=1/2(3cos^2theta-1)
(94)
P_2^1(costheta)=-3sinthetacostheta
(95)
P_2^2(costheta)=3sin^2theta
(96)
P_3^0(costheta)=1/2costheta(5cos^2theta-3)
(97)
P_3^1(costheta)=-3/2(5cos^2theta-1)sintheta
(98)
P_3^2(costheta)=15costhetasin^2theta
(99)
P_3^3(costheta)=-15sin^3theta.
(100)

The derivative about the origin is

 [(dP_nu^mu(x))/(dx)]_(x=0)=(2^(mu+1)sin[1/2pi(nu+mu)]Gamma(1/2nu+1/2mu+1))/(pi^(1/2)Gamma(1/2nu-1/2mu+1/2))
(101)

(Abramowitz and Stegun 1972, p. 334), and the logarithmic derivative is

 [(dlnP_lambda^mu(z))/(dz)]_(z=0)=2tan[1/2pi(lambda+mu)]([1/2(lambda+mu)]![1/2(lambda-mu)]!)/([1/2(lambda+mu-1)]![1/2(lambda-mu-1)]!).
(102)

(Binney and Tremaine 1987, p. 654).

SEE ALSO: Condon-Shortley Phase, Conical Function, Kings Problem, Laplace's Integral, Laplace-Mehler Integral, Legendre Function of the First Kind, Legendre Function of the Second Kind, Mehler-Dirichlet Integral, Spherical Harmonic, Super Catalan Number, Toroidal Function, Turán's Inequalities, Ultraspherical Polynomial, Zonal Harmonic

RELATED WOLFRAM SITES: http://functions.wolfram.com/Polynomials/LegendreP/, http://functions.wolfram.com/Polynomials/LegendreP/

REFERENCES:

Abramowitz, M. and Stegun, I. A. (Eds.). "Legendre Functions" and "Orthogonal Polynomials." Ch. 22 in Chs. 8 and 22 in Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, pp. 331-339 and 771-802, 1972.

Arfken, G. "Legendre Functions." Ch. 12 in Mathematical Methods for Physicists, 3rd ed. Orlando, FL: Academic Press, pp. 637-711, 1985.

Bailey, W. N. "On the Product of Two Legendre Polynomials." Proc. Cambridge Philos. Soc. 29, 173-177, 1933.

Bailey, W. N. Generalised Hypergeometric Series. Cambridge, England: Cambridge University Press, 1935.

Binney, J. and Tremaine, S. "Associated Legendre Functions." Appendix 5 in Galactic Dynamics. Princeton, NJ: Princeton University Press, pp. 654-655, 1987.

Byerly, W. E. "Zonal Harmonics." Ch. 5 in An Elementary Treatise on Fourier's Series, and Spherical, Cylindrical, and Ellipsoidal Harmonics, with Applications to Problems in Mathematical Physics. New York: Dover, pp. 144-194, 1959.

Gradshteyn, I. S. and Ryzhik, I. M. Tables of Integrals, Series, and Products, 6th ed. San Diego, CA: Academic Press, 2000.

Hildebrand, F. B. Introduction to Numerical Analysis. New York: McGraw-Hill, 1956.

Iyanaga, S. and Kawada, Y. (Eds.). "Legendre Function" and "Associated Legendre Function." Appendix A, Tables 18.II and 18.III in Encyclopedic Dictionary of Mathematics. Cambridge, MA: MIT Press, pp. 1462-1468, 1980.

Koekoek, R. and Swarttouw, R. F. "Legendre / Spherical." §1.8.3 in The Askey-Scheme of Hypergeometric Orthogonal Polynomials and its q-Analogue. Delft, Netherlands: Technische Universiteit Delft, Faculty of Technical Mathematics and Informatics Report 98-17, p. 44, 1998.

Koepf, W. Hypergeometric Summation: An Algorithmic Approach to Summation and Special Function Identities. Braunschweig, Germany: Vieweg, 1998.

Lagrange, R. Polynomes et fonctions de Legendre. Paris: Gauthier-Villars, 1939.

Legendre, A. M. "Sur l'attraction des Sphéroides." Mém. Math. et Phys. présentés à l'Ac. r. des. sc. par divers savants 10, 1785.

Morse, P. M. and Feshbach, H. Methods of Theoretical Physics, Part I. New York: McGraw-Hill, pp. 593-597, 1953.

Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, p. 252, 1992.

Sansone, G. "Expansions in Series of Legendre Polynomials and Spherical Harmonics." Ch. 3 in Orthogonal Functions, rev. English ed. New York: Dover, pp. 169-294, 1991.

Sloane, N. J. A. Sequences A001790/M2508, A002596/M3768, A008316, A008317, A046161, A060818, A078297, and A078298 in "The On-Line Encyclopedia of Integer Sequences."

Snow, C. Hypergeometric and Legendre Functions with Applications to Integral Equations of Potential Theory. Washington, DC: U. S. Government Printing Office, 1952.

Spanier, J. and Oldham, K. B. "The Legendre Polynomials P_n(x)" and "The Legendre Functions P_nu(x) and Q_nu(x)." Chs. 21 and 59 in An Atlas of Functions. Washington, DC: Hemisphere, pp. 183-192 and 581-597, 1987.

Strutt, J. W. "On the Values of the Integral int_0^1Q_nQ_n^'dmu, Q_n, Q_n^' being LaPlace's Coefficients of the orders n, n^', with an Application to the Theory of Radiation." Philos. Trans. Roy. Soc. London 160, 579-590, 1870.

Szegö, G. Orthogonal Polynomials, 4th ed. Providence, RI: Amer. Math. Soc., 1975.

Whittaker, E. T. and Watson, G. N. A Course in Modern Analysis, 4th ed. Cambridge, England: Cambridge University Press, 1990.




CITE THIS AS:

Weisstein, Eric W. "Legendre Polynomial." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/LegendrePolynomial.html

Mathematica For Students -- as low as $44.95.