# LegendreP

LegendreP[n,x]

gives the Legendre polynomial .

LegendreP[n,m,x]

gives the associated Legendre polynomial .

# Details • Mathematical function, suitable for both symbolic and numerical manipulation.
• Explicit formulas are given for integers n and m.
• The Legendre polynomials satisfy the differential equation .
• The Legendre polynomials are orthogonal with unit weight function.
• The associated Legendre polynomials are defined by .
• For arbitrary complex values of n, m, and z, LegendreP[n,z] and LegendreP[n,m,z] give Legendre functions of the first kind.
• LegendreP[n,m,a,z] gives Legendre functions of type a. The default is type 1.
• The symbolic form of type 1 involves , of type 2 involves , and of type 3 involves .
• Type 1 is defined only for within the unit circle in the complex plane. Type 2 represents an analytic continuation of type 1 outside the unit circle.
• Type 2 functions have branch cuts from to and from to in the complex plane.
• Type 3 functions have a single branch cut from to .
• LegendreP[n,m,a,z] is defined to be Hypergeometric2F1Regularized[-n,n+1,1-m,(1-z)/2] multiplied by for type 2 and by for type 3.
• For certain special arguments, LegendreP automatically evaluates to exact values.
• LegendreP can be evaluated to arbitrary numerical precision.
• LegendreP automatically threads over lists.

# Examples

open allclose all

## Basic Examples(6)

Evaluate numerically:

Compute the Legendre polynomial:

Plot over a subset of the reals:

Plot over a subset of the complexes:

Series expansion at the origin:

Asymptotic expansion at Infinity:

## Scope(49)

### Numerical Evaluation(6)

Evaluate numerically at fixed points:

Evaluate to high precision:

The precision of the output tracks the precision of the input:

Evaluate for complex orders and arguments:

Evaluate LegendreP efficiently at high precision:

LegendreP can deal with real-valued intervals:

### Specific Values(5)

Legendre polynomial for symbolic :

Find a local maximum as a root of :

Compute the associated Legendre polynomial :

Compute an associated Legendre polynomial for half-integer and :

Different LegendreP types give different symbolic forms:

### Visualization(3)

Plot the LegendreP function for various orders:

Plot the real part of :

Plot the imaginary part of :

Type 2 and 3 of Legendre functions have different branch cut structures:

### Function Properties(12) is defined for all for integer and for for noninteger :

In the complex plane, it is defined for when is not an integer:

The associated Legendre function is additionally undefined at when is not an even integer:

The range for Legendre polynomials of integer orders:

The range for complex values is the whole plane:

Legendre polynomial of an odd order is odd:

Legendre polynomial of an even order is even:

Legendre polynomials have the mirror property : is an analytic function of for integer :

It is neither analytic nor meromorphic for noninteger :

The associated Legendre function is analytic as long as is also an even integer: is neither non-decreasing nor non-increasing for integers : is neither non-decreasing nor non-increasing for integers : is surjective for positive odd integer values of but not even values:

LegendreP is neither non-negative nor non-positive: has no singularities or discontinuities when is an integer:

The associated Legendre function has additional singularities when is not an even integer: is neither non-decreasing nor non-increasing for integers :

### Differentiation(3)

First derivative:

Higher derivatives:

Plot higher derivatives for :

Formula for the  derivative:

### Integration(3)

Indefinite integral of LegendreP:

Indefinite integral of an algebraic function with :

Definite integral of :

### Series Expansions(4)

Taylor expansion for :

Plot the first three approximations for at :

General term in the series expansion of :

Taylor expansion for the associated Legendre polynomial :

LegendreP can be applied to a power series:

### Integral Transforms(4)

The Fourier transform of a Legendre polynomial with order using FourierTransform:

The Laplace transform of a Legendre polynomial with order using LaplaceTransform:

The Mellin transform of a Legendre polynomial with order using MellinTransform:

The Hankel transform of a Legendre polynomial with order using HankelTransform:

### Function Identities and Simplifications(4)

LegendreP may reduce to simpler functions:

Associated Legendre polynomials in terms of ordinary Legendre polynomials:

Sum of Legendre polynomials:

Recurrence relation:

### Function Representations(5)

Representation in terms of MeijerG:

LegendreP can be expressed as a DifferentialRoot:

SphericalHarmonicY uses associated Legendre function in its definition:

Associated Legendre polynomials in terms of the angular spheroidal function:

## Generalizations & Extensions(3)

LegendreP can deal with real-valued intervals:

Different LegendreP types give different symbolic forms:

Types 2 and 3 have different branch cut structures:

## Applications(3)

Angular momentum eigenfunctions:

Find quantum eigenfunctions for modified PöschlTeller potential:

Generalized Fourier transform for functions on the interval -1 to 1:

## Properties & Relations(4)

Use FunctionExpand to expand into simpler functions:

LegendreP can be expressed as a DifferenceRoot:

The generating function for LegendreP:

The exponential generating function for LegendreP:

## Possible Issues(1)

Cancellations in the polynomial form may lead to inaccurate numerical results:

Evaluate the function directly:

## Neat Examples(2)

Visualize distribution of zeros:

Generalized Lissajous figures: