The Trapezoid and Simpson Rules
Two simple recipes for estimating the area under a curve when you only know its value at a handful of points — replacing the true curve with straight lines or gentle parabolas that are easy to integrate exactly.
Prerequisites: Numerical Stability and Error Analysis
Pricing a European option under a model with no closed-form solution often reduces to computing an integral — the expected payoff, averaged over a probability density. Computers can't integrate symbolically; they can only evaluate a function at specific points and combine those values. The trapezoid and Simpson rules are the two most basic recipes for this: replace the true curve between sample points with something simple enough to integrate exactly — a straight line, or a gentle curve — and add up the areas of those pieces.
An analogy: estimating a field's area from fence posts
Imagine a field with a wavy boundary on one side, and you can only measure the boundary's height at a few evenly-spaced fence posts. The crudest honest estimate connects each pair of adjacent posts with a straight line and adds up the areas of the resulting trapezoids — simple, and reasonable if the boundary doesn't wiggle much between posts. A better estimate fits a smooth, gently curving arc (specifically a parabola) through each group of three consecutive posts instead of a straight line, hugging the true wavy boundary more closely and giving a noticeably better area estimate for the same number of posts measured.
The math, one piece at a time
The trapezoid rule approximates by chopping into equal strips of width , and on each strip approximating with the straight line connecting its two endpoints — turning each strip into an actual trapezoid, whose area has a simple formula:
In words: every interior sample point is counted twice (it's the shared edge of two neighboring trapezoids) and the two endpoints are counted once, all multiplied by half the strip width — this is just "average the two end-heights of each trapezoid, times its width," summed over all strips. The error shrinks proportional to : halving the strip width quarters the error.
Simpson's rule instead fits a parabola through each group of three consecutive points (so it needs an even number of strips), giving a noticeably better formula for the same sample points:
alternating weights of 4 and 2 for interior points, endpoints weighted 1. In plain English: because a parabola can bend to match a curve's curvature, not just its slope, Simpson's rule captures far more shape information per sample point — its error shrinks proportional to , so halving the step size cuts the error by a factor of 16, versus only 4 for the trapezoid rule.
Worked example 1: trapezoid rule by hand
Estimate (true value ) using 4 strips, : sample points at give .
Trapezoid estimate 2.75 versus true value 2.667 — off by about 3.1%, because a straight line always slightly overestimates the area under an upward-curving (convex) function like .
Worked example 2: Simpson's rule on the same problem
Same points, Simpson's rule (weights ):
Simpson's estimate is , matching the true value exactly — because is itself a parabola, and Simpson's rule fits parabolas exactly, it has zero error here regardless of step size. For a function that isn't itself a low-degree polynomial, Simpson's rule won't be exact, but it will still be dramatically more accurate than the trapezoid rule for the same number of evaluated points.
What this means in practice
Trapezoid and Simpson's rules are the entry point to numerical integration used throughout pricing: computing expected payoffs under a known density, integrating a volatility term structure to get total variance, or evaluating any definite integral that arises in a closed-form-adjacent pricing model. In practice, Simpson's rule is almost always preferred over the plain trapezoid rule when the integrand is smooth, since it costs no extra function evaluations but delivers far better accuracy — the trapezoid rule mainly survives as the simplest possible baseline or for integrands with kinks where higher-order methods offer no benefit.
Both rules approximate an integral by replacing the true function with something simple on each small interval and summing the exact areas of those simple pieces — trapezoid uses straight lines (error shrinks like ), Simpson's uses parabolas through triples of points (error shrinks like ), so Simpson's rule is almost always more accurate for the same number of function evaluations.
The classic mistake is applying Simpson's rule (or any smooth-curve-fitting quadrature) to a function with a kink, jump, or singularity inside the integration range — fitting a parabola across a discontinuity produces a worse, not better, local approximation than a straight line would, and the promised error rate silently fails to materialize. Always check the integrand is smooth over each sub-interval, or split the integration range at any known kink, before trusting Simpson's rule's superior convergence rate.
Related concepts
Practice in interviews
Further reading
- Burden & Faires, Numerical Analysis, ch. 4
- Press et al., Numerical Recipes, ch. 4