TITLE: How do we know the Riemann Sum gives us the area under the curve?
QUESTION [34 upvotes]: I'm currently learning calculus (high school senior), and I am not comfortable with the idea that the limit of the sums of rectangles actually converges to the area under the curve. I know it looks like it does, but how do we know for sure?  Couldn't the tiny errors beneath/over the curve accumulate as we add more and more rectangles? What's troubling me is the whole Pi = 4 thing with the staircase approximating a circle pointwise, and how it's wrong and the perimeter of the staircase shape does not approach the circumference of the circle, even though pointwise it does approach a circle. So how are the increasingly many, increasingly small errors in Riemann sums any different? How do we know the error in each step decreases faster than the number of errors increases? I would really like to see a proof of this.
Thanks so much!

REPLY [4 votes]: I think that Bernard made a good point in the comments under your question. So let me compile that into a short answer.
The trick is in working not with one, but with two slightly different Riemann sums - the lower and the upper Riemann sum. Consider the following figure:

I think we can agree that the lower Riemann sum $\check\Sigma$ (in the left figure) underestimates the actual area under the curve, and that the upper Riemann sum $\hat \Sigma$ (in the right figure) overestimates the actual area under the curve.
So we can agree that the actual area $A$ under the curve is somwhere between these sums:
$$\check\Sigma\le A\le \hat\Sigma.$$
Now, if we make the Riemann sum finer and finer (adding more rectangles, and making them thinner), the hope is that the lower and upper value come closer and closer to each other, and converge to a common value.
If that would be the case, we could agree that this common value must be $A$, as $A$ was at all times trapped between these both sums.
So how do we know that the lower and the upper Riemann sum converge to the same value?
The answer is: we don't! They do, in general, not converge to the same value! But they do for some functions, and these functions are then called Riemann integrable.
These are the functions for which the Riemann sum is a valid tool to compute the area under the curve.
So the problem was now shifted to the question: "which functions are Riemann integrable?".
And this is indeed a non-trivial question. Luckily, most functions that appear in everyday applications are in fact Riemann integrable. For example, continuous functions (on bounded intervals) or monotone functions are Riemann integrable, and one can prove this rigorously. This is usually done in an introductory analysis course for mathematicians.
If you are interested in a proof: Wikipedia contains a proof of the fact that a functions is Riemann integrable (on a compact interval) if and only if it is continuous almost everywhere.