For a quant, this turns an integral for an expected payoff, probability or accumulated cash flow into a finite set of function evaluations. Refining the partition can reduce integration error without changing the financial model. It cannot correct a misspecified density or missing payoff feature.
What gets added
Take , choose equal subintervals and set
The composite trapezoid rule integrates the straight line connecting each pair of neighbouring values:
Interior nodes have full weight because they belong to two neighbouring trapezoids; each endpoint belongs to only one. The composite midpoint rule instead samples once in the middle of each subinterval:
Here counts subintervals, so Simpson uses quadratic pieces and sampled nodes. The three formulas require different samples and weights. Endpoint data alone do not supply the midpoint values, and these equal-spacing weights should not be copied onto an irregular grid.
Four subintervals, three answers
Use the dimensionless benchmark on . Its exact integral is . One financial reading is the second moment of a synthetic uniform risk factor on , whose density is one on that interval. This is a mathematical benchmark, not a fitted return distribution.
For , and the endpoint samples are . The midpoint samples are taken at .
| Rule | Approximation | Signed error |
|---|---|---|
| Trapezoid | ||
| Midpoint | ||
| Simpson |
Simpson's exact answer here does not mean that every composite approximation is exact, or that Simpson is exact for arbitrary smooth functions. On an equally spaced grid with even , it integrates every polynomial through degree three exactly. Trapezoid and midpoint are exact for affine functions.
More pieces improve resolution, not the rule's order
For this quadratic, a single trapezoid of width overestimates its local integral by . Summing such errors gives on . Thus the local cubic error becomes a global quadratic error as the number of pieces grows.
Doubling from four to eight reduces the trapezoid error from to , and the midpoint error magnitude from to . Both fall by a factor of four. Composition has reduced the size of the errors while retaining second-order convergence.
More generally, on a fixed finite interval with a continuous second derivative, trapezoid and midpoint errors are . Simpson's error is when the fourth derivative is continuous. In a regime where a nonzero leading error term dominates, halving gives error ratios approaching four or sixteen respectively. Exactness, cancellation, kinks and numerical rounding can change those observed ratios. A midpoint estimate is not guaranteed to beat a trapezoid estimate for every smooth function.
When pricing a payoff with a known kink, placing a partition boundary at the kink can be more useful than assuming a smooth-function error formula applies across it. For an unbounded integral, error from truncating the domain is another calculation: adding panels inside a fixed window does not account for omitted tails.
Finally, preserve units. If is a discounted cash-flow rate in USD/year and is in years, every weighted contribution and the final sum are in USD. Signed rates must retain their signs; taking absolute areas changes the integral.
Sources
- James Stewart, Single Variable Calculus: Early Transcendentals, 6th edition, Thomson Brooks/Cole, 2008, §7.7, “Approximate Integration”: composite formulas and derivative-based error bounds.
- Tobin A. Driscoll and Richard J. Braun, Fundamentals of Numerical Computation, §5.6, “Numerical integration”: weighted samples, piecewise interpolation and global trapezoid convergence.
- SciPy, scipy.integrate.simpson: composite Simpson integration and polynomial exactness under equal and unequal spacing.