Most integrals have no antiderivative in elementary functions. The area under is the standard example, and data from an experiment has no formula at all. Yet a definite integral is a limit of sums, so a well chosen finite sum gets close. The rules below are the everyday ones, and the error bounds tell you in advance how close they get.
Key terms
Composite midpoint rule
Definition Let be defined on , let be a positive integer, and for . Let be the midpoint of the th subinterval. The composite midpoint rule is
It is the Riemann sum that samples each subinterval at its midpoint.
In plain words Cut the interval into equal strips and build each rectangle at the height of in the middle of the strip.
Example Approximate
with . Then , the midpoints are , and
with error .
Composite trapezoidal rule
Definition With the same and , the composite trapezoidal rule is
It adds the areas of the trapezoids under the line segments joining consecutive points and , and it equals the average of the left and right Riemann sums.
In plain words Replace the curve on each strip by the straight chord between its endpoints and add up the trapezoids.
Example For the same integral of over with ,
with error about . The midpoint error was about half as large and of the opposite sign, which is typical when does not change sign.
Simpson’s rule and the even-subinterval condition
Definition Let be even, and . Simpson’s rule is
with coefficients . On each pair of subintervals it integrates the parabola through the three points at , , . That is why must be even, since the strips are used two at a time. For every even Simpson’s rule is a weighted average of the trapezoidal and midpoint rules with half as many strips,
In plain words Fit a parabola through every three neighboring points instead of a line through every two. With an odd number of strips one strip has no partner, and the pattern of weights breaks.
Example For the integral of over with , the points are and
with error about , more than thirty times smaller than the trapezoidal error with the same five function values. As a check of the identity,
which is .
To compare the three rules yourself, choose on with in the Riemann sum explorer, then raise and watch the errors shrink.
Derivative-based error bounds
Definition Let and define and the same way. If is continuous on and for all in , then
If is continuous on , for all in , and is even, then
In plain words Doubling cuts the trapezoidal and midpoint errors by about four and Simpson’s error by about sixteen. The bounds also let you pick before computing anything.
Example For on the derivatives satisfy
With the bounds are for , for and for . All three actual errors lie within them. To guarantee an error of at most , the trapezoidal rule needs
Simpson’s rule needs
and since must be even, is enough.
Adaptive subdivision
Definition An adaptive method chooses subintervals of different lengths according to how hard is to integrate on each piece. In adaptive Simpson integration with tolerance on a piece , compute , Simpson’s rule with on , and , the sum of Simpson’s rule with on each half. If
accept for that piece. Otherwise apply the same test to each half with tolerance . The factor comes from the error formula. On one piece the error of Simpson’s rule is proportional to at some point. Write and for the errors of and . If is nearly constant on the piece, halving gives , so
The test therefore asks for . This estimate is a heuristic, not a guaranteed bound, since may change a lot on the piece.
In plain words Do not waste effort where is gentle. Compare a coarse and a finer answer on each piece and split only the pieces where they disagree.
Example Take
where has an unbounded derivative near , so the error bounds above do not apply on . Comparing coarse and split Simpson values on each half gives this.
| Piece | Coarse | Split | Difference | Exact |
|---|---|---|---|---|
The right half is nearly settled after one split, while the left half, which touches , needs many more. An adaptive method keeps splitting near and leaves the right half alone.
Check yourself
- Compute and for and compare with the exact value.
Show the answer
Here , so
The exact value is , so is too big and is too small.
- Show that Simpson’s rule with gives the exact value of .
Show the answer
With ,
and . This agrees with the error bound, since for a cubic.
- How large must be for the midpoint rule to approximate within ?
Show the answer
On we have . You need
which means .