# Lesson Video: Riemann Sums Mathematics • 12th Grade

In this video, we will learn how to approximate the area under the curve of a function using right, left, and midpoint Riemann sums.

17:36

### Video Transcript

In this video, weβre going to learn how definite integrals can be estimated by using rectangles. And this is a process called finding Riemann sums. Weβll discover how to split the area between the curve and the π₯-axis into rectangles of varying points. And consider how accurate these approximations are by looking at a number of examples of various degrees of difficulty.

Letβs suppose weβre looking to find the area between the curve of π¦ equals π₯ squared, the π₯-axis, and the vertical lines π₯ equals one and π₯ equals three. We know that we can find the exact area using definite integration. We evaluate the integral of π₯ squared between the limits of one and three with respect to π₯. The integral of π₯ squared is π₯ cubed over three. Evaluating this between the limits of one and three, and we obtained three cubed over three minus one cubed over three, which is 26 over three or roughly 8.67 square units. The problem is, integrating a function is not always that simple. And we might just need to approximate the area between the curve and the π₯-axis.

To do that, we have a number of options. And in this video, weβre going to use something called Riemann sums. In this case, weβre going to split the area under the curve into rectangles and then find the area of each. There are three ways we could do this. We could find the height of the rectangles by using the value of the function at the left endpoint of each rectangle, at the right endpoint of each rectangle, or at the midpoint of each rectangle. And on occasion, we might even choose to use unequally sized subintervals, though thatβs quite rare. Letβs go back to this example.

Weβre going to imagine we want to split the area into four subintervals, four equally sized rectangles. To find the width of each rectangle, we find the difference between the bounds of our area. And we share that into π pieces, where π is the number of subintervals. Here, thatβs three minus one all divided by four, which is of course one-half. Each sub interval is therefore 0.5 units wide. Formaly, we say that the width of each rectangle, π₯π₯, is equal to π minus π over π. Where π and π are the endpoints of the interval and π is the number of subintervals. Letβs estimate the area by using the right endpoint of each sub interval. In other words, weβre going to find the height of each rectangle by considering the function value at the right endpoint of each of our subintervals.

Starting at the beginning of our interval, we add 0.5 to one. And we see that the height of this rectangle is equal to the function value at π₯ equals 1.5. Thatβs π of 1.5, which is of course 1.5 squared, which is equal to 2.25. Since the area of a rectangle is found by multiplying the length of its base by its height, we find the area of this one by multiplying 0.5 by 2.25. Which gives us 1.125 square units. Next, we add another 0.5 to 1.5 to give us two. The height of this rectangle is the value of the function at π₯ equals two. Thatβs π of two which is two squared which is, of course, equal to four. This time, the area of the rectangle is four times 0.5, which is two square units. We add then another 0.5 to two to give us 2.5. And when we see that the height of this rectangle would be the value of π at 2.5. π of 2.5 is 2.5 squared, which is 6.25. And so, the area of our third rectangle is 6.25 times 0.5, which is 3.125 square units.

Finally, if we add another 0.5, we get to three. Thatβs the ends of our interval. And itβs the fourth rectangle as required. This time, its height is π of three. Thatβs three squared, which is nine. And therefore, the area of our final rectangle is nine times 0.5, which is 4.5 square units. To find an estimate for the total area under the curve and therefore an estimate to the definite integral between one and three of π₯ squared, we add these together. An estimate then to that integral is 1.125 plus two plus 3.125 plus 4.5, which is 10.75 square units.

Remember, the answer that we got when we evaluated the integral itself was 8.67. And if we look carefully, we can see that our rectangles are all a little bit bigger than the area required. So we would have been expecting an overestimate. We could, of course, make our approximation more accurate by splitting the rectangles into smaller subintervals. And, in fact, as the number of subintervals π approaches infinity, the Riemann sum approaches the definite integral of the function between the endpoints. Itβs important to remember, though, that if the function takes on both positive and negative values as shown here. Then the Riemann sum is the sum of the areas of the rectangles that lie above the π₯-axis and the negatives of the areas of the rectangles that lie below the π₯-axis. In this case, that would be the area of the pink rectangles minus the area of the yellow rectangles. Weβre now going to look at a more formal example of this process, this time using left endpoints.

Given that π of π₯ is equal to four cos π₯ and that π₯ is greater than or equal to zero and less than or equal to π by four, evaluate, to the nearest six decimal places, the Riemann sum for π with six subintervals, taking the sample points to be left endpoints.

