Key takeaways
- A Riemann sum estimates area by adding rectangles: Σ f(xᵢ*) × Δx.
- Δx = (b − a) ÷ N, where N is the number of rectangles.
- Left, right and midpoint only change where you measure each height.
- The midpoint sum is usually the most accurate of the three.
- More rectangles means a better estimate.
In this guide
What is a Riemann sum?
Finding the exact area under a curve can be hard. But the area of a rectangle is easy: width × height. So you cut the region into thin vertical strips, treat each strip as a rectangle, and add them up.
The only question is where to measure each rectangle’s height:
- Left: use the height at the left edge of each strip.
- Right: use the height at the right edge.
- Midpoint: use the height in the middle.
Why do Riemann sums matter?
Riemann sums are how integrals are defined: the exact area is the value the sum approaches as the rectangles get thinner and thinner. They also work with real data, where you don’t have a formula, only measurements.
Bernhard Riemann made this idea precise in the 1850s. Today, computers use the same idea, with millions of thin strips, to estimate areas with no neat formula.
The formula
| Symbol | What it means | Example |
|---|---|---|
| a, b | The start and end of the interval | 0 and 2 |
| N | The number of rectangles (rects in the calculator) | 4 |
| Δx | The width of each rectangle | 0.5 |
| xᵢ* | Where you measure the height in strip i | midpoints 0.25, 0.75, … |
| f(xᵢ*) | The height of rectangle i | f(0.25) = 0.0625 |
This calculator uses f(x) = xᵖ. Choose the type with 1 = Left, 2 = Right, 3 = Midpoint. It also shows the exact answer and the error.
How to calculate a Riemann sum step by step
- 1Find the width.
Δx = (b − a) ÷ N. - 2List the x-values. Left edges, right edges or midpoints, one per rectangle.
- 3Find each height. Put each x-value into f(x).
- 4Add and multiply. Add all the heights, then multiply by Δx.
Now try it yourself. Pick a power, limits, number of rectangles and a type in the calculator below, and compare with the exact answer.
Try it yourself
Pre-filled with the example — change any value.
Common mistakes to avoid
- Forgetting to multiply by Δx. Adding heights alone is not an area.
- Expecting left and right to agree. For a rising curve, left underestimates and right overestimates.
- Using the endpoints for a midpoint sum. Midpoints are halfway across each strip, like 0.25, not 0 or 0.5.
Tips and tricks
- Average left and right and you get the trapezoidal rule:
(1.75 + 3.75) ÷ 2 = 2.75. - Even better: Simpson’s rule uses curved pieces and is often far more accurate.
- Exact answer: for powers of x, the definite integral calculator gives it directly.
Where you’ll use it in real life
- Travel: distance from speed readings taken every minute.
- Weather: total rainfall from hourly rates.
- Energy: electricity used from meter readings through the day.
- Medicine: total drug exposure from blood tests taken at set times.
Quick summary
A Riemann sum estimates area by adding rectangles: find Δx, measure a height in each strip (left, right or middle), add them and multiply by Δx. More rectangles give a better estimate. Use the calculator above to compare your sum with the exact area and see the error.
Worked example
Your teacher asks you to estimate the area under y = x³ from x = 0 to x = 2 using 4 midpoint rectangles, then compare with the exact value. Here p = 3, a = 0, b = 2, rects = 4 and rtype = 3 (midpoint).
- 01∫[0 to 2] x^3 dx, Midpoint Riemann Sum, N=4
- 02Δx = (2 − 0) / 4 = 0.5
- 03Approximation = Σ f(xᵢ*) · Δx
- 04≈ 3.875
- 05Exact value = 4
- 06Error = 0.125
These numbers are pre-filled in the calculator above.
Frequently asked questions
Which Riemann sum is most accurate?
Usually the midpoint sum, because errors on each side of the middle partly cancel. Using more rectangles improves every type.
How is a Riemann sum related to an integral?
The definite integral is the value the Riemann sum approaches as the number of rectangles grows without limit and their width shrinks to zero.
Is a left Riemann sum an overestimate or an underestimate?
For a curve that is going up, the left sum is an underestimate and the right sum is an overestimate. For a curve going down, it is the other way round.


