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.
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
A quadrature rule for approximating is a formula
Derivation hint: 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 .
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:
Derivation hint: on each subinterval approximate by the straight line through its endpoints (area of a trapezoid ), then sum.
Derivation hint: fit a parabola through each consecutive triple , integrate exactly to get , and sum over pairs of panels (requires even).
If , the composite trapezoidal rule satisfies, for some ,
Derivation hint: 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 ,
Derivation hint: Simpson's local error per double-panel is ; sum over panels and apply the intermediate value theorem.
For the weight function on , there exist nodes (the roots of the degree- Legendre polynomial ) and weights such that
Derivation hint: 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
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 . 2. Interpolate. The unique degree- Lagrange interpolant of at these nodes is
3. Integrate the interpolant. By linearity,
The weights depend only on the nodes, establishing equation [1]. 4. 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 . 5. Error from interpolation error. Since , integrating gives
which is small when is bounded and the node polynomial has small integrated magnitude.
∎1. Let the nodes be the roots of , the degree- Legendre polynomial, orthogonal to all lower-degree polynomials on . 2. Take any polynomial of degree . Divide by : with , . 3. Exact integral: , the first term vanishing by orthogonality (). 4. Quadrature: at each node , so . Thus . 5. The rule is interpolatory of degree , so it is exact for (degree ): . 6. Combining: . The rule is exact to degree .
∎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 .
Worked Examples
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.
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).
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
Historical Development
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