What is a Riemann sum?
Last updated: 2026-11-26
A Riemann sum estimates the area under a curve by slicing it into strips, treating each strip as a rectangle, and adding the rectangle areas. The exact area comes from watching what that sum approaches as the strips get thinner. Whether a given sum runs low or high depends on where you read each rectangle's height, at its left edge, right edge or midpoint, and on how the function behaves, and that pairing is easy to mix up.
Start learning No account needed
1. Strips, rectangles and the one choice you make
Split the interval from a to b into n strips. Each strip has the same width, delta x = (b − a) / n. The Riemann sum multiplies that width by one height of the function inside the strip and adds the results. The Wikipedia article on Riemann sums defines the sum over such a partition, and the names people use say where the height was read: the left rule reads the height at the left edge of each strip, the right rule at the right edge, and the midpoint rule at the middle.
What the sum approaches is the thing the course actually wants. Wikipedia's article on the integral describes a definite integral as signed area, meaning area measured with a plus or minus sign between the graph and the axis, and the Riemann article's connection-with-integration section defines the definite Riemann integral as the limit of these sums as the largest subinterval shrinks toward zero, for functions where every choice of sample points lands on the same limit. So the sums are not a rival to the integral; they are how the number gets built.
2. A worked example: x squared on 0 to 2
Wikipedia's own example is x squared on 0 to 2, where the exact area is 8/3. We compute the three rules at n = 4 and n = 8 strips with scripts/what-is-a-riemann-sum-worked-example.py, and every number below is its output:
f(x) = x^2 on 0 to 2, exact integral = 8/3 = 2.6667
n = 4: width 0.5 left 1.7500 (low by 0.9167) right 3.7500 (high by 1.0833) mid 2.6250 (off 0.0417)
n = 8: width 0.25 left 2.1875 (low by 0.4792) right 3.1875 (high by 0.5208) mid 2.6562 (off 0.0104)
n = 4, strip width 0.5; left-rule heights 0.0, 0.25, 1.0, 2.25 add to 3.5 x 0.5 = 1.75
right-rule heights 0.25, 1.0, 2.25, 4.0 add to 7.5 x 0.5 = 3.75
closed form from the article, right sum at n = 4: 8/3 + 4/4 + 4/(3*16) = 3.75
left error: 0.9167 to 0.4792, n doubling divides it by 1.91
right error: 1.0833 to 0.5208, n doubling divides it by 2.08
mid error: 0.0417 to 0.0104, n doubling divides it by 4.00
endpoint-rule errors halve when n doubles; the midpoint error drops about fourfold
sin(x) on 0 to pi, exact 2. n = 8: left 1.9742 right 1.9742 mid 2.0129
sin is zero at both ends, so the left and right sums add the same heights;
here both sit below 2, and the rising or falling rule does not cover this case
checks passed
Take one line at a time. At n = 4, each strip is 0.5 wide; the left rule reads the heights 0, 0.25, 1 and 2.25, which add to 3.5, and 3.5 × 0.5 = 1.75. The right rule reads 0.25, 1, 2.25 and 4, which add to 7.5, and 7.5 × 0.5 = 3.75. The exact value sits between them, and the closed form the article derives for the right sum, 8/3 + 4/n + 4/(3n²), reproduces 3.75 exactly. Everything converges to 2.6667 as n grows; what separates the rules at fixed n is the size and direction of the miss.
3. A common misconception: the endpoint rules work by rule of thumb
A slip to watch for runs like this: you remember that one of the left and right sums overshoots, you cannot recall which, and you answer "right sums are more accurate" because the right edge feels like the finishing value. Wikipedia's article settles the direction with a condition, not a preference: on an interval where the function only rises (monotonically increasing), the left rule underestimates and the right rule overestimates, and on a monotonically decreasing stretch the two swap. Direction comes from the function's rise and fall, so the same endpoint choice that undershoots on one curve overshoots on another.
And when the function rises then falls, like sine on 0 to pi, the article's rule for rising or falling functions does not cover the whole interval. In our run the left and right sums came out identical at 1.9742, because sine is zero at both 0 and pi, so the two rules add the same heights, and both landed below the exact 2. Before you answer "too high or too low", ask what the function does between the endpoints; the answer depends on the curve.
Accuracy is a separate question from direction. The endpoint errors in our run roughly halved when n doubled, which matches the article's error bound shrinking in proportion to 1/n, while the midpoint error dropped about fourfold. On this example the midpoint sum is also the closest of the three with the same number of rectangles: 2.6250 against 2.6667 at n = 4, off by 0.0417.
4. Test yourself
Close this page and answer before you look back: for f(x) = x squared rising on 0 to 2, is the left sum at n = 4 above or below the exact area, and by roughly how much? Then picture a falling function on the same interval and say what happens to the two endpoint rules. If you reached for "right sums are the accurate ones" in either answer, reread section 3.
For the surrounding course, see how to study for calculus and why is calculus so hard. For checking an answer without help, see how to test yourself.
What the sources found, and their limits
Wikipedia, "Riemann sum". It defines the sum over a partition, gives the left, right, midpoint and trapezoidal rules, states the monotonicity rule we lean on in section 3 (left underestimates and right overestimates on an increasing function, swapping on a decreasing one), carries an error bound for each rule, works the same x squared on 0 to 2 example with the exact value 8/3 and the right-sum closed form our script checks, and defines the definite Riemann integral as the limit of these sums. Source: Riemann sum, read on 2026-11-25.
Wikipedia, "Integral". Its opening figure caption says a definite integral can be represented as "the signed area of the region bounded by its graph and the horizontal axis", which is where our sentence about area comes from, and its formal definitions section covers the Riemann integral and the Lebesgue integral. Source: Integral, read on 2026-11-25.
Limits: two encyclopedia articles, not a course text. The n = 4 and n = 8 computations, the error ratios and the sine case are ours; the article derives the right-sum closed form and the error bounds, and our script checks the numbers against them. The article's midpoint error bound involves the second derivative, and we state the fourfold drop as an observed fact from the run plus the article's bound, not as a derivation. Both articles are CC BY-SA.
How Professor Turing helps
Professor Turing is a tutor for adults learning any subject, in college or on their own. It asks you questions instead of giving the final answer, does not grade a bare guess, and remembers what you got wrong. No account is needed to start.
Bring the estimate you cannot place, such as a left sum you cannot call too high or too low. Its first reply asks what you already know before it teaches anything. If you answer with a bare guess, it asks how you got there instead of saying right or wrong, and when you stay stuck it changes its approach and makes the next step smaller instead of handing over the answer. Later in a session it can offer a short test without help, scored apart from the tutoring, so you can tell what you can do alone from what the tutor carried you through. You must be 18 or older, and guest conversations are deleted 7 days after the last activity.
FAQ
How do you tell whether a Riemann sum is too high or too low? Read the function first. Wikipedia's Riemann sum article states the rule for monotone functions: on an interval where the function rises from left to right, the left rule undershoots and the right rule overshoots, and on a falling stretch the two swap. On our rising example the left sum at n = 4 lands at 1.7500 against the exact 2.6667 and the right sum at 3.7500. When the function rises and then falls, like sine on 0 to pi, that rule does not cover the whole interval; in our run both landed below the exact 2.
Why did the midpoint sum land closer than the endpoint sums here? On a straight line, a midpoint rectangle has exactly the area under the line, because what it misses on one half of the strip equals the extra it adds on the other half, so on a narrow strip of a smooth curve much of the error cancels. In our run the endpoint errors at n = 4 were 0.9167 and 1.0833, while the midpoint error was 0.0417, and when n doubled, the endpoint errors halved while the midpoint error dropped about fourfold. The Wikipedia article carries an error bound for each rule, with the midpoint bound depending on the second derivative and shrinking faster in n.
Start with what you're working on
Tell the tutor which sum you are estimating and let it ask you the questions.
Start learning No account needed
See also: definite and indefinite integral · how to study for calculus · why is calculus so hard · how to test yourself · the fundamental theorem of calculus · all study guides