Numerical integration is a standard topic in first-semester calculus. From time to time, I have received questions from students on various aspects of this topic, including:
- Why is numerical integration necessary in the first place?
- Where do these formulas come from (especially Simpson’s Rule)?
- How can I do all of these formulas quickly?
- Is there a reason why the Midpoint Rule is better than the Trapezoid Rule?
- Is there a reason why both the Midpoint Rule and the Trapezoid Rule converge quadratically?
- Is there a reason why Simpson’s Rule converges like the fourth power of the number of subintervals?
In this series, I hope to answer these questions. While these are standard questions in a introductory college course in numerical analysis, and full and rigorous proofs can be found on Wikipedia and Mathworld, I will approach these questions from the point of view of a bright student who is currently enrolled in calculus and hasn’t yet taken real analysis or numerical analysis.
In this post, we will perform an error analysis for the right-endpoint rule
where is the number of subintervals and is the width of each subinterval, so that .
As noted above, a true exploration of error analysis requires the generalized mean-value theorem, which perhaps a bit much for a talented high school student learning about this technique for the first time. That said, the ideas behind the proof are accessible to high school students, using only ideas from the secondary curriculum, if we restrict our attention to the special case , where is a positive integer.
For this special case, the true area under the curve $f(x) = x^k$ on the subinterval will be
In the above, the shorthand can be formally defined, but here we’ll just take it to mean “terms that have a factor of or higher that we’re too lazy to write out.” Since is supposed to be a small number, these terms will be much smaller in magnitude that the terms that have or and thus can be safely ignored.
Using only the right-endpoint of the subinterval, the left-endpoint approximation of is
Subtracting, the error in this approximation will be equal to
Repeating the logic from the previous post in this series, this local error on , which is proportional to , generates a total error on that is proportional to . That is, the right-endpoint rule has an error that is approximately linear in , confirming the numerical observation that we made earlier in this series.