Riemann Sums
To estimate the area under a curve, slice the interval into \(n\) pieces of width \(\Delta x\), stand a rectangle on each one, and add up the rectangle areas. The sample point you pick in each slice — left edge, right edge, or midpoint — sets each rectangle's height.
By the end you'll be able to compute a left, right, or midpoint Riemann sum for a function on an interval, write it compactly in sigma notation, and predict whether it over- or under-estimates the true area.
Predict: \(f(x) = x^2\) rises all the way across \([0, 2]\). Will left rectangles over- or under-estimate the true area? Then switch to right — what changes?
Drag n to add rectangles and flip the sample point below. The mint regions are area the rectangles miss; the orange regions are area they claim but shouldn't. Watch the gap in the readout shrink as n grows — the staircase hugs the curve. Hover or tab to any rectangle for its exact height and area.
S4 = 1.750 · true area 8/3 ≈ 2.667 · gap -0.917 (underestimate)
A Riemann sum approximates the area under a curve by summing rectangle areas — left, right, or midpoint sample points set the heights — and the approximation sharpens as the number of rectangles grows.
The recipe is pure arithmetic. Split \([a, b]\) into \(n\) equal subintervals of width \(\Delta x = (b-a)/n\). In each one, pick a sample point \(x_i^*\) — the left edge, the right edge, or the center. Each rectangle contributes area \(f(x_i^*)\,\Delta x\) (height times width), and the estimate is the total. Two classic slips: don't report the sum of bare heights (that's not an area — multiply by \(\Delta x\)), and count carefully — \(n\) subintervals means \(n\) rectangles, but left and right sums sample different endpoints.
Picture the staircase you built above. Where the curve rises, left rectangles tuck under it — each one's height is set at the low edge of its slice, leaving missing slivers — while right rectangles poke above it, adding excess slivers. Midpoint rectangles split the difference: the overshoot on one side of each slice roughly cancels the undershoot on the other, which is why the midpoint sum usually lands closest. As \(n\) grows, every sliver thins out and the staircase hugs the curve.
Sigma notation packs the whole sum into one expression: \[\sum_{i=1}^{n} f(x_i^*)\,\Delta x = f(x_1^*)\Delta x + f(x_2^*)\Delta x + \cdots + f(x_n^*)\Delta x.\] The choice of \(x_i^*\) in the \(i\)-th subinterval names the sum: left edge, right edge, or midpoint. And "more rectangles is better" is the same limiting idea you met with limits of functions: send \(n \to \infty\) and these sums close in on a single number — the true area. That limit gets a name and a notation of its own in the next lesson.
Estimate the area under \(f(x) = x^2\) on \([0, 2]\) with \(n = 4\) left rectangles. Width: \(\Delta x = (2-0)/4 = 0.5\). Left endpoints: 0, 0.5, 1, 1.5. Heights: \(f(0)=0\), \(f(0.5)=0.25\), \(f(1)=1\), \(f(1.5)=2.25\). Sum: \((0 + 0.25 + 1 + 2.25)(0.5) = 3.5 \times 0.5 = \) 1.75 — an underestimate of the exact area \(8/3 \approx 2.667\), just as the rising curve predicts.
Same curve, same \(n\), but midpoint rectangles: \(\Delta x = 0.5\) and the midpoints are 0.25, 0.75, 1.25, 1.75. Heights: \(f(0.25) = 0.0625\), \(f(0.75) = 0.5625\), \(f(1.25) = 1.5625\), \(f(1.75) = 3.0625\). Now finish it: the midpoint sum is \((0.0625 + 0.5625 + 1.5625 + 3.0625) \times 0.5 = \) ____
Reveal the answer
The heights total \(5.25\), so the sum is \(5.25 \times 0.5 = \) 2.625 — much closer to \(8/3 \approx 2.667\) than the left sum's 1.75. Set n = 4 and Midpoint in the explorer above and check the gap readout.
More info — reading sigma notation as a loop
If \(\sum_{i=1}^{n} f(x_i^*)\,\Delta x\) looks dense, read it as a loop: the index
\(i\) runs from 1 to \(n\), and at each step you evaluate one term and add it to a
running total — exactly what you'd write as
total += f(x[i]) * dx in code. The expression after \(\Sigma\) is the
loop body; the limits below and above \(\Sigma\) are the loop bounds. This "for loop
on paper" view also explains the direction-of-error rule you saw earlier: a function
with positive derivative is increasing, so inside each slice the left endpoint feeds
the loop its smallest height and the right endpoint its largest. The OpenStax
section linked under Dive deeper builds sigma notation from scratch with more
examples.
Check your understanding
Estimate the area under \(f(x) = x^2\) on \([0, 2]\) using \(n = 4\) right rectangles.
You approximate the area under a curve on \([1, 5]\) with \(n = 8\) rectangles of equal width. What is \(\Delta x\)?
A student computes the four sample heights \(f(x_1^*), f(x_2^*), f(x_3^*), f(x_4^*)\), adds them up, and reports that total as the approximate area. What went wrong?
Suppose \(f'(x) > 0\) at every point of \([a, b]\). What can you conclude about the left and right Riemann sums for \(f\) on \([a, b]\)?
Recap
- Slice \([a,b]\) into \(n\) equal pieces of width \(\Delta x = (b-a)/n\); each rectangle contributes area \(f(x_i^*)\,\Delta x\) — height times width, never height alone.
- The sample point \(x_i^*\) names the sum: left edge, right edge, or midpoint of each subinterval.
- Sigma notation writes the whole estimate compactly: \(\sum_{i=1}^{n} f(x_i^*)\,\Delta x\).
- On an interval where \(f\) is increasing (\(f' > 0\)), left sums underestimate and right sums overestimate the true area; midpoint sums are usually closest.
- More rectangles give a better approximation — as \(n \to \infty\), the sums close in on the true area.
Dive deeper
- OpenStax Calculus Volume 1 — 5.1 Approximating Areas Introduce sigma notation and left/right Riemann sums for area approximation
Sources
- Riemann Sums and Sigma Notation