Riemann Sum Calculator
Calculate left, right and midpoint Riemann sums for any f(x) on [a, b] with n rectangles — with Δx, sample points table and the trapezoidal average for comparison.
How it works
Δx = (b − a)/n · Left: Σ f(a + (i−1)Δx)·Δx · Right: Σ f(a + iΔx)·Δx · Midpoint: Σ f(a + (i − ½)Δx)·Δx, i = 1…n
A Riemann sum approximates the area under a curve with n rectangles of equal width Δx. The height of each rectangle is the function value at a sample point: the left end, the right end or the middle of its subinterval. For an increasing function the left sum underestimates and the right sum overestimates; the midpoint sum is usually the most accurate of the three, and as n grows every version converges to the definite integral.
Worked example
For f(x) = x² on [0, 2] with n = 4: Δx = 0.5 and the right endpoints are 0.5, 1, 1.5 and 2, so the right Riemann sum is 0.5 × (0.25 + 1 + 2.25 + 4) = 3.75. The left sum is 1.75 and the midpoint sum is 2.625, compared with the exact integral 8/3 ≈ 2.6667.
Sources: Riemann sum — Wikipedia · Approximating Areas — OpenStax Calculus Volume 1, 5.1
Frequently asked questions
What is the difference between left, right and midpoint Riemann sums?
Only where the rectangle height is measured. Left uses f at the start of each subinterval, right at the end, midpoint in the middle. Midpoint sums tend to be much closer to the true integral.
When is a Riemann sum an overestimate?
For an increasing function the right sum overestimates and the left sum underestimates (the reverse for a decreasing function). For a concave-up function the midpoint sum underestimates.
How does a Riemann sum relate to the definite integral?
The definite integral is the limit of Riemann sums as n → ∞ (Δx → 0). Increase n to see the sums approach the exact area.
Can a Riemann sum be negative?
Yes. Where f(x) is below the x-axis the rectangles contribute negative signed area, so the sum is the net signed area.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.