Calculate Simpson’s rule error bound from K, a, b, and n, or find the minimum even n needed to keep the error below a target value for a given interval.
- All Math and Numbers Calculators
- Relative Error Calculator
- Control Limit Calculator
- Class Width Calculator
Calculator Functions
| Function | What it does | What it requires |
|---|---|---|
| Error bound from n | Finds the largest possible error of composite Simpson's rule for a chosen number of subintervals | Requires the lower bound a, the upper bound b, the fourth-derivative bound K and an even number of subintervals n |
| Minimum even n for a tolerance | Finds the smallest even number of subintervals that keeps the error bound within a tolerance | Requires the lower bound a, the upper bound b, the fourth-derivative bound K and the maximum allowed error |
K, also written M, is any number at least as large as |f⁽⁴⁾(x)| everywhere on [a, b]. It has to be worked out from the function first, because the calculator does not take the function itself and cannot check K. Results are computed with exact fractions, and the bound is rounded upward to 10 significant digits so that it never understates the error.
Simpson's Rule Error Bound Formulas
| ES | Error of the composite Simpson's rule approximation |
| K | Upper bound on |f⁽⁴⁾(x)| for a ≤ x ≤ b |
| a, b | Lower and upper limits of the integral |
| n | Number of subintervals, which must be even |
The error of composite Simpson's rule with step h = (b − a) ÷ n is −(b − a) ÷ 180 × h⁴ × f⁽⁴⁾(ξ) for some point ξ between a and b [1]. The point ξ is unknown, so the bound replaces f⁽⁴⁾(ξ) with K, the largest size it could have.
Error bound from n
For a = 1, b = 4, K = 3 and n = 8, the bound is 3 × 3⁵ ÷ (180 × 8⁴) = 729 ÷ 737,280 = 0.00098876953125, shown as ≤ 0.0009887695313 with a step of 0.375. With n = 6 the bound is 0.003125. Doubling n divides the bound by 16. An odd n is rejected, because Simpson's rule pairs the subintervals.
Minimum even n for a tolerance
E is the maximum allowed error. For a = 1, b = 4, K = 3 and E = 0.001, the right side is (729 ÷ 0.18)1/4 = 7.98, so the smallest even n is 8, where the bound is 0.00098877. For a = 0, b = 1, K = 12 and E = 0.000001 the right side is 16.07, and the next even number is 18. The calculator tests the bound at even values of n directly, so the answer is never one step too small from rounding.
Limits of This Estimate
- The bound holds only when f has a continuous fourth derivative on [a, b] [1] and K really is an upper bound for it. A K that is too small gives a bound the true error can exceed.
- It is a worst case. The actual error of Simpson's rule is usually smaller, and it is exactly zero for polynomials up to degree 3, where the fourth derivative is zero.
- Only the error of the method is covered. Rounding error from adding many function values in floating point is separate.
Sources
- NIST Digital Library of Mathematical Functions, §3.5 Quadrature: composite Simpson's rule and its error term
