Numerical Integration

Numerical integration (or quadrature) approximates a definite integral by a finite weighted sum of function values . It is the standard tool when an antiderivative is unavailable, unknown, or only sampled data exist. Core methods range from the trapezoidal and Simpson's rules to Gaussian quadrature and adaptive/Monte Carlo schemes. Developed from Newton and Cotes (1700s) through Gauss (1814) to modern adaptive algorithms.

Numerical integration is the branch of numerical analysis concerned with computing approximate values of definite integrals using only evaluations of the integrand. It matters because the overwhelming majority of integrals arising in physics, engineering, statistics, and applied science have no closed-form antiderivative expressible in elementary functions — even something as simple as . The central strategy is to replace the integrand by an interpolating polynomial (or another tractable model) over each subinterval and integrate that exactly. A surprising fact is that by choosing the sample points cleverly rather than uniformly — as Gauss did — an -point rule can integrate polynomials of degree up to exactly, doubling the accuracy obtainable from equally spaced nodes.

The Core Insight

You cannot integrate an arbitrary function symbolically, but you can always evaluate it at chosen points. Replace on each piece of by a polynomial that agrees with at the sample points and integrate the polynomial exactly. The integral of the polynomial is a linear combination where the weights depend only on the nodes — not on . All of quadrature is the art of choosing nodes and weights to make the error small.

Formal Statement

Quadrature Rule

A quadrature rule for approximating is a formula

1
⟳integrate an interpolating polynomial and set , using linearity of the integral.

where the points are the nodes (or abscissae), the numbers are the weights, and is the number of points. The degree of exactness (or order) of the rule is the largest integer such that for every polynomial of degree . The quadrature error is .

Newton–Cotes Formulas

The Newton–Cotes formulas use equally spaced nodes , where , and take the weights from the integral of the Lagrange interpolating polynomial. The two most important closed forms are:

2
⟳on each subinterval approximate by the straight line through its endpoints (area of a trapezoid ), then sum.
3
⟳fit a parabola through each consecutive triple , integrate exactly to get , and sum over pairs of panels (requires even).

Error of the Composite Trapezoidal and Simpson Rules

If , the composite trapezoidal rule satisfies, for some ,

4
⟳expand in a Taylor series about each subinterval midpoint and integrate the remainder, or apply the Peano kernel theorem; sum the local errors and use the intermediate value theorem on .

If , the composite Simpson rule satisfies, for some ,

5
⟳Simpson's local error per double-panel is ; sum over panels and apply the intermediate value theorem.

Gaussian Quadrature

For the weight function on , there exist nodes (the roots of the degree- Legendre polynomial ) and weights such that

6
⟳require the rule to be exact for ; the constraints force the nodes to be roots of the orthogonal polynomial , since any such decomposes as with by orthogonality.

This Gauss–Legendre rule with nodes is exact for all polynomials of degree . A general interval is reached by the affine change of variable , which multiplies the result by .

Why It Holds / Derivation

Interpolatory Quadrature and Its Weights

Goal: show that any rule built by integrating a polynomial interpolant has the form with -independent weights, and is exact for low-degree polynomials.
  1. Choose nodes. Fix distinct nodes .
  1. Interpolate. The unique degree- Lagrange interpolant of at these nodes is
  1. Integrate the interpolant. By linearity,
The weights depend only on the nodes, establishing equation [1].
  1. Degree of exactness. If is itself a polynomial of degree , then the interpolant reproduces it exactly: . Hence . So every -point interpolatory rule is exact to degree at least .
  1. Error from interpolation error. Since , integrating gives
which is small when is bounded and the node polynomial has small integrated magnitude.

Why Gaussian Nodes Double the Accuracy

  1. Let the nodes be the roots of , the degree- Legendre polynomial, orthogonal to all lower-degree polynomials on .
  1. Take any polynomial of degree . Divide by : with , .
  1. Exact integral: , the first term vanishing by orthogonality ().
  1. Quadrature: at each node , so . Thus .
  1. The rule is interpolatory of degree , so it is exact for (degree ): .
  1. Combining: . The rule is exact to degree .

