A Riemann sum is the standard way to approximate the area under a graph before you have the fundamental theorem of calculus. You slice the interval into thin strips, replace the curve on each strip by a flat rectangle, and add the areas. OpenStax Calculus Volume 1 develops this in Sections 5.1 and 5.2 and then defines the definite integral as the limit of those sums.
Building the sum
Take a function $f$ on a closed interval $[a,b]$ and choose a positive integer $n$. The width of each subinterval is $$\Delta x=\frac{b-a}{n}.$$ The partition points are $x_i=a+i\Delta x$ for $i=0,1,\dots,n$. On the $i$th subinterval $[x_{i-1},x_i]$ you pick a sample point $x_i^*$ and form the rectangle of height $f(x_i^*)$ and width $\Delta x$. The Riemann sum is $$\sum_{i=1}^{n} f(x_i^*)\,\Delta x.$$ Three common choices of sample point have names:
- Left sum: $x_i^*=x_{i-1}$.
- Right sum: $x_i^*=x_i$.
- Midpoint sum: $x_i^*=\frac{x_{i-1}+x_i}{2}$.
If $f$ is negative on a strip, that term is negative. The sum estimates net signed area, not total area.
A teaching example
Approximate the area under $f(x)=x^2$ on $[0,2]$ with $n=4$ rectangles. Then $\Delta x=1/2$, and the partition is $0,0.5,1,1.5,2$. These figures are a worked teaching example, not a numbered OpenStax exercise.
The right sum uses the heights $f(0.5),f(1),f(1.5),f(2)$: $$(0.25+1+2.25+4)\cdot\frac{1}{2}=3.75.$$ The left sum uses $f(0),f(0.5),f(1),f(1.5)$: $$(0+0.25+1+2.25)\cdot\frac{1}{2}=1.75.$$ The midpoint sum uses $f(0.25),f(0.75),f(1.25),f(1.75)$: $$(0.0625+0.5625+1.5625+3.0625)\cdot\frac{1}{2}=2.625.$$ The exact integral is $\int_0^2 x^2\,dx=\frac{8}{3}\approx 2.667$. Because $x^2$ is increasing and positive on $[0,2]$, the left sum sits below the curve and the right sum sits above it. The midpoint sum is already close.
From sums to the definite integral
OpenStax defines the definite integral, when the limit exists, by shrinking the widths: $$\int_a^b f(x)\,dx=\lim_{n\to\infty}\sum_{i=1}^{n} f(x_i^*)\,\Delta x.$$ If $f$ is continuous on $[a,b]$, the limit exists and does not depend on how you choose the sample points. That is why left, right and midpoint sums, and more irregular partitions, all head for the same number. Once you know an antiderivative, the fundamental theorem evaluates the integral without writing another sum. The sums remain the meaning of the integral: they are what the symbol is defined to be.
Checkpoints
- For $f(x)=x$ on $[0,3]$ with $n=3$, compute the left, right and midpoint sums. What is the exact integral?
- Why is a right sum an underestimate when $f$ is positive and decreasing?
- Explain why $\int_0^{2\pi}\sin x\,dx=0$ even though each individual sine bump has area $2$.
Common mistakes
- Using $n$ as the width instead of $(b-a)/n$.
- Off-by-one sample points, especially starting a right sum at $a$ instead of $a+\Delta x$.
- Treating a negative term as a mistake. Signed area can be negative.
- Thinking the definite integral is defined by antiderivatives. Antiderivatives compute it; Riemann sums define it.
Related reading
- The fundamental theorem of calculus and what a derivative actually measures
- U-substitution explained and integration by parts intuition
- Calculus foundations topic map and the AP Calculus AB bridge
- All explainers and the sources page
Sources
- OpenStax, Calculus Volume 1, Section 5.1 Approximating Areas (retrieved 12 Nov 2026)
- OpenStax, Calculus Volume 1, Section 5.2 The Definite Integral (retrieved 12 Nov 2026)
Last reviewed: 12 November 2026.
Common questions
What is a Riemann sum?
It is a sum of the form Σ f(x_i*) Δx that approximates the net signed area under a curve by adding the areas of thin rectangles. Each rectangle has width Δx and height f at a sample point in that subinterval.
What is the difference between left, right and midpoint sums?
They only differ in the sample point. A left sum uses the left endpoint of each subinterval, a right sum uses the right endpoint, and a midpoint sum uses the midpoint.
How does a Riemann sum become a definite integral?
OpenStax defines the definite integral as the limit of Riemann sums as the number of subintervals goes to infinity and the widths shrink to zero, when that limit exists.
Can a Riemann sum overestimate and underestimate on the same interval?
Yes. For an increasing positive function, left sums underestimate the area and right sums overestimate it. Midpoint sums are often closer, but that is not a theorem for every function.