Calculus

Riemann Sums Explained: Left, Right, Midpoint and Trapezoid

By Math Solving Space · · 2 min read

On this page
  1. Setting up
  2. Worked example: @@STASH6@@
  3. Comparing the methods
  4. From sums to integrals
  5. Common mistakes
  6. Practice questions
  7. Frequently asked questions

A Riemann sum estimates the area under a curve by splitting it into thin strips and adding up rectangles. The height of each rectangle comes from the function at the left end, right end or middle of its strip. As the strips get thinner, the sum approaches the exact integral.

Setting up

To approximate ∫abf(x) dx\int_a^b f(x)\,dx with nn strips, each strip has width

Δx=b−an\Delta x = \frac{b - a}{n}

Worked example: ∫02x2 dx\int_0^2 x^2\,dx

The exact area is 83≈2.667\frac{8}{3} \approx 2.667.

Left sum, n=4n = 4: Δx=0.5\Delta x = 0.5, heights at 0,0.5,1,1.50, 0.5, 1, 1.5:

0.5(0+0.25+1+2.25)=1.750.5(0 + 0.25 + 1 + 2.25) = 1.75

This is too small, because x2x^2 is increasing, so left heights are the lowest in each strip.

Midpoint sum, n=8n = 8: Δx=0.25\Delta x = 0.25, heights at 0.125,0.375,…,1.8750.125, 0.375, \ldots, 1.875. The total is 2.656252.65625, already very close.

Comparing the methods

Method Heights from Typical accuracy
Left left ends low
Right right ends low
Midpoint middles good
Trapezoid average of both ends good

From sums to integrals

The definite integral is defined as the limit of Riemann sums:

∫abf(x) dx=lim⁡n→∞∑i=1nf(xi∗) Δx\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x

That is why the integral symbol is a stretched S, for "sum".

Common mistakes

  • Using n+1n + 1 rectangles instead of nn.
  • Mixing up which end to use for left and right sums.
  • Forgetting to multiply by Δx\Delta x.

Practice questions

  1. Find the right sum for x2x^2 on [0,2][0, 2] with n=4n = 4.
  2. Find the trapezoid estimate for xx on [0,4][0, 4] with n=2n = 2.
  3. Is a left sum of 1x\frac{1}{x} on [1,3][1, 3] an over- or underestimate?

Answers: 1) 3.753.75 2) 88 (exact) 3) overestimate

Draw the rectangles yourself in the Riemann sum calculator, then compare with the exact value from the integral calculator. See also integration for beginners.

Frequently asked questions

Why is the midpoint rule more accurate?

Over each strip, the parts of the rectangle above and below the curve tend to cancel out.

Is the trapezoid rule a Riemann sum?

Strictly it is the average of the left and right sums, but it is used the same way to approximate integrals.

How many rectangles do I need?

More rectangles give a better estimate. For smooth functions, doubling n with the midpoint rule cuts the error by about four.

Open the calculator →

#calculus#integrals