Carl Friedrich Gauss | 1777–1855

Gauss presented his quadrature method in Methodus nova integralium valores per approximationem inveniendi (1814). His insight — that the placement of nodes is a free resource to be optimized, not fixed by convenience — was revolutionary. By demanding exactness for as many monomials as the free parameters (nodes + weights) allow, he discovered that the optimal nodes are precisely the roots of orthogonal polynomials, linking quadrature to the theory of orthogonal polynomials he and Legendre were developing. The result remains the gold standard for smooth integrands and underlies modern spectral methods.

Building Intuition

Think of estimating the area under a curve from a few altitude readings. The trapezoidal rule connects adjacent readings with straight lines — it overestimates concave-down curves and underestimates concave-up ones, hence the in its error. Simpson's rule fits little parabolas, capturing curvature, so it nails any cubic exactly (a happy accident from symmetry) and only fails at the fourth derivative.

The leap to Gaussian quadrature is the realization that equally spaced samples waste information. If you are allowed to pick where to measure, you place nodes denser near the ends (where polynomial interpolation is shakiest) and let each node "carry" twice its weight in exactness. Two numbers per node — its location and its weight — give two equations satisfied, so nodes satisfy conditions, i.e. exactness through degree .

The governing principle throughout: convergence rate is dictated by smoothness. Doubling the number of panels cuts trapezoidal error by 4 () but Simpson's by 16 (); for analytic functions, Gaussian and spectral methods converge faster than any power of .

Trapezoidal vs. Simpson approximation of a curve over one panel pair

x f(x) f(x) x₀ x₁ x₂ trapezoid chords Simpson parabola

Worked Examples

Trapezoidal and Simpson for $\int_0^1 e^{-x^2}\,dx$

Given: on with subintervals, .

Sample values:

Trapezoidal (eq. [2]):
Simpson (eq. [3]), odd , even :

The true value is ; Simpson's error is versus the trapezoidal error — a hundredfold improvement at the same five evaluations.

Two-point Gauss–Legendre for $\int_1^3 \ln x\,dx$

Given: , interval . Use the 2-point Gauss rule: on nodes , weights each. Step 1 — map : midpoint , half-width , so .
Step 2 — evaluate:
Step 3 — apply rule (multiply by half-width 1):
Exact:

Only two evaluations achieve accuracy comparable to a 4-panel Simpson rule — the power of optimal node placement.

Common Misconceptions

More nodes is not always better with equal spacing. High-degree Newton–Cotes formulas on equally spaced points develop negative weights and suffer Runge's phenomenon — the interpolating polynomial oscillates wildly near the endpoints. Negative weights destroy numerical stability (cancellation amplifies rounding error) and can make the rule diverge as for some smooth functions. The cure is either compositing (many low-order panels) or non-uniform nodes (Gauss, Clenshaw–Curtis).

Runge's function defeats high-order Newton–Cotes

Consider on — perfectly smooth, even analytic. The single-panel Newton–Cotes rule of degree (one polynomial through equally spaced nodes) has error that grows without bound as , because the interpolating polynomial oscillates with amplitude diverging near . The integrated error does not go to zero. By contrast, Gauss–Legendre and the composite trapezoidal rule both converge for this function. The lesson: smoothness of does not guarantee convergence of a fixed-node scheme — node distribution matters as much as integrand regularity.

Simpson's rule requires an even number of subintervals. Each parabola spans two panels. With an odd , you cannot pair the panels; applying the weights blindly gives a wrong answer. Handle a leftover panel separately (e.g. Simpson's 3/8 rule on three panels) or choose even.

Connections

Numerical integration sits at the crossroads of several fields. The weights and exactness conditions come from Polynomial Interpolation and Lagrange basis polynomials. Gaussian quadrature is an application of Orthogonal Polynomials (Legendre, Chebyshev, Hermite, Laguerre — each suited to a weight function and interval). The error analysis relies on Taylor's Theorem and the Peano kernel theorem. Richardson Extrapolation applied to the trapezoidal rule produces Romberg integration, systematically cancelling the leading error terms. For high-dimensional integrals, where grid methods suffer the curse of dimensionality, one turns to Monte Carlo Integration whose error is independent of dimension. Finally, quadrature is the engine inside Numerical Solution of ODEs, since integrating a differential equation step is exactly an integration problem.

