Midpoint and Trapezoidal Rules
Two ways to approximate an integral that beat an endpoint sum, worked on one integral, with the concavity rule for which way each estimate errs.
The two lessons before this one computed integrals exactly, as limits of Riemann sums. Most integrals do not yield to that. Many functions in an applied problem arrive as a table of measurements with no formula, so an approximation is all there is.
Both rules below are as cheap to compute as an endpoint sum and much more accurate. The first is a Riemann sum with a particular choice of sample point. The second gives up rectangles altogether.
The Midpoint Rule
Take the height of each rectangle at the midpoint of its subinterval rather than at an end.
It is a Riemann sum like any other, so the definition of the definite integral already covers it.
A midpoint estimate
Approximate the integral of from to using four subintervals.
The width is , so the subintervals are , , and , and their midpoints are , , and .
Each height is the reciprocal of its midpoint, so
The exact value of this integral is , which the Fundamental Theorem of Calculus will produce later in this unit. The estimate is low by about . Each rectangle crosses the curve, and gives up more on the left of its midpoint than it gains on the right.
The Trapezoidal Rule
A rectangle has a flat top, and the curve above it does not. Joining the two endpoint heights by a straight segment follows the curve far more closely, and turns each subinterval's region into a trapezoid.
A trapezoid lying on its side, with parallel sides and a distance apart, has area
Now add the of them. Every interior height belongs to two trapezoids, once as a right end and once as a left end. It therefore arrives with a coefficient of , while the two outer heights keep a coefficient of :
The coefficients are . Counting them is the usual place to drop a point: there are heights for subintervals.
The same integral, by trapezoids
The five partition points are , , , and , with heights , , , and . Here , so
So the two rules straddle the answer: sits below , and sits above it. That is not an accident of this integral.
Which way each estimate errs
The chord of a concave-up arc lies above the arc, so every trapezoid overshoots and comes out too big.
The midpoint case needs one more step. Tilt the rectangle's flat top about the midpoint. That adds on one side exactly what it removes on the other. The rectangle therefore has the same area as the trapezoid capped by the tangent line at that point. A tangent to a concave-up arc lies below it, so comes out too small.
Our example is the first case. is concave up on , and the midpoint estimate came in low, the trapezoid estimate high. A concave-down curve flips both pictures: chord below, tangent above.
One more thing the numbers show. The midpoint estimate missed by about , the trapezoid estimate by about . The midpoint error is roughly half the size and falls on the other side of the answer, and that holds for smooth functions generally. The cruder-looking rule is the better one.
Equal widths, and when there are none
The Trapezoidal Rule's tidy pattern comes from every subinterval having the same width, so the common factor can be pulled out front. An AP question supplying a table of measured values usually spaces them unevenly, and then the rule does not apply.
Compute each trapezoid's area on its own width and add them up. The rule was only a shortcut for doing exactly that.
The same goes for the whole construction. Equal widths have been a convenience all along. They were never a requirement. For an integrable function the limit does not depend on the partition or on the sample points. Left, right, midpoint and trapezoid all arrive at one number.