Moving the Upper Limit from 1 to 2 Slows Simpson's Rule Down
Published 12/4/2026 · 3 min read · Developer tools
Lena Hoffmann — Science & education writer at OneKitly
Mathematics · Physics
Checked against 2 sources
Integrating 1/(1 + x²) from 0 to 1 with six intervals, Simpson's rule gives 0.785 397 945 against the exact π/4 = 0.785 398 163, an error of 2.2 × 10⁻⁷. The trapezoidal rule on the same six intervals gives 0.784 240 767, an error of 1.2 × 10⁻³ — five thousand times worse for the same number of function evaluations. Doubling the intervals divides the trapezoidal error by exactly 4 every time, as its h² rate predicts, but divides Simpson's by 64 rather than the 16 its h⁴ rate guarantees. The extra factor is not general: it happens because the third derivative of this integrand is zero at both 0 and 1, so the leading error term drops out. Move the upper limit to 2 and the rate settles back to 16.
On [0, 1] the error falls 64-fold each time the interval count doubles; on [0, 2] it falls 16-fold. The difference is that f‴ happens to vanish at both ends of the first interval.
Where the missing term went
The asymptotic error of the composite Simpson rule begins with a term proportional to h⁴ × [f‴(b) − f‴(a)]. For f(x) = 1/(1 + x²) the third derivative works out to 24x(1 − x²)/(1 + x²)⁴, which is zero at x = 0 because of the leading factor and zero at x = 1 because of the bracket. Both endpoints cancel, the h⁴ term disappears, and the next term — h⁶ — takes over, giving the observed factor of 64 per doubling. On [0, 2] the upper endpoint contributes 24 × 2 × (1 − 4)/5⁴ = −0.2304, the term survives, and the rate is the textbook 16.
The error bound is a bound, not a prediction
The classical formula bounds the error by (b − a)h⁴M₄/180, where M₄ is the largest value the fourth derivative takes on the interval. It is a worst case built from a single number, and a worst case is allowed to be loose: here the actual error at six intervals is orders of magnitude below the bound, because the bound knows nothing about the cancellation at the endpoints. Use the bound to decide how many intervals are certainly enough, never to predict how accurate an answer is — for that, halve h and watch how much the answer moves, which measures the error instead of bounding it.
| Intervals | Simpson on [0, 1] | Trapezoid on [0, 1] |
|---|---|---|
| 6 | 2.18 × 10⁻⁷ | 1.16 × 10⁻³ |
| 12 | 3.32 × 10⁻⁹ | 2.89 × 10⁻⁴ |
| 24 | 5.19 × 10⁻¹¹ | 7.23 × 10⁻⁵ |
| Factor per doubling | 64 | 4 |
Frequently asked questions
- Why must the number of intervals be even?
- Because the rule fits one parabola through each group of three consecutive points, which consumes two intervals at a time. An odd count leaves one interval without a partner, and the usual repairs are to switch that last piece to the 3/8 variant, which fits a cubic through four points and consumes three intervals, or to renumber so the count is even. Both are correct; mixing them without saying so is how two people integrating the same function get answers that differ in the eighth decimal.
- Does a huge number of intervals always help?
- No. Beyond a point the arithmetic itself becomes the limit: adding thousands of small numbers to a running total loses low-order bits, and the rounding error grows roughly as the square root of the number of terms while the discretisation error shrinks. The total error therefore has a minimum, and pushing past it makes the answer worse. On this integrand the minimum sits far beyond any interval count you would type in by hand, but on a badly scaled problem it can arrive within a few thousand terms.
Articles you may find interesting
All guides →Related tools
Sources
Spotted a mistake in this article?