Watch on Instagram

Math Bytes · Calculus · Episode 17 · Integrals

Riemann sums

A Riemann sum estimates the area under a curve by adding up rectangles. For y = x² from 0 to 4 with four slices 1 wide, right edges give 1 + 4 + 9 + 16 = 30 and left edges give 0 + 1 + 4 + 9 = 14; the true area, 21⅓, sits in between, and thinner rectangles squeeze in on it.

Posted · About a 1 minute watch, 3 minute read · Take the quiz

The setup: y = x² from 0 to 4

The region under y = x² from x = 0 to x = 4 isn't a rectangle or a triangle, so there's no simple area formula for it yet. Instead, cut it into 4 slices, each 1 wide: [0, 1], [1, 2], [2, 3] and [3, 4].

Right edges: 30

On each slice, build a rectangle as tall as the curve at the slice's right edge:

  • at x = 1: height 1² = 1
  • at x = 2: height 2² = 4
  • at x = 3: height 3² = 9
  • at x = 4: height 4² = 16

Each rectangle's area is height × width, and every width is 1, so the sum is

1 + 4 + 9 + 16 = 30

That's a Riemann sum: add up f(x) · Δx over the slices, where Δx is the slice width.

Left edges: 14

Because x² rises from left to right, each right-edge rectangle pokes above the curve, so 30 is too big. Use the height at each left edge instead (x = 0, 1, 2, 3) and every rectangle sits under the curve, leaving gaps:

0 + 1 + 4 + 9 = 14, which is too small.

So the true area is somewhere between 14 and 30.

Thinner rectangles squeeze in

The true area is 21⅓ (that is, 64/3; the next lesson shows how to get it exactly). With more, thinner slices, the rectangles hug the curve more tightly: the right sum comes down, the left sum comes up, and both close in on 21⅓. The limit of the sums as the slices get thinner is the definite integral, ∫₀⁴ x² dx = 21⅓.

Try it yourself

  1. Estimate the area under y = 2x from x = 0 to x = 3 with slices 1 wide. Find the right-edge sum and the left-edge sum.
  2. Estimate the area under y = x² from x = 0 to x = 2 with slices 1 wide, using left edges.

(Answers: 1. Right edges: heights 2, 4, 6, so 2 + 4 + 6 = 12. Left edges: heights 0, 2, 4, so 0 + 2 + 4 = 6. The true area is the triangle ½ · 3 · 6 = 9, between them. 2. Heights at x = 0 and x = 1 are 0 and 1, so the left sum is 0 + 1 = 1, an underestimate.)

Good to know

  • A Riemann sum adds f(xᵢ) · Δx over the slices, where xᵢ is a point in each slice. Left and right endpoints are the most common choices.
  • "Right edges overestimate, left edges underestimate" holds here because x² is increasing on [0, 4]. For a decreasing curve it flips.
  • Midpoint and trapezoid sums are other ways to estimate the same area; they aren't covered in this lesson.
  • "Both sums squeeze in" on the same number is true for continuous functions such as x².
  • The true area 64/3 = 21⅓ comes from the next lesson's method: x³/3 from 0 to 4.
  • The sums are named for the mathematician Bernhard Riemann.

Answer to the comment question

y = x² from x = 1 to x = 4, slices 1 wide, right edges: what's the Riemann sum? 29. The slices are [1, 2], [2, 3] and [3, 4], so the right edges are x = 2, 3, 4, with heights 4, 9 and 16: 4 + 9 + 16 = 29. The true area is 21, so 29 is an overestimate, as expected for right edges on a rising curve.

Test your knowledge

Quick quiz: Riemann sums

4 multiple-choice questions. Pick one answer for each, then check how you did.

1What does a Riemann sum add up?
2For y = x² from 0 to 4 with slices 1 wide, what is the right-edge sum?
3Why is the left-edge sum of 14 too small for y = x² on [0, 4]?
4What happens to the left and right sums as the rectangles get thinner?

Sources

Video transcript

How can rectangles under a curve estimate its area?

Take the curve y equals x squared, from zero to four. That area isn't a simple shape.

Split it into four slices, each one wide. Use the curve's height at each right edge: one, four, nine and sixteen.

Add up the rectangles and you get thirty. That's a Riemann sum.

The rectangles poke above the curve, so thirty is too big. Using left edges gives fourteen, which is too small.

The true area is twenty-one and a third. With thinner rectangles, both sums squeeze in on it. That limit is the integral.

Your turn. y equals x squared, from one to four. Slices one wide, right edges. What's the Riemann sum? Comment your answer below!

That's your byte.

More from Calculus

All Calculus lessons