TOPICS
Search

Composite Trapezoidal Rule


The composite trapezoidal rule approximates a definite integral by applying the trapezoidal rule on each of n equal subintervals. For h=(b-a)/n and x_j=a+jh, it is

 int_a^bf(x)dx approx h[(f(x_0)+f(x_n))/2+sum_(j=1)^(n-1)f(x_j)].
(1)

If f has a continuous second derivative, then for some xi in (a,b) the error is

 -((b-a)h^2)/(12)f^('')(xi),
(2)

where the error means the exact integral minus its approximation. Thus the method has error O(h^2) as h->0. In big-O notation, this means that the error magnitude is bounded by a constant multiple of h^2 for all sufficiently small positive h.

The Euler-Maclaurin integration formulas give higher-order endpoint corrections to the composite trapezoidal approximation when the required derivatives exist (Milovanović 2017).

For a smooth periodic function, the endpoint-derivative differences in the Euler-Maclaurin integration formulas vanish when integrating over a full period. If the periodic extension is infinitely differentiable, the error decreases faster than every fixed inverse power of n. An analytic periodic extension gives exponential convergence (Luke 1955, Weideman 2002, Trefethen and Weideman 2014). More precisely, for a T-periodic analytic function bounded in magnitude by M in the strip |Im[z]|<a, where T,a>0, put

 T_n=T/nsum_(j=0)^(n-1)f(jT/n).
(3)

Then

 |T_n-int_0^Tf(x)dx|<=(2TM)/(e^(2pian/T)-1).
(4)

For analytic integrands, Javed and Trefethen (2014) give a bound that accounts for both the interior discretization error and the endpoint mismatch. The bound connects the general Euler-Maclaurin integration formulas with exponential convergence in the periodic case.

A change of variables can improve trapezoidal quadrature even for a nonperiodic integrand. Periodizing transformations, such as the Iri-Moriguti-Takasawa transformation, make the transformed endpoint derivatives match, suppressing Euler-Maclaurin correction terms (Laurie 1996; Trefethen and Weideman 2014, §14). Double exponential integration instead transforms a finite interval to the real line and applies a truncated trapezoidal sum to a rapidly decaying integrand. It can handle many integrable endpoint singularities because the Jacobian of the transformation counteracts the singular behavior.

On [0,1], a substitution x=psi(t) replaces the integrand f(x) by f(psi(t))psi^'(t). The Sidi transformation for a positive integer m is

 psi(t)=(int_0^tsin^m(piu)du)/(int_0^1sin^m(piu)du).
(5)

For smooth f, the transformed integrand and its derivatives of orders through m-1 vanish at both endpoints (Sidi 1993). The Sag-Szekeres transformation is

 psi(t)=1/2[1+tanh(c/2[1/(1-t)-1/t])],
(6)

where c>0 and the endpoints are defined by continuity. All positive-order derivatives of psi vanish at the endpoints, so the transformed integrand and all its derivatives vanish there for smooth f (Sag and Szekeres 1964; Sidi 1993).


See also

Composite Simpson's Rule, Double Exponential Integration, Newton-Cotes Formulas, Numerical Integration, Trapezoidal Rule

Explore with Wolfram|Alpha

References

Burden, R. L. and Faires, J. D. Numerical Analysis, 9th ed. Boston, MA: Brooks/Cole, 2011.Iri, M.; Moriguti, S.; and Takasawa, Y. "On a Certain Quadrature Formula." J. Comput. Appl. Math. 17, 3-20, 1987. https://doi.org/10.1016/0377-0427(87)90034-3.Javed, M. and Trefethen, L. N. "A Trapezoidal Rule Error Bound Unifying the Euler-Maclaurin Formula and Geometric Convergence for Periodic Functions." Proc. Roy. Soc. A 470, 20130571, 2014. https://doi.org/10.1098/rspa.2013.0571.Laurie, D. P. "Periodizing Transformations for Numerical Integration." J. Comput. Appl. Math. 66, 337-344, 1996. https://doi.org/10.1016/0377-0427(95)00196-4.Luke, Y. L. "Simple Formulas for the Evaluation of Some Higher Transcendental Functions." J. Math. Phys. 34, 298-307, 1955. https://doi.org/10.1002/sapm1955341298.Milovanović, G. V. "Summation Formulas of Euler-Maclaurin and Abel-Plana: Old and New Results and Applications." In Progress in Approximation Theory and Applicable Complex Analysis: In Memory of Q. I. Rahman (Ed. N. K. Govil, R. Mohapatra, M. A. Qazi, and G. Schmeisser). Cham, Switzerland: Springer, pp. 429-461, 2017. https://doi.org/10.1007/978-3-319-49242-1_20.Mori, M. "On the Superiority of the Trapezoidal Rule for the Integration of Periodic Analytic Functions." Mem. Numer. Math. 1, 11-20, 1974. https://jsiam.org/files/2022/02/MemoirsOfNumericalMathematics-01.pdf.Sag, T. W. and Szekeres, G. "Numerical Evaluation of High-Dimensional Integrals." Math. Comput. 18, 245-253, 1964. https://doi.org/10.1090/S0025-5718-1964-0165689-X.Sidi, A. "A New Variable Transformation for Numerical Integration." In Numerical Integration IV. Basel: Birkhäuser, pp. 359-373, 1993. https://doi.org/10.1007/978-3-0348-6338-4_27.Trefethen, L. N. and Weideman, J. A. C. "The Exponentially Convergent Trapezoidal Rule." SIAM Rev. 56, 385-458, 2014. https://doi.org/10.1137/130932132.Weideman, J. A. C. "Numerical Integration of Periodic Functions: A Few Examples." Amer. Math. Monthly 109, 21-36, 2002. https://doi.org/10.1080/00029890.2002.11919836.

Cite this as:

Weisstein, Eric W. "Composite Trapezoidal Rule." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/CompositeTrapezoidalRule.html

Subject classifications