SIMPSON’S RULE fit a parabola through three points and integrate that
To approximate an integral, the trapezoidal rule connects sample points with straight lines; Simpson’s rule fits a parabola through each three points instead, weighting them 1 : 4 : 1. The parabola matches curvature the line misses, so Simpson is exact for any cubic — a spectacular jump in accuracy for one extra weight, and the default quadrature everywhere.
THE TECHNIQUE weights 1:4:1; exact for cubics
Integrate x² on [0,2] (true value 8/3). The trapezoid’s straight line overshoots; Simpson’s parabola nails it exactly. Compare both against the truth: live demo
HISTORY & CREDIT Kepler 1615, Newton before Simpson 1743
“Simpson invented Simpson’s rule.” — no. Kepler used it to gauge wine barrels in 1615 (the “barrel rule”), and Gregory and Newton had it decades before Thomas Simpson’s 1743 text. Simpson himself credited Newton; the name is another Stigler’s-law accident. cited
1615 · Johannes Kepler — the parabola rule for volumes (Nova stereometria doliorum, the wine-barrel measure). 1668 / 1670s · James Gregory & Isaac Newton — the rule in its calculus form, well before Simpson. 1743 · Thomas Simpson — publishes it in “Mathematical Dissertations”; his popular texts attached his name (he credited Newton).
The surprise is the extra order: Simpson fits a degree-2 parabola yet integrates degree-3 exactly, because the odd-cubic error cancels over the symmetric interval — two orders of accuracy for one interior point. Kepler 1615 / Newton
RECOMMEND FOR I-13 exact for x-squared, computed
Trapezoid and Simpson both run on the canonical compiler; Simpson is exact:
$ i13 run simpson.i13 # integral of x^2 on [0,2], true = 8/3 = 2.6666...
trap = 3 -- (h/2)(f0 + 2f1 + f2): the straight line overshoots
simp = 2.6666666666666665 -- (h/3)(f0 + 4f1 + f2): the parabola is exact
Recommend: Simpson’s rule is LIT and the quadrature to give I-13 — verified that for ∫₀² x² the trapezoid gives 3 but Simpson gives 2.6667 = 8/3 exactly, by the weighted sum (h/3)(f₀ + 4f₁ + f₂) in native f64. It is the natural partner to Horner (167, evaluate the integrand) and the transcendental library, and the composite form (many panels) is one bounded recursion over a sample array. For any I-13 that needs an area, an average, or an expected value, this is the default.