43.09.02 · numerical-analysis / 09-numerical-quadrature

Composite rules, Euler-Maclaurin, and Romberg / adaptive quadrature

shipped3 tiersLean: none

Anchor (Master): Davis-Rabinowitz 1984 *Methods of Numerical Integration* 2e (Academic Press) Ch. 2-4, 6 (composite rules, Euler-Maclaurin, Romberg extrapolation and the periodic/trapezoidal spectral accuracy); Trefethen-Weideman 2014 *The exponentially convergent trapezoidal rule* (SIAM Review 56) (geometric convergence for analytic periodic integrands); Henrici 1977 *Applied and Computational Complex Analysis* vol. 2 (Wiley) Ch. 11 (Euler-Maclaurin, Bernoulli numbers, and the trapezoidal rule on the circle)

Intuition Beginner

A single trapezium or parabola laid across a whole interval is a crude stand-in for a curve that bends a lot. The fix is the one you would reach for instinctively: chop the interval into many narrow strips, lay a small trapezium over each strip, and add up the little areas. Over a narrow strip even a wiggly curve looks almost straight, so each small trapezium is accurate, and the total is far better than one giant trapezium. This chopping-and-summing recipe is called a composite rule, and it is the workhorse of practical integration.

Halving the width of the strips does something predictable to the error. For the composite trapezium rule, cutting the strip width in half cuts the error to about a quarter. That fixed factor of four is a gift, because it lets you guess the answer you would get with infinitely many strips before you ever compute it. If two estimates differ by a known pattern, you can combine them to cancel the leading mistake and leap to a much sharper value. Doing this combining over and over is the idea behind a method called Romberg integration.

There is a deeper reason the error shrinks by a clean factor of four, and it comes from a remarkable bookkeeping formula. The formula says the trapezium error is built entirely out of corrections measured at the two endpoints of the interval — how steep the curve is there, how its steepness is changing, and so on. Nothing from the middle of the interval contributes to the leading error. This has a startling payoff: if the curve repeats itself like a wave, so that its behaviour at the right endpoint exactly matches the left, all those endpoint corrections cancel, and the humble trapezium rule becomes spectacularly accurate.

Finally, real curves are not uniformly difficult. A function may be calm over most of its range and sharply peaked in one small region. Spacing strips evenly wastes effort on the calm parts and starves the peak. Adaptive quadrature watches the local error as it goes, and spends strips where the curve misbehaves and few where it is tame, refining only the regions that need it.

Visual Beginner

Picture the interval cut into several equal strips, with a small straight chord laid across the top of each strip. The composite trapezium estimate is the sum of all the little trapezoid areas. Doubling the number of strips halves their width and roughly quarters the total error, and the table below tracks that pattern. The second idea in the picture is the endpoint bookkeeping: the leftover error is read off only from the two ends of the whole interval, not from anything in between.

number of strips strip width rough error size
about
about

Each row halves the width and quarters the error, so the error behaves like the square of the strip width. That fixed factor of four is exactly the lever that Romberg integration pulls: knowing the error shrinks by four lets you cancel most of it by combining two estimates.

Worked example Beginner

Let us estimate the area under from to with the composite trapezium rule using two strips, then refine to four and watch the error pattern. The exact area is the natural logarithm of , about .

Step 1. Two strips. The width is , split into two strips of width , with sample points , , . The values are , , .

Step 2. Apply the composite trapezium rule. Count the two end values at half weight and the interior value at full weight, then multiply by the strip width: .

Step 3. The two-strip error. The estimate minus the true is about .

Step 4. Four strips. Width , sample points with values . The rule gives .

Step 5. The four-strip error. The estimate minus is about .

What this tells us: halving the strip width took the error from down to , a drop by a factor close to four, exactly as the square-of-the-width rule predicts. That predictable factor is what makes the next step — combining the two estimates to cancel the error — possible.

Check your understanding Beginner

Formal definition Intermediate+

Throughout, , the interval is partitioned into equal subintervals of width with nodes for , and . The space of polynomials of degree at most is , and means has continuous derivatives through order . The single-interval trapezium and Simpson rules and their Peano-kernel error terms are those of 43.09.01.

Definition (composite trapezium and Simpson rules). The composite trapezium rule on the partition is $$ T_N(f) = h\Big(\tfrac12 f_0 + f_1 + \dots + f_{N-1} + \tfrac12 f_N\Big) = h\sum_{j=0}^{N}{}' f_j , $$ where the primed sum halves the two endpoint terms. The composite Simpson rule (for even ) groups the subintervals in pairs: $$ S_N(f) = \frac{h}{3}\Big(f_0 + 4f_1 + 2f_2 + 4f_3 + \dots + 2f_{N-2} + 4f_{N-1} + f_N\Big). $$ Both are obtained by applying the corresponding single-interval rule of 43.09.01 on each subinterval (each pair, for Simpson) and adding. All weights are positive, so neither rule amplifies data error.

