Numerical Integration & Differentiation

Gauss-Legendre quadrature

/ GOWSS luh-ZHAHND-ruh /

Gaussian quadrature is a general recipe; Gauss-Legendre is its most common concrete realization — the version for an ordinary, unweighted integral over a finite interval. It is the rule most people mean when they say 'Gauss quadrature', and it is the integration engine buried inside finite-element solvers and scientific libraries.

It targets the plain integral of f over [-1, 1] (any finite [a, b] is mapped onto [-1, 1] by a simple linear change of variable). The n nodes are the n roots of the Legendre polynomial P_n, the orthogonal polynomials for constant weight on [-1, 1]; the matching weights come from a closed formula involving P_n'. The result inherits the Gaussian guarantee: an n-point Gauss-Legendre rule integrates every polynomial up to degree 2n - 1 exactly. The nodes are symmetric about 0 and cluster gently toward the endpoints. In practice the nodes and weights are precomputed once (classically via the Golub-Welsch eigenvalue algorithm, which reads them off a small symmetric tridiagonal matrix) and reused for every integral of that order.

Gauss-Legendre is the default high-accuracy quadrature for smooth functions on a bounded interval, converging exponentially fast when f is analytic. The same honest limits as general Gaussian quadrature apply: the spectacular accuracy assumes smoothness, so a singularity or kink demands a different tool; the classical nodes are not nested, so you cannot cheaply reuse work when increasing n (this motivates Gauss-Kronrod extensions and the nested Clenshaw-Curtis rule); and remember the affine remapping introduces a Jacobian factor (b - a)/2 that you must not forget when integrating over a general [a, b].

Integrate cos(x) on [0, pi/2] (true 1). Map to [-1, 1] with x = (pi/4)(t + 1), Jacobian pi/4. A 3-point Gauss-Legendre rule (nodes 0, +-0.7746 with weights 8/9, 5/9, 5/9) gives 0.99999920 — six correct digits from only three function evaluations.

Legendre roots as nodes: exponential accuracy on smooth functions.

Two traps: forgetting the (b - a)/2 Jacobian when remapping a general interval onto [-1, 1], and expecting the exponential convergence on a non-smooth integrand where it simply does not hold. For weighted integrands or infinite ranges, switch to the matching family (Chebyshev, Hermite, Laguerre) rather than forcing Legendre.

Also called
Gauss-Legendre ruleLegendre-Gauss quadrature高斯-勒讓德積分