The formula
The basic rule over one panel [a, b]:
∫ₐᵇ f(x) dx ≈ (b−a)/6 · [ f(a) + 4·f((a+b)/2) + f(b) ]
Reading: weight the midpoint four times as heavily as the endpoints, then scale by a sixth of the width. That is exactly the area under the parabola through those three points.
The composite rule — the one you actually type into a spreadsheet — for n even intervals of width h = (b−a)/n:
∫ₐᵇ f(x) dx ≈ (h/3) · [ f₀ + 4f₁ + 2f₂ + 4f₃ + 2f₄ + … + 2f_{n−2} + 4f_{n−1} + f_n ]
Reading: ends get weight 1, odd-index samples get 4, even-index interior samples get 2. The 4s are panel midpoints; the 2s are shared panel edges counted once from each side.
The error for the composite rule:
E = −(b−a)·h⁴/180 · f⁗(ξ) for some ξ in [a, b]
Reading: fourth-order accurate. Halve the sample spacing and the error drops by a factor of 16 — the trapezoid rule only buys a factor of 4 for the same effort. The single-panel version is E = −h⁵/90 · f⁗(ξ) with h the half-width.
The 3/8 variant, for patching a leftover odd panel count:
∫ f(x) dx ≈ (3h/8) · [ f₀ + 3f₁ + 3f₂ + f₃ ], E = −3h⁵/80 · f⁗(ξ)
Reading: a cubic fit through four points covering three intervals. Same fourth-order behavior, slightly worse constant. Its job is the end of a record whose interval count didn't come out even.
Where you meet it
Total impulse off a thrust trace. The stand's DAQ hands you thrust versus time at a fixed sample rate — evenly spaced by construction, which is the one thing Simpson's rule requires and Gaussian quadrature can't use. Summing F·Δt trapezoid-style works; the 1-4-2-4 weighting gets you a cleaner total-impulse number from the identical CSV, and total impulse divided by propellant weight is your delivered Isp.
RMS and energy numbers from a scope export. True RMS is √( (1/T)·∫ v² dt ), and energy under a power trace is another integral. When the capture is already on disk and the question is "what did that transient actually deposit into the load," Simpson on the squared samples is the two-minute answer that survives review.
Volume from station cross-sections. Naval architects run displacement, lifeboat volume, and stability calculations from evenly spaced sectional areas with these exact weights — in that trade the method is literally taught as "Simpson's rules," and deck officers still use it to show a GZ righting-arm curve meets IMO stability criteria [8]. The same move prices a tank, a hull, or a fairing: sample the cross-sectional area at even stations, Simpson down the axis.
The review board checking somebody's integrated data. When a briefing chart shows a number that came from integrating test data, the first two questions are "what rule" and "what sample spacing." The h⁴ scaling hands you a free error estimate and a convergence check in one move:
I_h = Simpson result using every sample (spacing h)
I_2h = Simpson result using every other sample (spacing 2h)
error in I_h ≈ (I_h − I_2h) / 15
Reading: because halving the spacing cuts the error 16-fold, the gap between the coarse and fine answers is about 15 times the fine answer's remaining error. If that estimate is small against your requirement, the integral is converged; if the two answers disagree badly, something other than truncation error — noise, a kink, uneven spacing — is driving the result.
How it works
The trapezoid rule connects sample points with chords and pays for it wherever the curve bends — it systematically undercuts every concave-down stretch. Simpson's rule fits a parabola through each triple of points, so it captures curvature instead of ignoring it. Then comes the free lunch: because the middle sample sits exactly halfway, the cubic component of the error cancels by symmetry, and a rule built from parabolas integrates every cubic polynomial exactly [1][7]. You paid for degree-2 accuracy and got degree-3.
The payoff in numbers, all checked directly: integrating sin(x) over [0, π] (true value 2) with 10 intervals, the trapezoid rule misses by 1.6·10⁻², Simpson by 1.1·10⁻⁴ — about 150 times closer from the same eleven samples. The trapezoid rule needs 124 intervals to match what Simpson did with 10. Doubling Simpson's intervals from 10 to 20 shrinks the error from 1.1·10⁻⁴ to 6.8·10⁻⁶, a factor of 16.1 — the h⁴ contract, holding on the nose.
The bookkeeping requirements are rigid and they bite. The composite rule needs an even number of intervals (an odd number of samples) and uniform spacing. A 1,000-sample record has 999 intervals — odd — so the standard fix is the 3/8 rule on the last three intervals and 1/3 rule on the rest. Feeding unevenly spaced data through the standard weights doesn't degrade gracefully; it just produces a wrong number.
The fine print is the fourth derivative sitting in the error term. Simpson's rule only delivers fourth-order convergence while f⁗ stays bounded. Integrate √x on [0, 1] and watch the contract void: errors of 2.6·10⁻³ at 10 intervals, 8.1·10⁻⁵ at 100, 2.6·10⁻⁶ at 1,000 — converging like n^1.5, not n⁴, because every derivative blows up at zero. Real test data has the same problem at kinks: an ignition spike, a relay closing, a range change mid-record. Fitting a parabola across a corner is a modeling error, not a resolution error, and more samples won't fix it. Split the integral at the event and Simpson each smooth piece.
The mistake people make is treating Simpson as the unconditional upgrade. It isn't, and the counterexample matters to anyone integrating over a full cycle: for a smooth periodic function integrated over its exact period, the plain trapezoid rule is spectacularly accurate — the endpoint errors cancel around the loop — and Simpson's alternating weights break that cancellation. Integrating e^{cos x} over [0, 2π] with 8 intervals, the trapezoid rule lands within 1.3·10⁻⁶; Simpson misses by 1.1·10⁻², ten thousand times worse. At 16 intervals the trapezoid answer sits at machine precision. One cycle of a power waveform, one revolution of an antenna pattern cut: trapezoid, and don't let anyone "improve" it.
When the data is already sampled and sitting in an array, don't hand-roll the weights: scipy.integrate.simpson(y, x=t) applies the composite rule directly to a sample vector, handles the odd-interval-count case for you, and is the standard reach for integrating a stored test record in Python. The adaptive integrators (scipy.integrate.quad, MATLAB's integral) are a different animal — they choose their own evaluation points, which is exactly what you can't do when the test already happened. Simpson's niche is precisely the case where the sample locations were fixed by the DAQ before you showed up.
One more honest limit: Simpson's rule does nothing for measurement noise. The h⁴ term is truncation error; random noise on the samples propagates straight through the weights, and past the point where truncation error drops below the noise floor, refinement buys nothing. Smooth first or accept the floor.
History
The rule is a hundred years older than its name. In 1613, at his own wedding in Linz, Johannes Kepler watched a wine merchant price the barrels by shoving a gauging rod diagonally through the bung-hole — one measurement for barrels of visibly different shapes — and it bothered him enough to work out barrel volumes properly. The result, published in 1615 as Nova stereometria doliorum vinariorum ("New solid geometry of wine barrels"), contains the end-plus-four-times-middle recipe, which is why German texts still call it the Keplersche Fassregel — Kepler's barrel rule [1][5][6]. Bonaventura Cavalieri had a version by 1639, and James Gregory used it after him, decades before Simpson was born [3].
Thomas Simpson came to it from about as far from Kepler's imperial court as English society allowed. Born in 1710 in Leicestershire, a weaver's son who worked the loom himself, he taught himself mathematics, lectured in London coffee houses, and in 1743 landed the mathematics post at the Royal Military Academy, Woolwich; the Royal Society elected him a fellow two years later [2][4]. The rule appears in his Mathematical Dissertations of that same year, 1743 [4]. His textbooks sold well enough that his name stuck to a method he never claimed to have invented [2][3] — the reward, then as now, for writing the book everybody actually reads.
Related tools
- /tools/specific-impulse
- /tools/rms-peak
- /tools/battery-life
- /tools/tank-volume-horizontal
- /tools/tank-volume-vertical
Sources
- https://en.wikipedia.org/wiki/Simpson%27s_rule
- https://mathshistory.st-andrews.ac.uk/Biographies/Simpson/
- https://en.wikipedia.org/wiki/Thomas_Simpson
- https://www.encyclopedia.com/science/dictionaries-thesauruses-pictures-and-press-releases/simpson-thomas
- https://mathshistory.st-andrews.ac.uk/Biographies/Kepler/
- https://old.maa.org/press/periodicals/convergence/kepler-the-volume-of-a-wine-barrel-keplers-nova-stereometria-doliorum-vinariorum
- https://mathworld.wolfram.com/SimpsonsRule.html
- https://en.wikipedia.org/wiki/Simpson%27s_rules_(ship_stability)