Guides / Integrals
Riemann sums: left, right, midpoint, and trapezoid, and which way each one misses
Short answer
Split [a, b] into n strips of width Δx = b − an, with points xi = a + iΔx. There are n strips but n + 1 points. The left sum uses the first n heights, the right sum the last n, and the midpoint sum the heights halfway along each strip, each times Δx. The trapezoid rule is the average of left and right: the end heights count once and the inside ones twice, all times Δx/2. For an increasing function the left sum is too small and the right sum too big; for a decreasing one it's the other way round.
Why it works
Each rectangle has width Δx and a height taken from the curve somewhere in its strip, so its area is close to the area under the curve over that strip. Adding them up gives an estimate of the whole area, and as the strips get thinner the gap at the top of each one shrinks. The definite integral is defined as the limit of these sums as n → ∞, and the fundamental theorem of calculus is what lets you skip the limit when you know an antiderivative.
Which way the sum misses depends on the shape of the curve. If f is increasing, the left edge of every strip is its lowest point, so left rectangles sit under the curve. If f is concave up, the chord across a strip lies above the curve, so the trapezoid rule overestimates, and the midpoint rectangle underestimates.
Example 1: left and right sums
Estimate ∫03 (x2 + 1) dx with 3 strips, using left and right sums.
- Δx = 3 − 03 = 1; points 0, 1, 2, 3; heights 1, 2, 5, 10Three strips, four points.
- L3 = 1 · (1 + 2 + 5) = 8The first three heights, one for the left edge of each strip.
- R3 = 1 · (2 + 5 + 10) = 17The last three heights.
- 8 < ∫03 (x2 + 1) dx = 12 < 17x² + 1 is increasing on [0, 3], so the left sum is too small and the right sum too big. The exact value is [x³/3 + x] from 0 to 3, which is 9 + 3.
Example 2: midpoint and trapezoid
The same integral with 3 strips, using the midpoint sum and the trapezoid rule.
- Midpoints 0.5, 1.5, 2.5; heights 1.25, 3.25, 7.25Halfway along each strip.
- M3 = 1 · (1.25 + 3.25 + 7.25) = 11.750.25 too small: the curve is concave up.
- T3 = 12(1 + 2 · 2 + 2 · 5 + 10) = 12.5Ends once, inside points twice. It is also (L₃ + R₃)/2 = (8 + 17)/2.
- M3 = 11.75 (error 0.25), T3 = 12.5 (error −0.5)Both are far closer than L₃ or R₃, and they miss in opposite directions, with the trapezoid error exactly twice the midpoint error, as it always is for a quadratic.
Example 3: the limit of right sums
Evaluate ∫13 2x dx as a limit of right sums.
- Δx = 2n, xi = 1 + 2inx_i = a + iΔx, and here a = 1, not 0.
- Rn = Σi=1n 2(1 + 2in) · 2n = 4n · n + 8n2 · n(n + 1)2Split the sum, and use 1 + 2 + … + n = n(n + 1)/2.
- = 4 + 4(n + 1)n = 8 + 4nSimplify before taking the limit.
- limn→∞ Rn = 8Check: [x²] from 1 to 3 is 9 − 1 = 8. Every right sum is 4/n too big, because 2x is increasing.
Example 4: a table of data
Water flows into a tank at 10, 14, 16 and 15 liters per minute, measured at t = 0, 2, 4, 6 minutes. Estimate how much flowed in over the 6 minutes.
- Δt = 2; L3 = 2(10 + 14 + 16) = 80, R3 = 2(14 + 16 + 15) = 90The amount is the integral of the rate, and there are three 2-minute strips.
- T3 = 22(10 + 2 · 14 + 2 · 16 + 15) = 85The trapezoid rule is usually the best of the three for data like this.
- about 85 litersThe rate goes up and then down, so you can't tell from the shape whether the left or the right sum is the low one. Over or under is decided by the function, not by the name of the sum.
Common mistakes, and the exact line they happen on
1. Using every point in a left sum
The left sum from Example 1.
- Δx = 1, heights 1, 2, 5, 10Right so far.
- L3 = 1 · (1 + 2 + 5 + 10) = 18This is the mistake. That is four rectangles on three strips: the last one sits over [3, 4], outside the interval. It's even bigger than the right sum, 17, which is a sign something is off. A left sum uses the first n heights and gives 8.
2. Writing xi without the starting point
The limit from Example 3.
- Δx = 2nRight so far.
- xi = 2in, so Rn = Σ 2 · 2in · 2n = 4 + 4n → 4This is the mistake. These points run from 0 to 2, so this is the integral over [0, 2], not [1, 3]. The points start at a: x_i = 1 + 2i/n, and the limit is 8.
3. Giving the end heights full weight in the trapezoid rule
The tank from Example 4.
- Rates 10, 14, 16, 15 every 2 minutesRight so far.
- T3 = 2(10 + 14 + 16 + 15) = 110This is the mistake. That is four full rectangles over three strips. Each end reading belongs to one trapezoid and each inside reading to two, and each trapezoid takes half of each of its two heights: (2/2)(10 + 28 + 32 + 15) = 85.
Practice
Find L4 and R4 for f(x) = x on [0, 4].
Show answer
Δx = 1: L4 = 0 + 1 + 2 + 3 = 6 and R4 = 1 + 2 + 3 + 4 = 10. The exact area is 8, and here the trapezoid rule, (6 + 10)/2, gets it exactly.
Find M2 for x3 on [0, 2].
Show answer
Midpoints 0.5 and 1.5, Δx = 1: 0.125 + 3.375 = 3.5. The exact value is 4.
Estimate ∫13 dxx with the trapezoid rule and 2 strips.
Show answer
12(1 + 2 · 12 + 13) = 76 ≈ 1.167, a little above ln 3 ≈ 1.099, because 1/x is concave up.
Evaluate limn→∞ Σi=1n 1n(in)3.
Show answer
It is a right sum for x3 on [0, 1], so the limit is ∫01 x3 dx = 14.
Write ∫25 x2 dx as a limit of right sums, and evaluate it.
Show answer
Δx = 3/n, xi = 2 + 3i/n, and Rn = Σ (2 + 3i/n)2 · 3/n = 39 + 632n + 92n2 → 39, which matches (125 − 8)/3.