Definition (Bernoulli numbers and polynomials). The Bernoulli polynomials are defined by the generating function , and the Bernoulli numbers are . They satisfy , for , and for ; the first even values are , , . The periodic Bernoulli function , with the fractional part, extends on to a -periodic function.

Definition (Romberg T-table). Let be the composite trapezium estimate on subintervals, . The Romberg table is generated by the Richardson recurrence $$ T^{(k)}_j = T^{(k-1)}_j + \frac{T^{(k-1)}j - T^{(k-1)}{j-1}}{4^{k} - 1}, \qquad k \ge 1,\ j \ge k . $$ The column has leading error ; the diagonal entries are the Romberg estimates.

The symbols , , the Bernoulli polynomials , the periodic Bernoulli function , the fractional part , and the primed summation are recorded in _meta/NOTATION.md.

Counterexamples to common slips Intermediate+

  • "The composite trapezium error expansion converges as a power series in ." It is an asymptotic expansion: for fixed the series in is generally divergent, because the Bernoulli numbers grow like . One truncates at an optimal index and keeps the remainder term; treating it as a convergent series is wrong.

  • "Euler-Maclaurin makes every integrand integrable to spectral accuracy by the trapezium rule." The endpoint corrections vanish only for smooth periodic integrands (or those with matching endpoint derivatives). For a generic on the corrections are nonzero and the rule remains .

  • "Romberg's extrapolation factor is always in the denominator." That factor is correct only because the trapezium error expansion runs in even powers . A rule whose error has an or odd-power term needs the factor keyed to its actual error orders; applying the pattern to such a rule corrupts the result.

  • "Adaptive quadrature with a local tolerance guarantees a global error below ." The local estimates can be unreliable where is rough, and summing many local errors near tolerance can exceed the intended global bound; robust schemes apportion the global tolerance across subintervals and guard against under-resolved spikes.

Key theorem with proof Intermediate+

The signature result is the Euler-Maclaurin summation formula. It writes the difference between the composite trapezium sum and the exact integral as a finite sum of endpoint-derivative corrections weighted by Bernoulli numbers, plus an integral remainder. The expansion runs in even powers of , which both explains the clean leading behaviour and powers the Richardson extrapolation underlying Romberg integration. The proof is repeated integration by parts against the Bernoulli polynomials on each subinterval. This follows Süli-Mayers [Süli-Mayers §7.6].

Theorem (Euler-Maclaurin summation formula). Let , let , and let be the composite trapezium rule. Then $$ T_N(f) - \int_a^b f(x),dx = \sum_{k=1}^{m} \frac{B_{2k}}{(2k)!},h^{2k}\Big[f^{(2k-1)}(b) - f^{(2k-1)}(a)\Big] + R_m, $$ where the remainder is $$ R_m = -\frac{h^{2m+2}}{(2m+2)!}\int_a^b \widetilde{B}{2m+2}!\Big(\tfrac{x-a}{h}\Big), f^{(2m+2)}(x),dx , $$ *and $|R_m| \le \dfrac{|B{2m+2}|}{(2m+2)!},h^{2m+2}(b-a),\max_{[a,b]}|f^{(2m+2)}|$.*

Proof. It suffices to prove the formula on a single subinterval (after the affine rescaling , ) and sum. On the claim is the Euler-Maclaurin one-panel identity $$ \frac{g(0)+g(1)}{2} - \int_0^1 g(s),ds = \sum_{k=1}^{m}\frac{B_{2k}}{(2k)!}\Big[g^{(2k-1)}(1) - g^{(2k-1)}(0)\Big] - \frac{1}{(2m+2)!}\int_0^1 \widetilde{B}_{2m+2}(s),g^{(2m+2)}(s),ds, $$ for . Begin from and integrate by parts using , so that : $$ \int_0^1 g,ds = \big[B_1(s)g(s)\big]_0^1 - \int_0^1 B_1(s),g'(s),ds = \frac{g(1)+g(0)}{2} - \int_0^1 B_1(s),g'(s),ds , $$ using , . This already gives the trapezium value minus a correction integral.

