Riemann sums, step by step

A Riemann sum is a pile of rectangles whose total area is trying to become an integral. Walk the five steps, then slide n until the error meter goes dark.

  1. 01

    Name the integral

    Write the definite integral first: the function, the lower bound, the upper bound. The sum is an approximation of that number, not a replacement for it.

  2. 02

    Pick a method

    Left and right use an endpoint of each subinterval. Midpoint uses the center. Trapezoid averages left and right. Midpoint and trapezoid usually close in faster.

  3. 03

    Choose n, then double it

    Start small enough to see the rectangles. Then double n. For left and right, the error roughly halves. For midpoint and trapezoid, it falls faster than that.

  4. 04

    Read the signed error

    The meter is the gap between the sum and the exact integral. If the function is increasing, a left sum undershoots and a right sum overshoots. That sign is the teaching, not a bug.

  5. 05

    Stop when the readout is the integral

    The definition of the definite integral is this limit as n grows. Once the error reads as zero to display precision, you have watched the definition happen.

\int_{0}^{2} x^2\,dx = 2.6667
left sum 2.1875, exact integral 2.6667, error 0.4792. The left sum is an underestimate here.
left sum, n = 8
2.1875
exact integral
2.6667
error
0.4792
Error (log scale)The left sum is an underestimate here

Full bar is the worst single-rectangle error for this function; empty means the sum is within 0.0001 of the exact integral.

Visualizer page: Riemann sum slider. Night-before list: AB cram sheet.