Composite midpoint quadrature rule 2026-10-14
Apply the midpoint quadrature rule on each of equal panels of a partition of an interval, with :Each quadrature node is a panel midpoint and each quadrature weight is . For , put . Summing the panel quadrature errors givesfor some . Each panel contributes at most ; there are panels, explaining the composite midpoint rule error of order in big O notation. On a nonuniform partition of an interval with panel widths and largest width , the corresponding bound is .
For on , summing the sampled polynomial exactly yieldsDoubling divides the absolute error by exactly four. For a general function, halving divides the displayed error bound by four, but the actual absolute error need not follow that ratio: cancellation can make it smaller or zero. Continuous functions still give convergence as the largest panel width tends to zero, by uniform continuity; without the bounded second derivative, the second-order rate is not guaranteed. Noise sensitivity of a quadrature rule explains a separate limitation when samples are inexact.
Composite Simpson's rule 2026-10-18
Composite Simpson's rule applies Simpson's rule to consecutive pairs of equal subintervals. Choose a positive even integer , put , and take quadrature nodes for . There are subintervals, two-subinterval panels, and quadrature nodes. ThenThe second sum is empty when , recovering one panel. The quadrature weights, before multiplication by , are . Every interior even-indexed quadrature node is an endpoint of two panels, so its two endpoint contributions add to two; every odd-indexed quadrature node is a midpoint with weight four. An odd cannot be covered by these pairs. The displayed formula requires equal spacing.[ref]
5.6 Numerical integration. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; §5.6, equations 5.6.20–5.6.21: elementary and composite Simpson formulas
For the exponential function on the interval , the exact integral is . With , the formula gives , an overestimate of about . With , it gives , an overestimate of about . The figure shows the intermediate refinements and compares every computed absolute error with the error bound for composite Simpson's rule.
Computed composite Simpson errors for the exponential function on zero to one approach fourth-order convergence; the dashed curve is the rigorous bound e over 180 n to the fourth power
. Details. For this exponential function, a geometric series also gives a compact independent formula. With and , summing the panel contributions yieldsA Taylor series at givesThe Big O notation describes the remaining terms as tends to zero. Consequently tends to sixteen: the computed ratios increase from about to . Fourth-order truncation error is also obtained by Richardson extrapolation of the composite trapezoidal rule.[ref]
5.6 Numerical integration. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; §5.6.2, equations 5.6.14–5.6.15: Simpson extrapolation and fourth-order error
Composite trapezoidal rule Created 2026-10-14 Updated 2026-10-31
On an equal-panel partition of an interval, with , sum the trapezoidal rule over adjacent panels:There are distinct quadrature nodes. Each interior sample belongs to two panels and therefore has quadrature weight , while each endpoint has quadrature weight . Equivalently, the composite trapezoidal rule integrates the piecewise linear function obtained by linear interpolation exactly.[ref]
For and , summing panel quadrature errors givesfor some . Thus panel quadrature errors of order accumulate to order , using big O notation.[ref]
3.5 Quadrature, subsection (i) Trapezoidal Rules. §3.5(i), equations 3.5.2–3.5.3: composite formula and signed error
On a nonuniform partition of an interval with widths and largest width , the bound is .For the polynomial on , direct summation yieldsBoth quadrature errors shrink by exactly four when doubles, with opposite signs. This exact relation belongs to this polynomial example; the trapezoidal rule is not always twice as inaccurate as the midpoint quadrature rule.
Quadratic quadrature errors fall by four on refinement while a common sample bias persists
. Details. The left plot uses exact polynomial sums; the right adds a common sample bias to the composite trapezoidal rule. That mathematical model converges to , showing why smaller panels alone do not ensure accuracy for noisy samples. It illustrates noise sensitivity of a quadrature rule, rather than measured data.
Let be orthonormal polynomials for a positive weight, and let define its -point Gaussian quadrature. Put and . Exactness through polynomial degree gives . Positivity of the quadrature weights makes a square orthogonal matrix, so also. Thus the unweighted row inner products of the evaluation matrix are .
For positive quadrature weights summing to the total mass , a quadrature rule exact on polynomials through polynomial degree satisfies for every such polynomial . This follows by subtracting the exactly integrated and applying the triangle inequality to the integral and weighted sum. For Gauss-Legendre quadrature with nodes, and . Exponentially decaying Chebyshev series coefficients therefore yield a bound proportional to when .
Interpolatory quadrature 2026-10-31
An interpolatory quadrature approximates a definite integral by exactly integrating the interpolation polynomial through prescribed sampled values. For distinct quadrature nodes , its quadrature weights are , where are the Lagrange cardinal polynomials. It is exact for all polynomials of polynomial degree at most , because polynomial interpolation reproduces them. Newton-Cotes quadrature adds equal spacing of the quadrature nodes.
Midpoint quadrature rule Created 2026-10-03 Updated 2026-10-14
The midpoint quadrature rule replaces the integrand on , , by its value halfway across the interval:Geometrically, is the signed area of a rectangle with width and height . Its single quadrature node is and its quadrature weight is . Sampling in the interior is useful when endpoint evaluation is inconvenient, although an endpoint singularity can invalidate the quadrature error estimates below.
The midpoint quadrature rule is exact for every affine function : the average height over an interval equals its midpoint height. For example, on , gives and . Positive and negative area discrepancies cancel for a sloping straight line. For the polynomial on , however, and , giving approximation error . Thus its degree of precision of a quadrature rule is exactly one.[ref]
5.8 Numerical Integration. §5.8, printed p. 223: midpoint rectangles, linear exactness and signed quadratic errors
For the polynomial on , four panels give composite midpoint quadrature rule value and composite trapezoidal rule value , bracketing the exact integral . Individual midpoint rectangles can cross the curve; it is their total signed area that underestimates the integral.
For , meaning that its first two derivatives exist and are continuous functions on the closed interval, the signed approximation error has the formHence a convex function with is underestimated, and a concave function with is overestimated. A short justification uses the Taylor formula with integral remainder: writing , it gives , where for and for . This nonnegative Peano kernel has integral , so the weighted mean value theorem for integrals gives the stated sign and coefficient.
Newton-Cotes quadrature 2026-10-31
A Newton-Cotes quadrature is an interpolatory quadrature rule whose quadrature nodes are equally spaced. Integrating the Lagrange interpolation polynomial gives quadrature weights . A Newton-Cotes closed quadrature includes both endpoints; an open rule uses interior quadrature nodes. Simpson's rule is the closed rule with three quadrature nodes. Its quadrature weights are .
Noise sensitivity of a quadrature rule 2026-10-14
If the observed samples are , the resulting quadrature rule changes by . Bounded sample perturbations therefore satisfyFor ordinary numerical integration with nonnegative quadrature weights exact on constant functions, the bound is , independent of panel refinement. A common bias attains it: the quadrature error due to the function approximation may vanish while this sample error persists. Interpolating a fixed data set onto a finer grid likewise does not create new observations or remove its uncertainty.
With new samples whose errors are independent random variables of zero expectation and common variance , a different model givesFor equal panels this is for the composite midpoint quadrature rule and for the composite trapezoidal rule. These variance reductions require the stated independence and unbiasedness assumptions; a common bias or correlated sample errors need not shrink. The two displayed perturbation formulas follow directly from the triangle inequality and the variance additivity for independent random variables, respectively.
Numerical integration Created 2026-10-03 Updated 2026-10-18
Numerical integration approximates a definite integral using finitely many sampled function values. For an integrand on a finite interval , , a quadrature rule has the formThe quadrature nodes tell us where to evaluate ; the quadrature weights turn those values into an approximation to the accumulated signed area. The exact definite integral depends on the integrand throughout the interval, whereas the quadrature rule sees only these samples. Integrating a chosen interpolant exactly still generally approximates the original integrand's integral.[ref]
5.6 Numerical integration. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; Definition 5.6.1 and §5.6.1, equations 5.6.2–5.6.5: weighted samples and integration of an interpolant
The fundamental theorem of calculus evaluates as when an antiderivative is available. Numerical integration is useful when no convenient antiderivative is known, or each evaluation of the integrand requires an expensive computation. The task then becomes choosing informative quadrature nodes and controlling the quadrature error with as few evaluations as possible. Fixed data also permit a quadrature rule, but refinement cannot supply new information between observations.[ref]
5.6 Numerical integration. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; Opening discussion, Example 5.6.1 and the paragraph following Definition 5.6.1: antiderivatives, numerical evaluation and fixed data
For an exact comparison, take the polynomial on . Its antiderivative gives . On a partition of an interval into equal panels, the composite midpoint quadrature rule uses midpoint samples, each with quadrature weight ; the composite trapezoidal rule uses endpoint samples, with outer quadrature weights and interior quadrature weights . The existing derivations under these two quadrature rules giveIn particular, and already bracket ; two panels give and . The convex function explains the opposite signs. A midpoint rectangle can cross the curve within its panel, so its total signed area, rather than pointwise ordering, determines the underestimate.
One and two panels for numerical integration of : midpoint and endpoint samples with their quadrature weights
. Details. Define the signed approximation error as . In this example the absolute errors are and : doubling reduces each by exactly four. A plot with both axes on a logarithmic scale therefore has slope , expressing order two with respect to panel refinement. This is an exact calculation for this polynomial, including , rather than an observed rate extrapolated from a few computed answers.
Exact absolute errors for midpoint and trapezoidal numerical integration of : slope and a factor-four reduction
. Details. For a general integrand, the composite midpoint quadrature rule and composite trapezoidal rule give second-order quadrature error bounds when has two continuous derivatives on and a known bound on . These hypotheses describe behavior between samples. A formal error formula containing an unknown derivative is not a numerical accuracy certificate or a justified sample count. Finite samples do not certify quadrature accuracy makes the missing information explicit. Errors in the evaluations and roundoff error must also be considered; noise sensitivity of a quadrature rule treats the former.
More elaborate choices exploit other information: Gaussian quadrature obtains high polynomial exactness from carefully chosen quadrature nodes, and Simpson's rule uses a quadratic interpolant. Adaptive numerical integration compares approximations and concentrates samples where they disagree, often saving evaluations. Such a difference is an error estimate, not a certified bound without further assumptions: both approximations can miss the same feature.[ref]
5.7 Adaptive integration. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; §5.7.1, equation 5.7.4: a difference-based error estimate; §5.7.2: interval bisection; Example 5.7.2 and concluding discussion: requested accuracy is not guaranteed
For , the one-panel trapezoidal rule isIt integrates the linear interpolation between the two endpoint samples. Indeed the affine functionhas definite integral . The two quadrature nodes are and both quadrature weights are .
Past exam of the numerical analysis course of the University of Oxford 2015 1 c ii Solution 2026-10-31
For every uniform partition of an interval with panels, the quadrature nodes satisfy . Their composite trapezoidal rule quadrature weights agree, so the two sampled sine values cancel. If there is a node at zero its sine value is already zero. The constant term is integrated exactly, givingThis is symmetric trapezoidal exactness for odd functions, applied after adding a constant function so that the resulting definite integral is nonzero. It is exactness for this particular integrand, rather than a claim that every nonpolynomial function is integrated exactly.
Past exam of the numerical analysis course of the University of Oxford 2015 1 c i Solution 2026-10-31
On a partition of an interval , apply the trapezoidal rule separately to each panel and add:For uniform spacing , this composite trapezoidal rule becomesEach interior sample occurs in two panels; their half-quadrature weights combine to . The endpoint quadrature weights are .
A Newton-Cotes quadrature integrates a Lagrange interpolation polynomial at equally spaced quadrature nodes. For the Newton-Cotes closed quadrature, the endpoints are included: write , , and useThese quadrature weights depend on the quadrature nodes, not on the sampled function. Open Newton-Cotes quadrature uses equally spaced interior quadrature nodes instead.
For Simpson's rule, use and set , so . The Lagrange cardinal polynomials becomeIntegrating these quadratic polynomials gives , , , respectively. The change of variable contributes , soIts degree of precision of a quadrature rule is three: it integrates every quadratic polynomial by construction, and also the cubic nodal polynomial , whose integral vanishes by odd symmetry about . Any cubic polynomial differs from its quadratic polynomial interpolant by a constant multiple of this nodal polynomial.
Read the differential order literally: take quadrature nodes in and in . Applying Simpson's rule first in and then in multiplies the one-dimensional quadrature weights. With , this tensor-product quadrature isEquivalently, the nine sampled function values have the quadrature weight arraywith rows indexed by the quadrature nodes and columns by the quadrature nodes. The quadrature weights sum to the rectangle's area. If the intended coordinate assignment is instead , , exchange and in the formula. Both conventions give the same calculation on the unit square used below.
For the separable integrand, tensor-product quadrature factors into two one-dimensional applications of Simpson's rule:soThe exact double integral, evaluated by Fubini's theorem and the power rule for integration, isThe factor is always integrated exactly. All quadrature error therefore comes from applying Simpson's rule to the factor.
Past exam of the numerical analysis course of the University of Oxford 2021 1 c ii Solution 2026-10-25
Truncate the Chebyshev series at the full degree of precision of a quadrature rule:Since on , the geometric series estimate givesThe same bound proves uniform convergence of the original Chebyshev series, so its sum and the tail estimate are justified. Gauss-Legendre quadrature is exact on . Its positive quadrature weights sum to , henceTherefore one explicit choice proving exponential convergence of Gaussian quadrature isUsing exactness through polynomial degree doubles the exponent compared with truncating at polynomial degree .
Past exam of the numerical analysis course of the University of Oxford 2021 1 c i Solution 2026-10-25
Let denote the conventional Legendre polynomial, normalized by . The quadrature nodes are its distinct polynomial roots in . For these nodes form the Lagrange cardinal polynomialsChoose the quadrature weights by integrating these polynomials:An equivalent standard formula isThe reason for selecting these quadrature nodes is the resulting degree of precision of a quadrature rule. For any polynomial of polynomial degree at most , polynomial division givesThe orthogonality of the Legendre polynomial makes , while at each quadrature node. The definition of the quadrature weights integrates exactly, soIn particular, . Applying this exactness to also proves .
Use the degree-ordered orthogonal polynomials identified in (b); otherwise the printed nodes need not exist. Let be the degree- Lagrange interpolation polynomial with and set .
For any , polynomial division gives with and . Orthogonality gives , while this product also vanishes at every node. The interpolation formula for then provesApply this exactness to , of degree at most . It gives , because is not the zero polynomial. Thus all quadrature weights are actually strictly positive, stronger than the requested nonnegativity. Here exactness is for the weighted integral defined at the start of the question.
Quadrature node Created 2026-10-14 Updated 2026-10-31
A quadrature node is a point at which the integrand is sampled by a quadrature rule. Under the affine map from to , a reference quadrature node becomes ; for ordinary numerical integration, the corresponding quadrature weight is multiplied by .
Quadrature rule Created 2026-09-24 Updated 2026-10-14
A quadrature rule approximates an integral by a finite weighted sum of sampled function values:The quadrature nodes specify where to sample, and the quadrature weights specify how much each sample contributes. The density specifies the target integral, whereas the discrete quadrature weights belong to the approximation. Ordinary numerical integration has . Gaussian quadrature and the midpoint quadrature rule choose interior quadrature nodes; the trapezoidal rule includes endpoints.[ref]
For ordinary numerical integration, exactness on the constant function requires ; exactness on additionally requires . These two checks make the quadrature rule exact for every affine function. For example, both the midpoint quadrature rule and trapezoidal rule give for . Testing progressively higher polynomial degrees defines the degree of precision of a quadrature rule. Exactness describes a class of integrands, rather than promising exact results for every function.
Composite midpoint quadrature rules and composite trapezoidal rules apply a simple quadrature rule on every panel of a partition of an interval. This buys accuracy by shrinking the panels while keeping the elementary formula fixed. For continuous functions sampled exactly, their quadrature errors tend to zero as the largest panel width tends to zero. The familiar second-order bounds require stronger assumptions about derivatives. The signed approximation error used here is ; some sources define quadrature error with the opposite sign, so the convention must accompany any formula.