Real-World Applications

  • Computational physics: evaluating partition functions, scattering cross-sections, and matrix elements in quantum chemistry uses Gauss–Hermite and Gauss–Legendre quadrature on every integral.
  • Finite element analysis (FEA): structural and thermal simulations integrate stiffness matrices element-by-element with Gauss points; engineers literally speak of "2×2 Gauss integration" inside each element.
  • Computer graphics and rendering: the rendering equation's light-transport integrals are evaluated by Monte Carlo and quasi-Monte Carlo quadrature (path tracing).
  • Statistics and Bayesian inference: marginal likelihoods and posterior expectations use Gauss–Hermite quadrature (for Gaussian-like posteriors) or adaptive Monte Carlo.
  • Signal processing: computing energies, correlations, and Fourier coefficients of sampled signals via trapezoidal/Simpson integration of discrete data.
  • Astrodynamics and orbital mechanics: propagating spacecraft trajectories and computing perturbation integrals with high-order Gauss and Romberg schemes.
  • Financial engineering: pricing options requires integrating payoff functions against probability densities (e.g. Heston model characteristic-function integrals via adaptive Gauss–Kronrod).

Historical Development

  • c. 250 BCE — Archimedes: computes areas by the method of exhaustion, the conceptual ancestor of quadrature; his parabola result anticipates Simpson's rule.
  • 1670s — Newton & Gregory: interpolation formulas on equally spaced points lay groundwork for Newton–Cotes rules.
  • 1722 — Roger Cotes: publishes the family of equal-interval quadrature weights now called Newton–Cotes formulas (posthumously, after his 1716 death).
  • 1743 — Thomas Simpson: popularizes the parabolic rule (known earlier to Cavalieri and Gregory) in his textbook, lending it his name.
  • 1814 — Carl Friedrich Gauss: introduces optimal-node quadrature, achieving degree exactness; ties nodes to roots of Legendre polynomials.
  • 1826 — Carl Jacobi: generalizes to weighted integrals and the connection with orthogonal polynomials, broadening Gauss's method.
  • 1900 — Walter Romberg's precursors (Richardson): L. F. Richardson develops extrapolation (1911) that later yields Romberg integration.
  • 1955 — Werner Romberg: publishes the systematic -extrapolation tableau combining trapezoidal estimates into high-order results.
  • 1960s — Clenshaw, Curtis, Kronrod: Clenshaw–Curtis quadrature (Chebyshev nodes, 1960) and Gauss–Kronrod extensions (1964) bring efficient, error-estimating adaptive quadrature into wide computational use.

Subtleties & Limits

Several issues remain practically and theoretically delicate. (1) Singular and oscillatory integrands: standard rules degrade catastrophically for or highly oscillatory with large ; specialized methods (Levin, Filon, modified Gauss weights, double-exponential "tanh-sinh" transforms) are needed, and choosing among them automatically is unsolved in full generality. (2) High-dimensional quadrature: the curse of dimensionality makes tensor-product grids ( points) infeasible; sparse grids (Smolyak) and quasi-Monte Carlo lattice rules push the boundary, but optimal constructions for general integrands remain an active research area. (3) A posteriori error estimation: rigorous, tight, automatically computable error bounds without knowing are hard; practical codes use embedded pairs (Gauss–Kronrod) heuristically, which can be fooled. (4) Verified/interval quadrature producing guaranteed enclosures is an ongoing field at the intersection of numerical analysis and computer-assisted proof.

See Also

Polynomial Interpolation · Orthogonal Polynomials · Romberg Integration · Monte Carlo Integration · Richardson Extrapolation · Numerical Solution of ODEs · Spectral Methods · Adaptive Quadrature · Definite Integral

Before this

Where this leads