Approximating Definite Integrals
When you can't find an antiderivative, go back to what an integral means, area, and fill it with shapes you can measure: rectangles, trapezoids or little parabolas. The closer the shape hugs the curve, the faster the error shrinks as you add slices.
What the symbols mean
- Width of each slice
(b − a)/n: split [a, b] into n equal pieces.
- Midpoint
The center of the i-th slice, where the rectangle's height is measured.
- Left endpoint
x₀ = a. In general xᵢ = a + iΔx.
- Right endpoint
xₙ = b.
What the symbols mean
- Simpson's weight
Comes from fitting a parabola through each group of three points.
What the symbols mean
- Bound on |f″|
The largest size of the second derivative on [a, b]: how curved the graph is.
- Bound on |f⁽⁴⁾|
The largest size of the fourth derivative on [a, b].
- Number of slices
More slices, smaller error.
Explanation
Numerical integration is simply estimating the area under a curve by filling it with simple shapes whose areas you can compute, then adding them up. It's good for every integral you can't do by hand, like , and for real data where you only have measurements and no formula at all. All we're really saying with a rule like is: (the width of each slice), the (the curve's heights at the slice edges), and the weights (how many shapes share each height). The error bounds look scary, but they just say how fast the estimate improves as you use more slices. It's all area of rectangles, trapezoids and parabolas; bear with it.
Remember where integrals came from: Riemann sums, adding up thin rectangles. Back then, the antiderivative was a shortcut that made the rectangles unnecessary. But when there's no antiderivative, like (one of the integrals from the strategy lesson that can't be done in elementary terms), you go back to adding up shapes. The question now is which shapes give the best answer for the least work.
Split into slices of width , with endpoints .
- Midpoint rule: a rectangle on each slice, as tall as at the slice's midpoint.
- Trapezoid rule: join neighboring points with straight lines. Each interior point is a corner of two trapezoids, so it gets counted twice, and that's where the 2's come from.
- Simpson's rule: fit a parabola through each group of three points. Each parabola covers two slices, so it needs an even , and the weights run .
How good are they? The error bounds tell the story. Doubling divides the midpoint and trapezoid errors by about 4, and Simpson's error by about 16. That makes sense: a straight line can't follow a curve's bend, so its error depends on , while a parabola can bend too, so its error only depends on higher derivatives.
Here's something neat. Midpoint is usually about twice as accurate as trapezoid, with the opposite sign: on a curve that bends up, trapezoids overshoot and midpoint rectangles undershoot. So a weighted average should cancel most of the error, and Simpson's rule is exactly that average, .
A common mistake. It's tempting to think Simpson's rule is only exact for parabolas, since that's what it fits. It's actually exact for cubics too, because the error bound involves , which is zero for a cubic. The first worked example shows it hitting on the nose.
There's an animation further down that shows all three shapes on the same curve.
See it
Worked examples
Approximate with using the midpoint, trapezoid and Simpson rules. (The exact value is 9.)
- 1
. The points are with values .
How accurate is for ?
- 1
The error bound needs , the biggest on the interval. Here , and on its size is at most (at ), so .
Practice
Type your answer and check it. Solve them all to complete the lesson.
Use the trapezoid rule with to approximate .
Use Simpson's rule with to approximate . Give 4 decimals.
Use the midpoint rule with to approximate . Give 4 decimals.
How large must be for Simpson's rule to approximate to within ? (Use on .)
For a smooth function and the same , which is usually the most accurate?
A model rocket motor's thrust is measured every s: newtons at . Use Simpson's rule to estimate its total impulse, .
The hardest one here. Get it, and you've got this lesson.
How many subintervals guarantee that the trapezoid rule approximates to within ? Use the error bound , with .
Where it's used
Your calculator's ∫ button, every physics engine and every GPS receiver integrates numerically. Simpson's rule's cousins, Gaussian quadrature for integrals and Runge–Kutta for differential equations, run inside nearly all scientific software.