Now integrate the correction repeatedly using , i.e. , so each integration by parts raises the Bernoulli index by one and a derivative onto . At each even index the boundary term contributes , using ; at each odd index the boundary term vanishes because for . After integrations by parts the surviving boundary terms are exactly the displayed Bernoulli sum, and the final integral is the periodic-Bernoulli remainder. Summing the one-panel identity over the subintervals telescopes the interior endpoint terms — the derivative correction at from the right of one panel cancels the one from the left of the next — leaving only the global endpoints and , and assembling the remainder integrals into one over gives the stated formula. The bound on follows from (the periodic Bernoulli function attains its extreme value at the integers) applied panel-by-panel.

Corollary (composite error orders and Romberg). Taking recovers the global trapezium error , hence , matching the summed single-interval Peano term of 43.09.01; the composite Simpson error is . Because the trapezium expansion contains only even powers , one Richardson step on and eliminates the term: , which is exactly composite Simpson, and iterating eliminates in turn — the Romberg table.

Bridge. The Euler-Maclaurin formula is the foundational reason the trapezium rule's error is not a single mean-value term but a structured series in even powers of with endpoint-derivative coefficients: the interior contributions telescope away, leaving only what happens at and . This is exactly the integrated and summed form of the single-interval Peano error of 43.09.01, whose leading constant becomes the coefficient here once the local errors are added. The result builds toward two distinct payoffs and appears again in 43.09.03, where the same exactness-versus-smoothness exchange reappears as the degree- accuracy of Gauss rules. The central insight is that an error expansion in known powers of is precisely what Richardson extrapolation needs: the even-power structure is the foundational reason the Romberg denominators are and not , and this is exactly why one trapezium-to-Simpson step gains two orders at once. Putting these together, the endpoint-only character of the error generalises into the spectral accuracy of the periodic trapezium rule, where the corrections all cancel and the error is dual to the decay of the integrand's Fourier coefficients.

Exercises Intermediate+

Advanced results Master

The composite rules fix the polynomial-order picture; the master layer turns the Euler-Maclaurin expansion into the precise statement that the trapezoidal rule is the canonical quadrature for analytic periodic integrands, places Romberg integration inside the general theory of Richardson extrapolation, and bounds the asymptotic nature of the expansion.

Theorem 1 (Euler-Maclaurin, full form and the asymptotic remainder). For the composite trapezium rule satisfies with [Davis-Rabinowitz Ch. 4]. The series is generally divergent because , so the coefficients multiply whose derivative factor can grow factorially; the expansion is asymptotic, and for fixed one truncates near the index minimising . The remainder admits the sharp bound , which exhibits the gain per order.

Theorem 2 (spectral accuracy of the trapezoidal rule on periodic integrands). Let be -periodic and , and let be the trapezoidal rule on equal panels over one period. Then every Euler-Maclaurin endpoint correction vanishes, , so for every . If extends analytically to the strip , the error decays geometrically, [Trefethen-Weideman 2014]. Equivalently, writing , the trapezoidal rule integrates each Fourier mode exactly except for aliasing, and the error is precisely the sum of aliased modes , whose decay is governed by the analyticity strip. This is the structural reason spectral methods, contour-integral evaluation of special functions, and inversion of Laplace transforms all rest on the trapezoidal rule.

Theorem 3 (Romberg integration and the Richardson tableau). With , the Romberg recurrence produces, in exact arithmetic, for [Davis-Rabinowitz Ch. 4]. Each column is a polynomial extrapolation of the trapezium estimates to step along the variable , exact for the truncated even-power model; the first column is composite Simpson, the second is composite Boole's rule, and the diagonal converges superalgebraically for analytic . The construction is the quadrature instance of the general Richardson extrapolation principle: given any quantity with known exponents , the Neville-type tableau with denominators removes the terms in order, and the even-power of the trapezium rule specialises this to .

Theorem 4 (adaptive quadrature: local estimation and refinement). Adaptive schemes estimate the local error on a subinterval by comparing a base rule with a higher-order or subdivided rule : the difference estimates the error of the cruder rule by Richardson's principle, and the interval is accepted when (tolerance apportioned by length) and bisected otherwise, recursing on the halves [Davis-Rabinowitz Ch. 6]. For composite Simpson the standard estimate uses against at the midpoint , giving the error estimate from the model; the factor is the Richardson denominator at order four. The scheme concentrates nodes where is large, achieving a target accuracy with far fewer evaluations than a uniform grid when has localised features, at the cost of error estimates that can mislead on integrands rougher than the rule's model assumes.

