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
Cubic exactness of Simpson's rule Created 2026-10-18 Updated 2026-10-20
Polynomial interpolation makes Simpson's rule exact for every polynomial of polynomial degree at most two. To understand the extra polynomial degree, centre the coordinate at the midpoint: , with endpoints . For any cubic polynomial , let be its interpolating quadratic polynomial. The polynomial vanishes at all three quadrature nodes, sowhere is the coefficient of in . As a function of , this is an odd function, whose integral over the symmetric interval is zero. Hence integrating also integrates exactly. This is the symmetry mechanism in the nodal-polynomial criterion for quadrature exactness.
In the worked example, the polynomial difference factors asIts definite integrals on and are respectively and . Their cancellation concerns signed integrals, rather than pointwise accuracy of polynomial interpolation.
The degree of precision of a quadrature rule stops at three: on the same interval, the monomial gives , whereas . Their difference, exact integral minus approximation, is .
Error bound for composite Simpson's rule 2026-10-18
Suppose has a fourth derivative that is a continuous function on the interval , and there. With , the signed quadrature error here is . Then, for some point ,In particular, a strictly positive fourth derivative makes : composite Simpson's rule overestimates the integral.[ref]
The bound's scale follows by adding the panel errors. A panel of width has signed quadrature error and absolute error at most . There are panels, so the triangle inequality gives . The intermediate value theorem for the continuous fourth derivative replaces the average of the panel values by a single value , giving the signed formula.
The underlying single-panel calculation can be seen through the Peano kernel theorem. On the interval , define the raw Peano kernel , where is integral minus Simpson's rule and is the positive part. Then for and for . It is strictly negative inside the interval and has integral . ThusThe uniform norm bounds the fourth derivative. The polynomial attains equality. Scaling to endpoint spacing multiplies the coefficient by , giving the sharp single-panel bound . The normalized Peano kernel is , so the external factorial must be omitted when using that normalization.
For the exponential function on , , so and the bound is . Its leading actual absolute error is , smaller than the bound because a uniform upper bound on the fourth derivative does not use its variation across the interval. The theorem bounds truncation error with exact function evaluations; sample errors and roundoff error are additional contributions, as described by noise sensitivity of a quadrature rule.
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 .
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
Past exam of the mathematics course of the University of Cambridge 2009 ib Paper 3 19C Solution Created 2026-09-24 Updated 2026-10-14
Assume is linear, annihilates all polynomials of degree at most , is defined on the truncated-power kernels and permits interchange with the remainder integral. For , a convenient sufficient condition is that be a bounded linear functional on ; more general approximation functionals need the corresponding continuity/interchange property on their domain. Taylor's integral remainder givesApplying , the polynomial terms vanish, and the Peano kernel theorem givesHere . This is the printed raw-kernel convention; the normalized Peano kernel includes inside its definition instead, and then has no factorial outside the integral. The interchange is justified by boundedness applied to the limit of Riemann sums of the continuous kernel-valued integrand. For a kernel with , its discontinuity requires a function space/interchange assumption accommodating the step functions as well.
For the specified Simpson's rule error, direct evaluation on gives zero, so . For ,Simplifying separately on the two halves givesBoth pieces are strictly negative in the open interval; they agree at the midpoint. Their integral is , as direct polynomial integration shows. ThusThis is optimal, not merely an upper bound. For , the fourth derivative is identically one and , so the minimum constant is .
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 2017 1 d iii Solution 2026-10-31
At ,This is an overestimate, with signed quadrature errorThe relative error is , approximately . The quartic polynomial lies beyond the degree of precision of a quadrature rule of Simpson's rule, so the exactness of the previous cases no longer applies.
Past exam of the numerical analysis course of the University of Oxford 2017 1 d ii Solution 2026-10-31
At ,The factor is now a cubic polynomial. Simpson's rule still integrates it exactly because its degree of precision of a quadrature rule is three. Exactness of tensor-product quadrature depends on the polynomial degree in each variable, rather than their sum.
Past exam of the numerical analysis course of the University of Oxford 2017 1 d i Solution 2026-10-31
At , the preceding tensor-product quadrature givesBoth factors of the separable integrand are quadratic polynomials, so exactness follows directly from the construction of Simpson's rule.
Apply the first Richardson extrapolation step to the two computed approximations:The exact integral is , so the actual absolute error isThus the requested strict error bound is verified directly. This first extrapolation of trapezoidal approximations is also the one-panel Simpson's rule value on the three nodes .
Richardson extrapolation combines approximations with a known leading error power to cancel that error. If , then removes .
Let for an even number of equal subintervals, with . The composite trapezoidal rule isThe Simpson's rule isAssume an error expansion , with the same coefficient on refined uniform meshes; is sufficient for this form. The coarser rule is . Direct coefficient collection givesThe leading errors cancel, leaving . The identity of the numerical integration weights is exact; the error-order conclusion additionally uses the smoothness and even-power error assumptions.
With unit strip width, the composite trapezoidal rule givesFor Simpson's rule, the even integer arguments are the odd-numbered interior grid positions. ThereforeThe requested two-decimal answers are and . The supplied component sums are individually rounded; they should not be treated as exact simultaneous identities. Computing from the original function gives approximately and , respectively, with the same two-decimal results.
Take to be a positive even integer, as required by composite Simpson's rule. There are two-strip panels, each of width . Applying the supplied panel bound with the global fourth-derivative minimum and maximum , and summing, givesHere is the nonnegative absolute error. In this example Simpson's rule overestimates the integral, so . Each panel has that same sign because its fourth derivative is nonnegative; cancellation is not being assumed.[ref]
3.5 Quadrature, subsection (ii) Simpson’s Rule. §3.5(ii), equations 3.5.6–3.5.8: elementary and composite fourth-derivative remainders
Choose equation (1), evaluated by refined composite Simpson's rule. It gives directly as a one-dimensional definite integral with fixed endpoints and a smooth integrand. It therefore avoids root finding altogether. Before evaluating, use the trigonometric identityThis equivalent integrand is nonnegative throughout , avoiding cancellation between the original two terms. Equation (2) instead subtracts two potentially large exponential functions, while equation (3) would ordinarily put a numerical integration inside a root finding loop.
For even , let , , and computeThen double . The integrand has bounded derivatives of every fixed order on the integration interval; in the fourth-order error regime, the estimated remaining truncation error in is . The factor follows by eliminating the leading term between the two mesh widths.[ref]
Stop when this estimate is comparable to and further refinement shows stagnation at the roundoff error scale. Check that the differences previously decreased consistently with fourth-order convergence; differences alone are not a rigorous error certificate if cancellation or roundoff error dominates. Compensated summation helps keep the summation error near the precision limit. Refining indefinitely after this point increases work without reliably adding meaningful digits. This answers the requested choice and termination strategy without requiring an explicit value of .
Use Simpson's rule: the cubic exactness of Simpson's rule includes every quadratic integrand, so three function evaluations already give the exact answer. Thus the error is zero. For a general smooth integrand the corresponding composite Simpson's rule has error in big O notation, but that bound is unnecessarily weak here.
A convenient choice for this irregular region is Monte Carlo integration. The region is contained in . For independent uniform points in that square, letThe indicator random variable incorporates the curved boundary directly. This estimator is unbiased; the integrand is bounded on the square, so its variance is finite. The variance of a sum of independent terms gives root mean square error in big O notation. This is a stochastic error rate. Applying a rectangular Simpson's rule to the indicator-weighted integrand would lose the smoothness required for its fourth-order error bound.
Richardson extrapolation 2026-10-14
Richardson extrapolation improves an approximation by combining two resolutions so that their leading truncation errors cancel. The useful surprise is that the size of that leading error need not be known: its scaling under refinement is enough. This lets an existing finite difference method or quadrature rule produce a more accurate answer from two runs, without first deriving a new method from scratch.
Suppose approximates a fixed limit as the positive resolution parameter tends to zero, with an asymptotic expansionHere is known, is independent of , and denotes Big O notation. The same asymptotic expansion, with the same , must describe both and . Nested grids make it natural to reuse samples, although nesting itself does not establish this error model. Define the linear combinationThe weights sum to one, preserving , while . Thus Richardson extrapolation gives : the next available term in the asymptotic expansion determines the improved order. Justin Solomon's numerical analysis text develops this cancellation for finite differences and applies it to numerical integration.[ref]
https://people.csail.mit.edu/jsolomon/share/book/numerical_book.pdf. Justin Solomon, Numerical Algorithms, §14.3.3 and Exercise 14.9
Geometrically, regard the approximation as a function of . Its first two terms are a straight line . The two computed points lie at positive ; extending the line through them to gives . This is why the operation is extrapolation: it estimates a value outside the sampled parameter interval. The remaining curvature corresponds to the uncancelled terms of the asymptotic expansion.
Worked example: a centered derivative of sine. For the smooth function , the exact derivative at is . The centered difference quotient, a central finite difference, isThe Taylor series of sine gives the signed truncation errorThus , and . Halving divides the leading truncation error by four. Combining the two centered difference quotients with Richardson extrapolation givesIndeed, the coefficient becomes ; the coefficient vanishes. This is the even-power case of Richardson extrapolation discussed in Persson's authored lecture notes.[ref]
https://persson.berkeley.edu/math128a/lecture_notes/math128a_lecture_notes_chapter_4.html. Per-Olof Persson, Math 128A, Chapter 4, §§4.1–4.2
For and , the actual computations areThe absolute error drops from about for to for , an improvement by roughly a factor of 498. Refining again gives , whose absolute error is about . The refined truncation errors decrease by nearly four for and nearly sixteen for , reflecting their second and fourth orders.
Centered sine derivative errors: second order before Richardson extrapolation and fourth order after cancellation
. Source. Details. The logarithmic scale on each axis turns power laws into straight lines. The dashed reference curves are and , the magnitudes of the leading truncation errors. The plotted errors are computed with 70-digit decimal arithmetic, rather than clipped to a display floor; this isolates the asymptotic expansion from roundoff error.
Worked example: integrating an exponential. Approximate the definite integral of the exponential function on :For numerical integration, the composite trapezoidal rule adds the areas of trapezoids between successive samples; this is the quadrature use of the endpoint average that also occurs in the ODE trapezoidal rule. On equal intervals, with , defineSumming the geometric series gives . Expanding the exponential function near zero yieldsThe leading truncation error again has , . On the uniform nested grids with and intervals, Richardson extrapolation therefore givesThis linear combination is exactly composite Simpson's rule on the finer grid, whose spacing is . On each coarse panel, an old endpoint receives weight and the new midpoint weight ; shared old endpoints receive weight . These are the usual Simpson's rule weights multiplied by . The equivalence is explained directly in LeMesurier's university notes.[ref]
https://lemesurierb.people.charleston.edu/elementary-numerical-analysis-python/notebooks/definite-integrals-3-simpson-richardson.html. Brenton LeMesurier, MATH 375, §19.1: The Basic Simpson's Rule by Richardson Extrapolation
For two coarse panels and four fine panels,The absolute errors are about , and , respectively. Reusing the fine-grid samples makes Richardson extrapolation especially attractive here: the resulting Simpson's rule needs no samples beyond those already used by .
Exponential quadrature on nested grids: trapezoidal areas, reused sample nodes, and the fourth-order Simpson combination
. Source. Details. When the improvement is justified. Richardson extrapolation requires the stated asymptotic expansion and the correct positive . If the actual leading exponent is , its coefficient after combination is , so the leading truncation error generally remains. Merely knowing does not supply a common coefficient or a higher-order remainder. A discontinuity of a function, a singular endpoint, or unrelated changes between grids can invalidate the assumed asymptotic expansion; refinement alone does not guarantee improvement for every numerical problem.
Roundoff error and errors in the sampled values survive the cancellation of truncation error. If the coarse and fine values have absolute perturbations bounded by , the perturbation in is bounded by ; for this is . In floating-point arithmetic, a centered difference quotient can also amplify sample errors through division by , so an indefinitely smaller need not be more accurate. Persson's notes describe this balance between truncation error and roundoff error.[ref]
https://persson.berkeley.edu/math128a/lecture_notes/math128a_lecture_notes_chapter_4.html. Per-Olof Persson, Math 128A, Chapter 4, §4.1: Roundoff Error Instability
The same cancellation idea appears in step-doubling error estimation. For an order- one-step method for an ordinary differential equation, two half steps each contribute local truncation error of order , so their accumulated leading local error has ratio to one full step. This explains the denominator there; the appropriate exponent follows from that local error model, rather than automatically from a generic use of Richardson extrapolation.