Remember, we can approximate the definite integral of a function between the limits of, say, π and π by splitting the area between the curve and the π₯-axis into π subintervals. Where the width of each rectangle, π₯π₯, is equal to the difference between the upper and lower limits divided by π, the number of subintervals. In this question, weβre looking to split the area into six subintervals, so we let π be equal to six. We let π be equal to zero and π be equal to π by four. So π₯π₯ here and the width of each of our rectangles is π by four minus zero over six, which is π over 24. Letβs now sketch out the curve of π¦ equals four cos π₯ between π₯ equals zero and π by four radians and spilt it into these six subintervals.

This question requires us to use left endpoints. So the height of each of our rectangles will be equal to the value of the function at the left of each subinterval. The sketch is really useful here because we see that each rectangle sits above the π₯-axis. So we just need to find the positive area of each. Letβs consider our first rectangle. Its left endpoint is at π₯ equals zero. So we find the height of the rectangle by evaluating π of zero. π of zero is four times cos of zero, which is four. The area of this first rectangle then is therefore π by 24, since thatβs the width of each rectangle, times four. Thatβs π by six square units.

We now need to find the next endpoint. We achieve this by adding π by 24 to zero; thatβs π by 24. And we can therefore find the height of this rectangle by evaluating π of π by 24. Thatβs four cos of π by 24, which is approximately 3.965779 and so on. The area of our second rectangle then is width times height or base times height. Thatβs π by 24 times 3.965 and so on, which is roughly 0.51911931 and so on. Now, of course, this question is asking us to evaluate till six decimal places, which is why Iβve left the numbers as I have. We find the next endpoint by adding another π by 24 to π by 24 and we get π by 12. The height of this third rectangle then is π of π by 12 which is four cos of π by 12, which gives us root six plus root two. And then we see that the area of our third rectangle is π by 24 multiplied by this value, which gives us an area of roughly 0.505 and so on square units.

We repeat this process by repeatedly adding π by 24 to each of our endpoints. And when we do, we find that the left endpoint of each of our rectangles is π by eight, π by six, and π₯ equals five π by 24. Their heights are respectively given by π of π by eight, π of π by six, and π of five π by 24. And when we multiply each of these values by the width, π by 24, we find that the area of our fourth rectangle is roughly 0.4837. Our fifth rectangle is roughly 0.4534. And our sixth is approximately 0.4153. Remember, the Riemann sum is the total area of these six rectangles. Itβs 2.901 and so on. Thatβs 2.901067 correct to six decimal places.

In our next example, weβre going to look at how to find the Riemann sum using midpoints.

Given π of π₯ is equal to π₯ squared minus four and π₯ is greater than or equal to negative four and less than or equal to two, evaluate the Riemann sum for π with six subintervals, taking sample points to be midpoints.

Remember, we can approximate the definite integral of a function between the limits π and π by splitting the area between the curve and the π₯-axis into π subintervals. The width of each rectangle is given by π₯π₯, which is found by subtracting π from π and dividing this value by π. In this example, we want to split the area into six subintervals. So we let π be equal to six, and then π is negative four and π is two. The width of each of our subintervals is given then by two minus negative four over six, which is equal to one. Next, weβre going to sketch the curve of π¦ equals π₯ squared minus four between the endpoints negative four and two. And weβre going to split this into six subintervals.

This question requires us to use midpoints. So the height of each rectangle will be equal to the value of the function at the middle of each subinterval. Thatβs going to look a little something like this. Now, we can work out the π₯-value at the end of each rectangle by repeatedly adding one to four. And that gives us each of these values. We can then see that the midpoints are going to be negative 3.5, π₯ equals negative 2.5, negative 1.5, and so on.

Now, weβre going to need to be extra careful here. We see that some of our rectangles sit below the π₯-axis. This means weβre going to find the negative value of their area. In other words, weβll subtract the total area of the rectangles that sit below the π₯-axis from the total area of the rectangles that sit above the π₯-axis. Letβs begin by finding the function values at each midpoint. And that will tell us the height of each rectangle. Thatβs π of negative 3.5, π of negative 2.5, π of negative 1.5, and so on. And, of course, our function is π₯ squared minus four. And when we substitute each of these values into that function, we get 8.25, 2.25, negative 1.75, negative 3.75, another negative 3.75, and another negative 1.75. We then obtain the area of our first rectangle here to be 8.25 times one.

