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]
Figure 1.
Midpoint rectangles and trapezoids approximate the area under a quadratic
. Details.
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 form
Hence 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.
Numerical integration Created 2026-10-03 Updated 2026-10-14
Numerical integration approximates a definite integral using finitely many sampled function values. For an integrand on a finite interval , , a quadrature rule has the form
The 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]
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]
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 give
In 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.
Figure 1.
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.
Figure 2.
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]
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.