Riemann sums
Learn more from the full course
Become a Calculus 2 Master
Learn everything from Calculus 2, then test your knowledge with 830+ practice questions
25:22:45 of on-demand video • Updated September 2026
Integrals, including approximating area, the dreaded Fundamental Theorem of Calculus, and every kind of integration technique
Applications of Integrals, including volume of revolution with disks, washers and shells, and all kinds of real world applications
Polar & Parametric, including how to sketch polar curves and find the area bounded by polar curves
Sequences & Series, including all the convergence tests, and Taylor and Maclaurin series
English
So now that we're comfortable
working with summation notation, we can turn toward Riemann sums which
are a tool that we use to estimate the area under a curve. So let's think about
this area problem here. When we have some
function f of x, and let's say it's represented
here by this curve. The integral as we've said
is calculating the exact area under this curve. So the area enclosed by
this curve and the x axis, this shaded region here that
we've labeled with a for area. And if we're just taking
an indefinite integral, then we don't limit the area
of this shaded region to this left edge here at x equals a and this
right edge here at x equals b, just goes on forever infinitely
to the left and right. And the integral, the indefinite integral calculates
the area under the curve. When we work with a Riemann sum, what we're doing is we're
approximating this shaded region. We're trying to find an
estimate of the area. The idea of a Riemann sum
is to slice this shaded region into many
thin rectangles. So think about a vertical
rectangle that gives the area of just this first little strip. We know easily how to calculate
the area of a rectangle, it's just length times width. So we would take this tiny
little width and the length which in this case is the
height or the distance from the x axis to the value of the
curve here and we calculate the area of that rectangle. And then we take another
tiny little rectangle and we calculate its area. And we keep slicing this whole
area into little rectangles, calculating the area of each
rectangle and then adding up all those areas to get an estimation
of total area under the curve. Now the more rectangles we use, the better our approximation
is going to be. And with Riemann sums, and this is also the
case with integrals, when the function f encloses
area that is above axis, we treat that area as positive. If the function dips below the
x axis and therefore encloses area between the curve and
the x axis that's below it, treat that area as negative. So what that means is that if we
get a positive result for area, it tells us there's more area enclosed
above the x axis than below it. And if we get a negative
result for area, that means there's more area
enclosed below the x axis than there is above it. Now when we're
using a Riemann sum, there are three different
approximations that we can make for area. The first one is
a left endpoint approximation. So we've zoomed in here to the
curve and the area under the curve. And what we can see is that
we've used all these smaller rectangles to kind
of approximate area. And the height of each
rectangle is found at the left edge of the rectangle. So look at this biggest
rectangle here on the right. The dot, the point where
it intersects the curve, is on the left side
of the rectangle. So this is a left endpoint
approximation of area under the curve. When we're using a left
Riemann sum or a left endpoint approximation, we use this
formula here to estimate area. When we use a right endpoint
approximation or a right Riemann sum, we use this formula here
and when we use a midpoint approximation or a
midpoint Riemann sum, then this is our area formula. Now we're going to go through
some problems step by step here, but in general, this is
what the Riemann sum is doing. To estimate area, we're adding up
the area of a bunch of rectangles. Remember that we can find the area of
each rectangle as width times height. Well this delta x right here
is the width of each rectangle and this f of x sub I is the
height of each rectangle. So this sum really is saying
take the height of each rectangle, multiply it by
the width of each rectangle, that's going to give us
area of one rectangle. Start with the I equals first
rectangle and go all the way to the nth rectangle,
the last rectangle. So add up all the areas of
the individual rectangles, and that's going to give
us the area approximation. And that sum expanded just
looks like finding the height at each endpoint, adding
up all the heights, and then multiplying by this
consistent rectangular width. So looking at this diagram
here of the left endpoint approximation, here's how
we can see that visually. Using these left endpoints here, the height of each rectangle
is given by this length here, then this length,
then this length, then this length, all
the way up to the last rectangle. So we have the left
side of each rectangle. Those heights are here, here, and here all the way up
to the last rectangle. So we take all those
heights, we add them up, then we multiply by delta x
which is that width And the width here, delta x, is
just this same consistent width right here,
the width of each rectangle. And regardless of whether
we're doing a left, right, or midpoint approximation, the
concept is always the same. Add up all the heights,
multiply by the width, and we'll get that
area estimation. So let's look at an example. We've been given this function here
g of x and we're asked to approximate the area under the
curve on the interval two to eight with three equal
subintervals or another way of putting that is three rectangles
that have equal width. And we want to estimate
area using left endpoints, right endpoints, and midpoints. So that being said, here's the step by step process
that we'll use every single time to calculate a Riemann sum. The first thing we need
to do is find delta x, the width of the rectangles. And we do that with
this formula here. We say delta x is
going to be equal to, we take the width of
the entire interval. So we're looking at the
interval here two to eight. So to find its width, we
just take eight minus two, that's the width of
the entire interval. Then we're going to divide that
by the number of rectangles we're using or the number of
equally wide subintervals which in this case we've been
told is n equals three. This formula here is just
b minus a divided by n or the width of the interval divided
by the number of rectangles. So in our case that's six
divided by three which is two. So the width of each rectangle is
gonna be two units in this case. Then we wanna divide our sub
interval into rectangles each with width delta x. So we're looking at this
interval here two to eight. So we'll say two all
the way up to eight. Each rectangle is
gonna have width two, which means the first rectangle is
gonna span from two to four. And then the second rectangle
is gonna span from four to six. And then the last rectangle is
gonna span from six to eight. And there are our three
rectangles, n equals three, one, two, and three rectangles. Now we've been asked
to use left endpoints, right endpoints, and midpoints. We're gonna do all three
calculations in the same example. So if we picture these
as our three rectangles, we can see that left
endpoints of these rectangles are going to be two, four, and six leaving out
this value eight. But if we use right endpoints, the right side of each of
these three rectangles is four, six, and eight. And if we use midpoints, then we're looking at the value
in the middle of each rectangle. So for this rectangle
that spans two to four, the midpoint is three. The middle of the rectangle that
goes from four to six is five, and the middle of the rectangle that
goes from six to eight is seven. Now we've identified all of the
points we'll use to plug into g of x to find the height of
the curve at each of those points. Remember we already know
width delta x equals two. Rectangles are always
just height times width. So all we have left to
do is calculate the heights at all these points here and then
we'll have everything we need to get our area estimates. So our next step is to
evaluate the function g at two, four, six, eight,
three, five, and seven. Those are all the
values we need. So let's just look
at one example. So if we find g of two, we plug two into the
right hand side here, get two cubed is eight, eight times a negative
one half is negative four, two squared is four, four times
five is twenty, so plus twenty, two times three is six so we
get a minus six and then a minus eight and the result
there is a positive two. So g of two is two. So the value of the function
g at x equals two or the height of the rectangle
at x equals two is two. So let's go ahead and put
that here next to that value. G of four is twenty eight. If we plug four into
g, we get twenty eight. If we plug in six,
we get forty six. So the height
there is forty six. This is twenty eight.
This is forty six. And g of eight is thirty two. G of three is
twenty nine halves. At x equals five we find
seventy nine halves and at x equals seven we find
eighty nine halves. So we calculate each
of those heights. And now we can say that the
left endpoint approximation, so we'll say here the left
endpoint approximation of the Riemann sum with r equals
three rectangles is going to be equal to the
value of delta x, the width of the rectangles
two multiplied by each of the heights that we found for
these left endpoints here. So g of two, g of four, and g of six
or two, twenty eight, and forty six. So two plus twenty eight plus forty six and the result there is
a value of one hundred fifty two. So left endpoints with three
rectangles estimate area under the curve to be one hundred
and fifty two square units. If we look at right
endpoints and midpoints, the Riemann sum approximation
is going to be equal to for right endpoints, again,
always have delta x equals two and then right endpoints here
we have twenty eight plus forty six plus thirty two. So twenty eight plus forty six plus thirty two. And that's going give us an
approximation of two twelve. And then midpoints with three
rectangles is going to give us delta x, the width times
the sum of all the heights. So we'll take twenty
nine halves plus seventy nine halves plus eighty nine halves and the
result there is one hundred ninety seven. Now if we actually
integrate the function g, if we actually took the
integral here of this function and we calculated area exactly, the value we would get there
is one hundred and ninety two. And so if we plot these
estimations and exact area on a number line, what we see
is that we get a left endpoint approximation at one
hundred fifty two. Let's maybe put that here at
one hundred and fifty two. This is the left
endpoint approximation. The midpoint approximation
is one hundred ninety seven. We'll maybe put that here,
one hundred ninety seven. That's midpoint. The right endpoint
is two twelve. So that's up here, Two twelve, that's the right endpoint. And then exact area is at
one hundred ninety two. So we'll put that here,
one hundred ninety two. And that is what
we'll call exact. What we can see here is that
for this particular function g of x, left endpoints
underestimate actual area, right endpoints
overestimate actual area, midpoints still do
overestimate actual area, but they get by far the closest
to exact area and that will usually be the case. Midpoints are usually going to
do a better job estimating area under the curve compared
to left or right endpoints. Now the last thing we want to
do here is say that we don't always have to have the
function g in order to calculate a Riemann sum. We can also do
this from a table. So let's say that instead of
this function all we're given is a table of values for
g at these values of x, x one to eleven and we're asked
maybe to use a right Riemann sum with n equals five. So let's say that we're doing
a right Riemann sum and we have n equals five and we want
to estimate the area under g of x on the entire interval
shown in the table from x equals one to x equals eleven. So as always with a Riemann sum
we start by finding delta x. So delta x is always
equal to b minus a divided by n or in this
case eleven minus one, the width of the
interval, divided by n, the number of rectangles and we
can see that that's ten divided by five or two. So again our width is two. That means then that our first
rectangle is going to span the interval one to three and
therefore that the right endpoint of that rectangle is going
to be at x equals three and therefore that the
height at x equals three is going to be this value here. The height of the rectangle
from one to three is five. The next rectangle is going
to go from three to five. The right endpoint of
that is going to be five. So this is the height
there and if we keep going, these are all of our right
endpoints twenty nine, fifty three, and eighty five. Those are the five heights
for the n equals five rectangles. Which means then that
the right Riemann sum with five rectangles is
going to be equal to delta x two multiplied by g of
three plus g of five plus g of seven plus g of nine
plus g of eleven or simply these heights here,
five plus thirteen plus twenty nine plus fifty
three plus eighty five. And when we do that math, we find an area approximation
of three seventy square units. And we can see how we can get
that Riemann sum estimation from a table or directly from
the function itself like we did in the previous example.