Riemann integration: from rectangle sums to the area under a curve
Walk at 2 metres per second for 3 seconds and you cover metres. Put time on the horizontal axis and speed on the vertical axis. The multiplication now has a picture: a rectangle of width 3 and height 2. Its numerical area is the distance we just calculated.
But suppose you keep speeding up. Which speed should we multiply by the time? Using the starting speed misses the later increase. Using the final speed treats the whole walk as though it were that fast. Multiplication still works; the difficulty is that one height no longer describes the whole interval. Let us divide the time into shorter intervals. We can use one speed to estimate each part, calculate its rectangle, and add the areas.
This is not exact yet. The gaps between the rectangles and the curve let us see what our estimate misses. Make the intervals narrower and compare both the gaps and the total. Function graphs show the changing speed, and limits let us ask what this process approaches. If you have read the derivative page, recall its direction: position changes gave us velocity. Here, knowing how fast we move helps us build up the distance travelled.
01How much area lies beneath a curve?
Start with , the x-axis and the boundaries and . The teal region is the area we want. The gold rectangles are an approximation, not the answer. Click a strip to inspect it, or use the strip selector.
1. Divide the width
Split the total width into equal pieces. The Greek letter means a change or interval width.
2. Choose a height
Pick a point in strip i. The curve’s height at that point becomes the rectangle’s height.
3. Add the pieces
means “add all these terms”. This finite sum is called a Riemann sum.
02Same width. Three ways to choose the height.
Compare the same curve using eight rectangles. A sampling point must lie in its own strip. Play the guide to highlight left, midpoint and right sampling in turn; the three results stay visible for comparison.
Left endpoint ●
Midpoint
Right endpoint
03What if the maximum width tends to zero?
For these continuous functions, all three sampling choices approach the same limit as the equal-width strips become arbitrarily thin. We call that limit the definite integral and write it as . The symbol is an elongated S for summation, and mark the two ends of the interval, and says we accumulate along x. The animation stops at 256 rectangles; it illustrates convergence and does not literally reach infinity.
What does the stretched S mean?
An elongated S for summation. It denotes the limiting accumulation, not a new area formula unrelated to rectangles.
Where do the bounds and the height come from?
and are the lower and upper bounds on . supplies the signed height. When throughout, the integral is the geometric area between the curve and the x-axis.
What does dx tell us?
identifies as the integration variable. In this construction it comes from strip widths tending to zero; we never set every finite rectangle’s width equal to zero.
See an exact limit for on [0, 3]
We want the exact area, beyond the last frame of the animation. Divide the interval from 0 to 3 into n equal strips. Their width is . The right edge of strip i is i widths from zero, so . Its height is the square of that input. Multiplying height by width and adding gives:
The symbol asks us to add one term for every integer from 1 to . We still need the sum of squares; merely naming a formula would leave the calculation unfinished. First add the integers in forward and reverse order. Each of the pairs is , and every integer has been counted twice.
To get squares, subtract neighbouring cubes. Expanding means multiplying three copies of : there is one term, three terms, three i terms and one 1. When we add the differences, all the middle cubes cancel.
We subtracted three times the integer sum and n copies of 1 from both sides. Divide by 3, then factor out n and factor as . Now substitute this result into the rectangle sum.
This was the right-endpoint sum. For , which increases on this interval, every other rectangle height lies between the left and right choices. The right sum minus the left sum is : all the intermediate heights cancel. This gap tends to zero, so every choice is squeezed to the same area 9. For the decreasing example , the area is already a trapezium: a 3-by-1 rectangle plus a triangle of base 3 and height 3 gives .
Can the integral be zero while the total area is not?
An integral adds signed heights. A strip below the axis has a negative height, even though its geometric area is positive. For , shifting x by π changes the sign of its height. The strips on the second half of therefore cancel the matching strips on the first half. This explains why the signed integral is zero. To find the total area, we still need the size of one half.
Divide into n strips of width and use each midpoint . Our aim is to express each sine height as a difference of two cosines, so that neighbouring terms cancel. We will first build the relation that allows this.
Adding two arrows means putting the second at the tip of the first and finding the final endpoint. Turn this whole two-segment path as one object. Each segment keeps its length and turns through the same angle, and its endpoint remains the sum of those two segments. This is why we can turn the horizontal and vertical parts separately, then add them.
Before using an angle-addition formula, let us see where it comes from. A unit arrow at angle t has coordinates : steps in the horizontal direction , then steps in the vertical direction . Turn both directions through b. The first ends at . The second stays a quarter-turn ahead, so right becomes up and up becomes left: its destination is . Keep the same two amounts and add their new horizontal and vertical parts.
Turning through −b reflects across the horizontal axis: and . This gives the subtraction formulas by changing only the signs of the sine-b terms.
Subtract the two horizontal coordinates. The parts cancel; the two parts add.
Here we chose because subtracting or adding half a width takes the midpoint to the two edges. On adding the strips, cancels , and the same happens at every inside edge. Only the first and last edges remain.
Why does approach 1?
Build three nested regions. Their areas will give us an upper and a lower bound.
OA is one radius, so its length is . B is on the same circle. Its height above OA is . Triangle OAB therefore has area .
Why does this approach 2? On a unit circle, for a small positive angle u in radians, the triangle inside its sector has area , the sector has area , and the triangle bounded by the tangent has area . Their inclusion gives . Dividing by gives . The circle point approaches (1,0) as u approaches zero, so approaches 1. The two bounds force to approach 1.
Thus each half has geometric area 2, giving total area . Taking makes both halves positive before adding. Exact cancellation in a finite midpoint picture does not mean its rectangles fit the curve exactly.
We used equal-width partitions for clarity. General Riemann integration allows unequal widths, provided the largest strip width tends to zero and the sums approach a common value independent of sample choices.