Synthesis. The Euler-Maclaurin formula is the foundational reason quadrature on a partition is governed by a single structured object: the composite trapezium error is an asymptotic series in even powers of whose coefficients are Bernoulli numbers times endpoint-derivative jumps, all interior contributions telescoped away. The central insight is that this even-power, endpoint-only structure is the source of three phenomena at once: the leading error is with the same constant that the single-interval Peano kernel of 43.09.01 produces; the rule is spectrally accurate on periodic integrands, where the endpoint jumps vanish and the error collapses to the aliased Fourier tail; and Richardson extrapolation with denominators removes the error two orders at a time, the Romberg table. This is exactly the exactness-versus-smoothness exchange of the chapter, dual to the Peano-kernel error of 43.09.01 and to the degree- accuracy that Gauss quadrature buys in 43.09.03 by abandoning equispacing. Putting these together, the periodic trapezoidal rule's geometric convergence and the Romberg diagonal's superalgebraic convergence are one statement read at two resolutions: once smoothness removes the algebraic error terms, the residual is controlled by complex-analytic data — the strip of analyticity, the Fourier decay — not by any finite power of . The bridge from the local single-panel error to this global spectral picture is the integration-by-parts against the Bernoulli polynomials, which generalises the single mean value theorem of the Peano analysis into a full asymptotic ladder.

Full proof set Master

Proposition 1 (composite trapezium global error). For and , for some .

Proof. On subinterval the single-interval trapezium error of 43.09.01 is for some , since the trapezium Peano kernel is one-signed. Summing over and using that the composite rule is the sum of the panel rules, . The quantity lies in , and is continuous, so by the intermediate value theorem there is with . Thus , i.e. after the sign convention; the displayed form reflects minus the integral.

Proposition 2 (one-panel Euler-Maclaurin identity). For , .

Proof. By induction on . Base is the single integration by parts: with , , and on , giving the claim with empty sum and remainder index after one more step. For the inductive step, take the remainder integral and integrate by parts twice using . The first parts step, with , produces a boundary term which vanishes since , and an integral . The second parts step, with , produces the boundary term , using , plus the next remainder . Thus each pair of integrations adds one Bernoulli term and advances the remainder index by two; after such advances the stated identity holds.

Proposition 3 (Euler-Maclaurin on by panel summation). The composite-rule formula of the Key theorem holds, with the interior endpoint corrections telescoping to the global endpoints.

Proof. Rescale panel by , so with and . Proposition 2 on gives . Multiply by and sum over : the left side becomes , the Bernoulli sums telescope because from panel cancels from panel , leaving only , and the remainder integrals assemble into the single integral over with the -periodic . The bound follows from for the even periodic Bernoulli function.

Proposition 4 (Richardson extrapolation removes the leading order). If with known, then ; for the factor is , and iterating gives the Romberg recurrence.

Proof. Compute . Subtract : the terms give , and the term gives . Hence , and dividing by yields . For the trapezium expansion , , the denominator is , and the same step applied to the column- entries (whose leading exponent is , so ) gives the denominator , the Romberg recurrence.

Proposition 5 (periodic spectral accuracy via aliasing). For smooth and -periodic with Fourier series , the -point trapezoidal rule satisfies .

Proof. By linearity it suffices to evaluate on a single mode . Then , a geometric sum equal to when (every term is ) and otherwise (the -th roots of unity sum to zero). Meanwhile if and otherwise. Subtracting, equals exactly when and , and otherwise. Summing against the Fourier coefficients, . If is analytic in the strip then , so the aliased tail starting at is bounded by a geometric series with ratio , giving . This is the geometric (spectral) convergence; the Euler-Maclaurin endpoint corrections vanish precisely because periodicity forces every to match at the period ends, consistent with this aliasing computation.

