Lesson 3 of 15
Legendre Polynomials
Legendre Polynomials
Legendre polynomials are solutions to Legendre's differential equation and arise naturally in problems with spherical symmetry, such as solving the Laplace equation in spherical coordinates.
Three-Term Recurrence
The polynomials can be generated efficiently using the recurrence relation:
with initial conditions and .
The first few polynomials:
Orthogonality
Legendre polynomials are orthogonal on :
The normalization constant is returned by legendre_norm(n).
Rodrigues' Formula
An explicit formula using derivatives:
Legendre Series
Any sufficiently smooth function on can be expanded in a Legendre series:
The coefficients are .
Your Task
Implement the three functions below. Use only Python's math module and built-in functions.
Python runtime loading...
Loading...
Click "Run" to execute your code.