Calculus

Riemann Sums Explained: Left, Right, Midpoint and Trapezoid

By math_person · · Updated · 2 min read

On this page
  1. Setting up
  2. Worked example: $\int_0^2 x^2\,dx$
  3. Comparing the methods
  4. From sums to integrals
  5. Common mistakes
  6. Practice questions
  7. Frequently asked questions
  8. Try these calculators

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 $\int_a^b f(x)\,dx$ with $n$ strips, each strip has width

$$\Delta x = \frac{b - a}{n}$$

Worked example: $\int_0^2 x^2\,dx$

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

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

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

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

Midpoint sum, $n = 8$: $\Delta x = 0.25$, heights at $0.125, 0.375, \ldots, 1.875$. The total is $2.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:

$$\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 + 1$ rectangles instead of $n$.
  • Mixing up which end to use for left and right sums.
  • Forgetting to multiply by $\Delta x$.

Practice questions

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

Answers: 1) $3.75$ 2) $8$ (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 →

How do I know if a Riemann sum is an overestimate or underestimate?

For an increasing function, a left sum underestimates and a right sum overestimates. For a decreasing function it is the other way round. For the trapezoid rule, the estimate is too high when the curve is concave up and too low when it is concave down.

What is the formula for a left Riemann sum?

Left sum = Δx × [f(x₀) + f(x₁) + … + f(xₙ₋₁)], where Δx = (b − a) ÷ n. A right sum uses f(x₁) to f(xₙ) instead.

#calculus#integrals