Connections Master

  • The composite trapezium and Simpson rules of this unit are the summed forms of the single-interval Newton-Cotes rules of 43.09.01: the global and errors are obtained by adding the one-signed Peano-kernel errors across the partition, and the Euler-Maclaurin leading coefficient is exactly the single-interval error constant computed there; the positivity of all composite weights is the stability that the negative-weight high-order rules of that unit lack.

  • Gauss quadrature in 43.09.03 is the alternative response to the same accuracy demand this unit meets by subdivision: where the composite strategy fixes the order at or and shrinks to drive the Euler-Maclaurin error down, the Gauss strategy keeps a single interval and raises the degree of exactness to by placing nodes at orthogonal-polynomial roots, so the chapter's two repairs of the Peano-kernel ceiling appear side by side, both governed by the exactness-versus-smoothness exchange visible in the even-power error structure here.

  • The Romberg construction is the quadrature instance of Richardson extrapolation, the same acceleration principle that produces high-order finite-difference stencils and the deferred-correction methods used for stiff ordinary differential equations; the requirement that the underlying expansion run in known powers of , satisfied here by the even-power Euler-Maclaurin series, is exactly the hypothesis those methods need, linking this unit to the convergence-acceleration toolkit used throughout numerical analysis.

  • The spectral accuracy of the periodic trapezoidal rule is the foundation of Fourier spectral methods and the discretised Cauchy/contour-integral evaluation of analytic functions; the aliasing identity is the quadrature face of the discrete-Fourier-transform sampling theorem, tying this unit to harmonic analysis and to the analytic-function-theory machinery that controls Fourier-coefficient decay through the strip of analyticity.

  • The integration-by-parts ladder against the Bernoulli polynomials that proves Euler-Maclaurin is the same mechanism by which the Bernoulli numbers enter the values of the Riemann zeta function and the asymptotics of factorials through Stirling's series; the Euler-Maclaurin formula was Euler's original tool for both summing slowly convergent series and evaluating , connecting this numerical unit to analytic number theory and the theory of asymptotic expansions.

Historical & philosophical context Master

The summation formula was found independently by Leonhard Euler, who announced it in a 1738 paper in the Commentarii of the Saint Petersburg Academy as a general method for summing slowly convergent series, and by Colin Maclaurin, who gave it in his Treatise of Fluxions (1742) within the fluxional calculus [Euler 1738]. Euler used it to compute the constant now bearing the name of Lorenzo Mascheroni and to evaluate to many digits before he found the closed form . The systematic appearance of the Bernoulli numbers, introduced by Jacob Bernoulli in the Ars Conjectandi (posthumous, 1713) for sums of powers, as the coefficients of the expansion, and the recognition that the resulting series is asymptotic rather than convergent, were clarified through the eighteenth and nineteenth centuries; the integral remainder in terms of the periodic Bernoulli functions is the modern rigorous form.

Romberg integration was introduced by Werner Romberg in a 1955 note, Vereinfachte numerische Integration, in the proceedings of the Norwegian academy, recasting the centuries-old Euler-Maclaurin expansion as a practical extrapolation tableau; its convergence was analysed by Friedrich Bauer, Heinz Rutishauser, and Eduard Stiefel shortly after, placing it within the general Richardson-extrapolation framework that Lewis Fry Richardson had proposed in 1911 under the name "the deferred approach to the limit." The spectral accuracy of the trapezoidal rule on periodic and analytic integrands, long known to the contour-integration community, was surveyed and sharpened by Lloyd N. Trefethen and J. A. C. Weideman in 2014, who collected the geometric-convergence estimates and their applications to special-function computation [Trefethen-Weideman 2014]. Adaptive quadrature, comparing a rule against its refinement to drive recursive subdivision, became standard with the automatic-integration routines of the 1960s and 1970s, notably those of Robert Piessens and collaborators in the QUADPACK library.

Bibliography Master

@book{sulimayers2003,
  author    = {S\"{u}li, Endre and Mayers, David F.},
  title     = {An Introduction to Numerical Analysis},
  publisher = {Cambridge University Press},
  year      = {2003}
}

@book{davisrabinowitz1984,
  author    = {Davis, Philip J. and Rabinowitz, Philip},
  title     = {Methods of Numerical Integration},
  edition   = {2},
  publisher = {Academic Press},
  year      = {1984}
}

@article{trefethenweideman2014,
  author  = {Trefethen, Lloyd N. and Weideman, J. A. C.},
  title   = {The Exponentially Convergent Trapezoidal Rule},
  journal = {SIAM Review},
  volume  = {56},
  number  = {3},
  year    = {2014},
  pages   = {385--458}
}

@article{romberg1955,
  author  = {Romberg, Werner},
  title   = {Vereinfachte numerische Integration},
  journal = {Det Kongelige Norske Videnskabers Selskabs Forhandlinger},
  volume  = {28},
  year    = {1955},
  pages   = {30--36}
}

@book{henrici1977,
  author    = {Henrici, Peter},
  title     = {Applied and Computational Complex Analysis, Volume 2},
  publisher = {Wiley},
  year      = {1977}
}

@article{euler1738,
  author  = {Euler, Leonhard},
  title   = {Methodus generalis summandi progressiones},
  journal = {Commentarii Academiae Scientiarum Petropolitanae},
  volume  = {6},
  year    = {1738},
  pages   = {68--97}
}

@book{bernoulli1713,
  author    = {Bernoulli, Jacob},
  title     = {Ars Conjectandi},
  publisher = {Thurnisius, Basel},
  year      = {1713}
}