Today I have been playing around trying to justify an observation that we made in my Calculus II class, which is as follows:
Observation 1. On a region where has consistent concavity, the error from the trapezoid sum is about twice the error of the midpoint sum, and has the opposite sign. (In fancy symbols:
.)
It’s fairly easy to arrive at this observation by just doing a bunch of calculations. A fun activity for a Calculus II class is to reproduce Table 5.6.5 from Active Calculus; if you divide-and-conquer across a couple different groups, you can do this pretty easily in 15 minutes with appropriate use of technology. Then you just look at the column of errors, and say, gee whiz, Observation 1.
But then a student asked me why this is true. This was surprisingly tricky to run down. I scribbled about it for like three pages, most of which just ended up being, like, “let’s do some calculus now; by talos that was just geometry!!” I think I now have a reasonably convincing justification that I can at least handwave to the student in question, without too much additional technology. (Note that we are at the beginning of Calculus II, so in particular I don’t want to say the words “Taylor series” yet.)
Setup
Observation 2. To be more precise, the trapezoids in the trapezoid rule are trapezoids whose tops are secant lines to .
Observation 3. Midpoint rectangles are actually trapezoids whose tops are tangent to at the midpoint.
Proof by picture. This is Figure 5.6.3 from Active Calculus. For the sake of argument, I’m going to follow this figure throughout; notice that we can assume without loss of generality that the function is concave up. Say that the edges of the rectangles / trapezoids occur at and
.
If you want a little more symbolic convincing, write down the equation for this tangent line: . Compute
and observe that you get the area of the midpoint rectangle.
(Aside: Observation 3 would actually be true no matter what slope you picked for this diagonal line. It’s just convenient to pick the slope of the tangent line.)
Observation 4. The secant lines in question are damn near parallel to the tangent lines in question.
Justification. The slope of this secant line is . This is in fact the central difference approximation to the slope of the tangent line,
.
Observation 5. Therefore, the secant line is pretty much just a vertical shift of the tangent line: if is the secant line and
is the tangent line, then
for some small constant
. Specifically,
would be a good choice; that’s the specific amount we’d need to scoot up by to get the left endpoints to match.
Idea of the proof
With this setup stuff established, I can now say the following, which will give you some idea of what we’re up to with the symbol-pushy stuff below. The idea is that since there’s such a nice relationship between the trapezoid-rule trapezoid and the midpoint-rule trapezoid (they only differ by a little parallelogram!), we probably have a nice relationship between their errors. Meditate upon the following picture (Figure 5.6.4) before proceeding. I’ll just point out that the height of the parallelogram is and the width is
.
Nitty-gritty details
I’m noticing that we haven’t used our “consistent concavity” hypothesis yet. By “consistent concavity” we probably mean that is approximately constant on the big interval of which our little rectangle
is a subinterval.
Observation 6. If has “consistent concavity,” then it’s approximately quadratic.
Proof. Suppose for some constant
. Integrate twice and don’t forget your arbitrary constants:
Okay, but which quadratic? We may as well ask for the linear part of to match the tangent line
:
Soon we will learn the word “Taylor series” and this will seem more natural. For now, think of it as, we’re taking the linear approximation and sticking on some bendiness with a quadratic term
. (The B stands for “bendiness.”)
Observation 7. On this little subinterval, the error from the midpoint rule is .
(Note: that’s the that I’m going to talk about at the very end of this post.)
Algebra time: this is .
Notice, btw, that when the function is concave up, B is positive, so this value works out to be negative, which makes sense, because the midpoint rule should underestimate the true value.
Observation 8. The error from the trapezoid rule is Using Observation 5, this is
. Integrating a constant is easy, and the second integral is the one we just did in Observation 7. So we can conclude that
.
(Looking back at the “idea of the proof” picture, is the area of the parallelogram you have to stack on top of the midpoint-rule trapezoid to get the trapezoid-rule trapezoid. So this makes sense: if you take the whole parallelogram and subtract the pink parts
, you ought to get the red part
. Why does it say + above instead of -, you ask? Good question: because
is negative.)
Guess what: we’re back to where we started!
The prestige
Observation 1, re-stated: .
Proof. Let’s monkey around with this claim a bit. Since (by Observation 8) , this claim is equivalent to claiming that
, or that
. Then by Observation 7,
, so the claim is that
. I’m going to divide out a
on both sides, and pull a 2 inside a parentheses, to arrive at:
Claim that’s equivalent to Observation 1: .
Why is this true, then? Well, what was anyway? That came from Observation 5, where we said that
was the amount by which we’d need to shift
up to get it to match
, and we also said that it’s the amount by which the linear approximation undershoots the actual function.
What’s neat, though, is that we now know a little more about than we did before. Specifically, Observation 6 told us that
.
Therefore, . Plug in
: the LHS is
and the RHS is exactly what we thought it should be.
The moral of the story
Let’s return to Figure 5.6.4 and we can tell a more interesting story now:
- Zooming in on the tangent line and the blue curve
: This last claim is basically saying that the amount by which the tangent line undershoots the function is controlled by (1) the bendiness of the function and (2) the width of the (sub)interval we’re looking at.
- Notice also that the only reason this problem is interesting is that the blue line is curved. If it just went straight from the left corner to the middle and then straight from the middle to the right corner, then it’d cut the parallelogram into two equal pieces. Instead, because it bends down, there’s more red than pink.
- Because the blue line is basically quadratic, it turns out that there’s basically half as much pink as there is red. If the function was allowed to wiggle as well as bend, then that ratio may not turn out to be so nice.
- Specifically, the blue line cuts the trapezoid in such a way that the pink is 1/3 of the total. Where does that 3 come from? It comes precisely from integrating
.