Our second rectangle has an area of 2.25 times one. Our third rectangle has an area of 1.75 times one, not negative 1.75. Because weβre just dealing with areas at the moment. Our fourth rectangle has an area of 3.75 times one. Base times height with our fifth rectangle is 3.75 times one again. And for our last rectangle, itβs 1.75 times one. The Riemann sum is therefore 8.25 plus 2.25 minus the sum of 1.75, 3.75, 3.75, and another 1.75. And that gives us an approximation to the definite integral between the values of negative four and two of π₯ squared minus four. Itβs negative 0.5. And, of course, π₯ squared minus four is a fairly simple function to integrate. So we can check our answer by evaluating that integral.

When we do, we get π₯ cubed over three minus four π₯ between the limits of negative four and two, which gives us a value of zero. And our estimate of negative 0.5 is pretty close. So we can assume weβve probably done this correctly. Itβs worth noting that a sketch of the curve wonβt always be possible. So instead, we need to notice that when the value of π of π₯ is less than zero, we subtract the area of the rectangle with that height.

Now that weβve considered three types of Riemann sums, letβs have a look at how to decide whether weβre finding a lower or upper estimate for our integral.

A table of values for an increasing function π is shown. Use Riemann sums to find lower and upper estimates for the definite integral between the limits of zero and 20 of π of π₯ with respect to π₯.

Itβs important to know that weβve been given a table of values for an increasing function. This means that over the closed interval zero to 20, the graph of the function will always be sloping up. It might look a little something like this. Now, we know we can find estimates for the integral given by using Riemann sums. So our job here is to work out which Riemann sum is likely to give the lowest estimate and which is likely to give the highest estimate. If we were to find the Riemann sum using the left endpoints, we see we end up with something a little like this. Almost every rectangle is a little smaller than the actual area. When we use right endpoints, we end up with much more than the actual area. It follows also that using the midpoint would give us something in the middle as would using the trapezoidal rule.

This means that using the left endpoint is going to give us a lower estimate and using the right endpoint will give us an upper estimate. Letβs find both of these approximations. We see that the width of our subintervals is four. So we could say that the width of each rectangle is going to be four units. And the area of our first rectangle is going to be four multiplied by the positive value of the function at the left endpoint; thatβs three. The second rectangle will have an area of four times four. The third will have an area of four times nine. Then we have a rectangle with an area of four times 18 and an area of four times 30.

Remembering that the first rectangle sits below the π₯-axis, we subtract this from the sum of the other four. And we get a total area of 232 square units. We now repeat this using the right endpoint. And we see that the area of our first rectangle is four times four. The second is four times nine. Then, we have an area of four times 18, four times 30, and four times 35. This time, each of these rectangles sits above the π₯-axis. So we add all these values together to get a total of 384 square units. The lower and upper estimates of the definite integral of π of π₯ evaluated between zero and 20 are therefore 232 and 384, respectively. In fact, we can generalize the result here. We can say that when working with increasing functions. The left Riemann sum will be an underestimate of the area between the curve and the π₯-axis. Whereas the right Riemann sum will give an overestimate. The reverse, of course, must be true then for decreasing functions.

Suppose π, πΏ, and π are approximations for the definite integral between one and three of π₯ cubed plus one using the trapezoidal rule, left Riemann sum, and right Riemann sum, respectively, using 10 subintervals. Which of the following is the correct relationship between the three approximations? Is it π is less π which is less than πΏ, πΏ is less than π which is less than π, π is less than πΏ which is less than π, or π is less than πΏ, which is less than π?

Letβs consider the function π of π₯ equals π₯ cubed plus one. We know by considering the shape of the curve that itβs an increasing function. Though we could check this by differentiating to get three π₯ squared which is greater than zero for values of π₯ not equal to zero, confirming our suspicions. This really helps because we know that for an increasing function, the left Riemann sum gives an underestimate for the actual area. Letβs call that π΄. And the right Riemann sum gives an overestimate for the actual area. We can therefore say that we know that π΄ must be greater than πΏ which must be less than π. And this, in turn, means that π, of course, must be greater than πΏ.

But where did the estimates for the trapezoidal rule come in here? Well, this uses nothing more than the average of the left and right Riemann sums. So it follows that this approximation must sit between the two. And we obtain that π must be greater than πΏ but less than π. The second is the correct relationship between the three approximations.

In this video, we learned that we can approximate definite integrals by splitting the area between the curve and the π₯-axis into a number of rectangles. Each rectangle have heights of the value of the function at the subintervalβs right endpoints, left endpoints, or midpoints. We also saw that for increasing functions, the left Riemann sum will give a lesser value than the right Riemann sum. And for decreasing functions, the reverse is true.