Legendre Polynomial Calculator

P_n(x) orthogonal basis

CalculatorsFreeNo Signup
4.8(745 reviews)
All Tools

Loading tool...

About Legendre Polynomial Calculator

A Legendre polynomial calculator computing P_n(x) via Bonnet's recurrence: (n+1)P_{n+1}=(2n+1)xP_n−nP_{n-1}. P_0=1, P_1=x, P_2=(3x²−1)/2. Used in Gauss-Legendre quadrature, multipole expansions, spherical harmonics. Client-side.

Legendre Polynomial Calculator Features

  • P_n(x) value
  • Coefficients
  • Recurrence steps
  • Gauss nodes
  • Sequence
Legendre polynomials: P_n(x) orthogonal on [-1,1] with weight 1. P_0=1, P_1=x, P_2=(3x²−1)/2, P_3=(5x³−3x)/2. Bonnet: (n+1)P_{n+1}=(2n+1)xP_n−nP_{n-1}. Rodrigues: P_n=(1/2^n·n!)d^n/dx^n(x²−1)^n.

How to Use

Enter n and x:

  • P_n(x): Evaluation
  • Sequence: P_0..P_n
  • Coefficients: Polynomial form

Gauss-Legendre

Roots of P_n are the Gauss-Legendre quadrature nodes. n-point Gauss quadrature is exact for polynomials up to degree 2n-1 — the maximum possible! This makes it the most efficient quadrature method.

Physics

Spherical harmonics Y_l^m(θ,φ) = P_l^m(cos θ)e^{imφ}. Multipole expansion: potential at distance r from charge distribution uses Legendre polynomials. Fundamental in electrostatics, gravity, quantum mechanics.

Step-by-Step Instructions

  1. 1Enter degree n.
  2. 2Enter x value.
  3. 3Compute P_n(x).
  4. 4View sequence.
  5. 5See Gauss nodes.

Legendre Polynomial Calculator — Frequently Asked Questions

What does orthogonality mean here?+

∫_{-1}^{1} P_m(x)P_n(x)dx = 0 if m≠n, and 2/(2n+1) if m=n. This means Legendre polynomials form a basis for L²[-1,1]. Any square-integrable function can be expanded as Σa_nP_n(x).

How do associated Legendre polynomials relate?+

P_n^m(x) = (-1)^m(1-x²)^{m/2}d^m/dx^m P_n(x). These generalize P_n and are needed for spherical harmonics. The m=0 case gives the ordinary Legendre polynomials.

Why are zeros important?+

Zeros of P_n are the optimal nodes for Gaussian quadrature on [-1,1]. They interlace: between consecutive zeros of P_n lies exactly one zero of P_{n+1}. This ensures stability and convergence of the quadrature scheme.

Share this tool: