Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340
Return to Part VII of the course APMA0340
Introduction to Linear Algebra with Mathematica
Legendre's polynomials are eigenfunctions of a singular Sturm--Liouville problem for a second order differential equation. They are named after Adrien-Marie Legendre, who discovered them in 1782.
Adrien-Marie Legendre (1752--1833) was a French mathematician. Legendre made numerous contributions to mathematics.
His major work is Exercices de Calcul Intégral, published in three volumes in 1811, 1817, and 1819, where he introduced the basic properties of elliptic integrals, beta functions and gamma functions, along with their applications to mechanics.
The Legendre equation is the second order differential equation with a real parameter λ
\[
\left( 1-x^2\right) y'' -2x\,y' + \lambda\, y =0 , \qquad -1 < x < 1 .
\]
This equation has two regular singular points x = ±1 where the leading coefficient (1 − x²) vanishes. Upon adding the boundary conditions and rewriting the equation in self-adjoint form, we obtain the Sturm--Liouville problem
Eq.\eqref{EqLegendre.1} has two linear independent solutions, one of which must be unbounded at endpoints. It turns out that the Legendre equation has a bounded solution only when λ = n(n + 1) for some nonzero integer n ∈ ℤ+. Such value of parameter λ is called eigenvalue and corresponding (bounded) eigenfunction is known as the Legendre polynomial, denoted as Pn(x). Any bounded solution of the Legendre equation is a constant multiple of Pn(x).
where n is a nonzero integer, was considered in section xvi of Part V in the first tutorial. It was shown that Eq.\eqref{EqLegendre.1} has a series solution
\[
y(x) = \sum_{k\ge 0} c_k x^k ,
\]
with coefficients connected via the recurrence
\[
c_{k+2} = \frac{k \left( k+1 \right) - \lambda}{\left( k+1 \right)\left( k+2 \right)}\, c_k , \qquad k=0,1,2,\ldots .
\]
When λ = n(n + 1) for some nonzero integer n, Eq.\eqref{EqLegendre.1} has a polynomial solution, denoted by Pn(x) and called after Legendre.
Each Legendre polynomial may be expressed using Rodrigues' formula (named after Benjamin Olinde Rodrigues (1795--1851), a French banker, mathematician, and social reformer):
To get some idea of what these polynomials look like, we construct graphs of the first 7. We first define a function legraph[n] that produces a graph of the kth polynomial, and then we use a Do loop to construct the first 7 graphs.
Extract out the two linearly independent solutions
Coefficient[ y, c[0]]
Out[6]= {1 - 10 x^2 + (35 x^4)/3}
Coefficient[ y, c[1]]
Out[7]= {x - 3 x^3 + (6 x^5)/5}
To check our answer, we use Mathematica again because it knows Legendre:
LegendreP[4,x]
Out[8]= 1/8 (3 - 30 x^2 + 35 x^4)
This is different from the polynomial obtained earlier, but only by a
constant factor. The constant factor is used to set the normailization
for the Legendre polynomials.
End of Example 1
■
There are known many integral representations for Legendre's polynomials. we mention one of them, derived byLaplace:
Formula \eqref{EqLegendre.4} shows that Legendre's polynomials contain only even or odd powers of x, depending on parity of n.
From it, we derive the numerical values:
Another linearly independent solution of Legendre's equation (see section ix in Part IV of tutorial I) when λ = n(n + 1) is conventionally denoted by Qn(x) and it can be determined from the formula (up to arbitrary constant multiple)
Here m∈ℤ+ is a nonnegative integer. The Sturm--Liouville problem for Eq.\eqref{EqLegendre.7} asks to find such values of parameter λ for which solutions y(x) and its derivative \( \left( 1 - x^2 \right)^{1/2} y'(x) \) remain bounded at endpoints x = ±1. It turns out that this is possible only when λ = n(n+1), with n∈ℤ+. The eigenfunction corresponding to eigenvalues
λn = n(n+1), n = 0, 1, 2, …, are convensionally called
associated Legendre functions. They usually are denoted by
\( P_n^m (x) , \quad m=0,1,2,\ldots , n; \) or by Pn(m, x). The function Pn(m, x) is a polynomial of degree n if and only if m is even. However, \( P_n^m (\cos\theta ) \) is a homogeneous polynomial of degree n in sinθ and cosθ. When m = 0, we get the Legendre equation.
The associated Legendre functions of the first kind are given by Rodrigue’s formula
Mathematica has a build-in command to evaluate associated Legendre polynomials; however, it does not follow Eq.\eqref{EqLegendre.8}, but multiplies it by −1:
Return to Mathematica page
Return to the main page (APMA0340)
Return to the Part 1 Matrix Algebra
Return to the Part 2 Linear Systems of Ordinary Differential Equations
Return to the Part 3 Non-linear Systems of Ordinary Differential Equations
Return to the Part 4 Numerical Methods
Return to the Part 5 Fourier Series
Return to the Part 6 Partial Differential Equations
Return to the Part 7 Special Functions