Riemann sums

See how Riemann sums approximate the area under a curve with rectangles – why the integral is an area.

What Riemann sums are

A Riemann sum is a way to approximate the area under a curve – we split the interval into n equal pieces and build a rectangle over each one, whose height is the value of the function at some point in that piece. The sum of the areas of all the rectangles approximately equals the area under the curve.

S ≈ Σ f(xᵢ) · Δx,   where Δx = (b − a) / n

Why the integral is an area

The more rectangles we use (larger n), the better they fill the shape under the curve, and the more accurate the estimate. As n grows toward infinity, the Riemann sum approaches the exact value – and that's exactly the definite integral. Try it with the slider above: at n = 1 the estimate is rough, at n = 50 it's already nearly identical to the exact value.

Left, middle, and right sums

The height of a rectangle can be taken at the left edge of the piece, its middle, or the right edge. For an increasing function, the left sum underestimates the area and the right sum overestimates it; the middle (and similarly the trapezoidal) rule is usually the most accurate.

Riemann sums are the foundation of the definition of the integral. You'll find the exact value on the definite integral page.