Introduction to Integration – Area under the Curve – Riemann Sums using Rectangles

In the previous article, we learned that the integral of a function is finding the area under the curve of a function. The notation for the definite integral of a function is:

Where a is the lower limit of the interval, b is the upper limit of the interval, f(x) is the function we want to integrate, and dx is the width of each sub area under the integral.

If the curve is composed of straight-line segments, then the area under the curve can be easily computed by simply breaking the area underneath the curve into simple shapes, compute the area of each shape, and adding the individual areas:

However, if we are given a function that is composed of curves and not line segments, finding the area under the curve can be more challenging.

For example, let’s say you were asked to estimate the area of the following curve y = 1- x2 on the interval of [0,1]:

Of course, finding the exact area under the curve would be very difficult. We cannot break up the area under the curve into simple shapes. However, you can approximate the area by using rectangles.

Therefore, to find the approximation of the area under the curve, you need to find the area of each rectangle and add them up. However, there are still gaps inside the curve that the rectangles do not cover. Therefore, this approximation could be improved.

If more rectangles are added, the approximation improves:



These approximations are called Riemann sums. If we want to calculate the area between the graph of a positive function f and the x–axis on a specified interval [a, b], the Riemann sum method can be used to build several rectangles with bases on the interval [a, b] and sides that reach up to the graph of f. The area of the region formed by the rectangles is an approximation of the area we want.

Formula: Rectangular Riemann Sums

A Riemann sum for a function f(x) over an interval [a, b] is the sum of areas of rectangles that approximates the area under the curve. The interval [a,b] is divided into n sub-partitions. Each sub-interval will be the base of one rectangle. Each rectangle has the same base length Δx. The height of each rectangle comes from the function evaluated at some point in its sub-interval. Therefore, the Riemann sum is:

The upper-case Greek letter Sigma Σ is used to stand for sum. Sigma notation is a way to succinctly represent a sum of many similar terms, such as a Riemann sum.

The base length of each rectangle is called sub-partitions or sub-intervals. To find the length of each sub-interval, use the formula:

\Deltax= length of each sub-interval

n = number of rectangles (or intervals)

a = start of the interval

b = end of the interval

In this article, we will focus on 3 types of Riemann sums: Left-endpoint, right-endpoint, and midpoint. We will examine a function and approximate the area under the curve using all three methods.

Left-hand Riemann sums

Left-hand Riemann sums are formed by making each rectangle touch the curve with their top-left corners.  The approximation of the area under the curve using this method is called the left-endpoint approximation.

Example 1:  Estimate the area under the curve of y = x2 on the interval of [0,2] using the left-hand Riemann sums.

  • Approximate the Riemann sum using 2, 4, and 6 rectangles. Draw a diagram of your results.
  • Are these estimates overestimates or underestimates of the area under the curve?
  • Use an integral calculator to find the exact area of the curve.

Solution:

Let’s graph function  y = x2 on the coordinate plane:

2 Rectangles

First, we need to find the length of each sub-partition, or base, of each rectangle.

Use the formula

n = number of rectangles

a = start of the interval

b = end of the interval

In the problem b = 2, a= 0, and n =2, so let’s apply the formula:

Therefore, the length of the base of each rectangle is 1. Now we will find the value of each x value going by 1 starting from a = 0:

x a = 0 1 b = 2
f(x) 0 1 4

Next, we need to figure out the height of each rectangle.

Our first rectangle is on the interval of [0,1].  Since we are using a left-endpoint estimate, its top-left vertex should be on the curve where x = 0, so its y value is f (0) = 0. The area of the first rectangle is therefore A1= b * h = 1 * 0 = 0

Our second rectangle is on the interval of [1,2].  Since we are using a left-endpoint estimate, its top-left vertex should be on the curve where x = 1, so it’s y value is f (1) = 1.

The area of the second rectangle is A2= b * h = 1 * 1 = 1

Finally, let’s add the areas of each rectangle:

A1+ A2= 0 + 1 = 1

The approximate area under the curve is 1 square units.

Below is a visual of the Riemann sum estimate:

Looking at the graph, this is an underestimate of the area because the rectangles fall below the curve.

4 Rectangles

First, we need to find the length of each sub-partition, or base, of each rectangle.

Use the formula

n = number of rectangles

a = start of the interval

b = end of the interval

In the problem b = 2, a= 0, and n = 4, so let’s apply the formula:

Therefore, the length of the base of each rectangle is ½. Now we will find the value of each x value going by ½ starting from a = 0:

x a = 0 1/2 1 1.5 b = 2
f(x) 0 0.25 1 2.25 4

Next, we need to figure out the height of each rectangle.

Our first rectangle is on the interval of [0,½ ].  Since we are using a left-endpoint estimate, its top-left corner should be on the curve where x = 0, so it’s y value is f(0) = 0.

The area of the first rectangle is therefore A1= b * h = 1/2 * 0 = 0

Our second rectangle is on the interval of [½ ,1].  Since we are using a left-endpoint estimate, its top-left corner should be on the curve where x = 1/2, so it’s y value is f(½ ) = 0.25.

The area of the second rectangle is A2= b * h = 1/2 * 0.25 = 0.125

Our third rectangle is on the interval of [1 ,1.5].  Since we are using a left-endpoint estimate, its top-left corner should be on the curve where x = 1, so it’s y value is f(1) = 1.

The area of the third rectangle is A3= b * h = 1/2 * 1 = 0.5

Our fourth rectangle is on the interval of [1.5 ,2].  Since we are using a left-endpoint estimate, its top-left corner should be on the curve where x = 1.5, so it’s y value is f(1.5) = 2.25.

The area of the fourth rectangle is A4= b * h = 1/2 * 2.25 = 1.125

Finally, let’s add the areas of each rectangle:

A1+ A2+ A3+A4= 0 + 0.125+0.5+1.125 = 1.75

The approximate area under the curve is 1.75 square units. Below is a graph of the approximation:

Looking at the graph, this is an underestimate of the area because the rectangles fall below the curve.

6 Rectangles

First, we need to find the length of each sub-partition, or base, of each rectangle.

Use the formula

n = number of rectangles

a = start of the interval

b = end of the interval

In the problem b = 2, a= 0, and n= 6, so let’s apply the formula:

Therefore, the length of the base of each rectangle is 1/3. Now we will find the y value of each x value going by 1/3 starting from a = 0:

x a = 0 1 4/3 5/3 b = 2
f(x) 0 0.111 0.444 1 1.778 2.778 4

Next, we need to figure out the height of each rectangle. 

Our first rectangle is on the interval of [0, 1/3].  Since we are using a left-endpoint estimate, its top-left corner should be on the curve where x = 0, so it’s y value is f(0) = 0.

The area of the first rectangle is therefore A1= b * h = 1/3 * 0 = 0

Our second rectangle is on the interval of [⅓ ,⅔ ].  Since we are using a left-endpoint estimate, its top-left corner should be on the curve where x = ⅓, so it’s y value is f(⅓ ) = 0.111.

The area of the second rectangle is A2= b * h = 1/3 * 0.111 = 0.037

Our third rectangle is on the interval of [⅔ ,1].  Since we are using a left-endpoint estimate, its top-left corner should be on the curve where x = ⅔, so it’s y value is f(⅔ ) = 0.444.

The area of the third rectangle is A3= b * h = 1/3* 0.444 = 0.148

Our fourth rectangle is on the interval of [1 ,4/3].  Since we are using a left-endpoint estimate, its top-left corner should be on the curve where x = 1, so it’s y value is f(1) = 1.

The area of the fourth rectangle is A4= b * h = 1/3 * 1 = 0.333

Our fifth rectangle is on the interval of [4/3 ,5/3].  Since we are using a left-endpoint estimate, its top-left corner should be on the curve where x = 4/3, so it’s y value is f(4/3) = 1. 778.

The area of the fifth rectangle is A5= b * h = 1/3 * 1.778 = 0.592

Our sixth rectangle is on the interval of [5/3 ,2].  Since we are using a left-endpoint estimate, its top-left corner should be on the curve where x = 5/3, so it’s y value is f(5/3) = 2. 778.

The area of the sixth rectangle is A6= b * h = 1/3 * 2.778 = 0.926

Now let’s add the areas of each areas:

A1+ A2+ A3+A4+ A5+A6= 0+0.037+0.148+0.333+0.592+0.926 =2.036

The approximate area under the curve is 2.036 square units. Below is a graph of the approximation:

Looking at the graph, this is an underestimate of the area because the rectangles fall below the curve.

From our estimates, L2=1 square unit,  L4= 1.75 square units, and  L6=2.036 square units.

Let’s use an integral calculator to find the exact area underneath the curve:

As you can see, the more rectangles we use, the more accurate our estimates become.

Right-hand Riemann sums

Right-hand Riemann sums are formed by making each rectangle touch the curve with their top-right corners. The approximation of the area under the curve using this method is called the right-endpoint approximation.

Example 2:  Estimate the area under the curve of y = x2 on the interval of [0,2] using the right-hand Riemann sums.

  • Approximate the Riemann sum using 2, 4, and 6 rectangles. Draw a diagram of your results.
  • Are these estimates overestimates or underestimates of the area under the curve?
  • Use an integral calculator to find the exact area of the curve.

Solution:

Let’s graph function  y = x2 on the coordinate plane:

2 Rectangles

First, we need to find the length of each sub-partition, or base, of each rectangle.

Use the formula

n = number of rectangles

a = start of the interval

b = end of the interval

In the problem b = 2, a= 0, and n =2, so let’s apply the formula:

Therefore, the length of the base of each rectangle is 1. Now we will find the value of each x value going by 1 starting from a = 0:

x a = 0 1 b = 2
f(x) 0 1 4

Next, we need to figure out the height of each rectangle.

Our first rectangle is on the interval of [0,1].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = 1, so it’s y value is f(1) = 1.

The area of the first rectangle is therefore A1= b * h = 1 * 1 = 1

Our second rectangle is on the interval of [1,2].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = 2, so it’s y value is f(2) = 4.

The area of the second rectangle is A2= b * h = 1 * 4 = 4

Finally, let’s add the areas of each rectangle:

A1+ A2= 1 + 4 = 5

The approximate area under the curve is 4 square units.

Below is a visual of the Riemann sum estimate:

Looking at the graph, this is an overestimate of the area because the rectangles rise above the curve.

4 Rectangles

First, we need to find the length of each sub-partition, or base, of each rectangle.

Use the formula

n = number of rectangles

a = start of the interval

b = end of the interval

In the problem b = 2, a= 0, and n = 4, so let’s apply the formula:

Therefore, the length of the base of each rectangle is ½. Now we will find the value of each x value going by ½ starting from a = 0:

x a = 0 1/2 1 1.5 b = 2
f(x) 0 0.25 1 2.25 4

Next, we need to figure out the height of each rectangle.

Our first rectangle is on the interval of [0,½ ].  Since we are using a left-endpoint estimate, its top-right corner should be on the curve where x = 0, so its y value is f(½) = 0.

The area of the first rectangle is therefore A1= b * h = 1/2 * 0.25 = 0.125

Our second rectangle is on the interval of [½ ,1].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = 1, so it’s y value is f(1) = 0.25.

The area of the second rectangle is A2= b * h = 1/2 * 1 = 0.5

Our third rectangle is on the interval of [1 ,1.5].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = 1.5, so its y value is f(1.5) = 2.25.

The area of the third rectangle is A3= b * h = 1/2 * 2.25 = 1.125

Our fourth rectangle is on the interval of [1.5 ,2].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = 2, so its y value is f(2) = 4.

The area of the fourth rectangle is A4= b * h = 1/2 * 4 = 2

Finally, let’s add the areas of each rectangle:

A1+ A2+ A3+A4=  0.125+0.5+1.125 + 2 = 3.75

The approximate area under the curve is 3.75 square units. Below is a graph of the approximation:

Looking at the graph, this is an overestimate of the area because the rectangles rise above the curve.

6 Rectangles

First, we need to find the length of each sub-partition, or base, of each rectangle.

Use the formula

n = number of rectangles

a = start of the interval

b = end of the interval

In the problem b = 2, a= 0, and n= 6, so let’s apply the formula:

Therefore, the length of the base of each rectangle is 1/3. Now we will find the y value of each x value going by 1/3 starting from a = 0:

x a = 0 1 4/3 5/3 b = 2
f(x) 0 0.111 0.444 1 1.778 2.778 4

Next, we need to figure out the height of each rectangle.

Our first rectangle is on the interval of [0, 1/3].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = 1/3, so its y value is f(1/3) = 0.111.

The area of the first rectangle is therefore A1= b * h = 1/3 * 0.111 = 0.037

Our second rectangle is on the interval of [⅓, ⅔ ].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = ⅔, so its y value is f(⅔ ) = 0.444.

The area of the second rectangle is A2= b * h = 1/3 * 0.444 = 0.148

Our third rectangle is on the interval of [⅔ ,1].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = 1, so its y value is f(1) = 1.

The area of the third rectangle is A3= b * h = 1/3* 1 = 0.333

Our fourth rectangle is on the interval of [1 ,4/3].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = 4/3, so its y value is f(4/3) = 1.778.

The area of the fourth rectangle is A4= b * h = 1/3 * 1.778 = 0.592

Our fifth rectangle is on the interval of [4/3 ,5/3].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = 5/3, so its y value is f(5/3) = 2. 778.

The area of the fifth rectangle is A5= b * h = 1/3 *21.778 = 0.926

Our sixth rectangle is on the interval of [5/3 ,2].  Since we are using a right-endpoint estimate, its top-right corner should be on the curve where x = 2, so its y value is f(2) = 4.

The area of the sixth rectangle is A6= b * h = 1/3 * 4 = 1.333

Now let’s add the areas of each areas:

A1+ A2+ A3+A4+ A5+A6=0.037+0.148+0.333+0.592+0.926 + 1.333 =3.369

The approximate area under the curve is 3.369 square units. Below is a graph of the approximation:

Looking at the graph, this is an overestimate of the area because the rectangles rise above the curve.

From our estimates, R2=4 square units, R4= 3.75 square units, and R6=3.369square units.

Let’s use an integral calculator to find the exact area underneath the curve:

Midpoint Riemann Sums

In Midpoint Riemann sums, the height of each rectangle is equal to the value of the function at the midpoint of its base. The approximation of the area under the curve using this method is called the midpoint approximation.

Example 3:  Estimate the area under the curve of y = x2 on the interval of [0,2] using the Riemann sums.

  • Approximate the Riemann sum using 2, 4, and 6 rectangles. Draw a diagram of your results.
  • Use an integral calculator to find the exact area of the curve.
  • Are these estimates overestimates or underestimates of the area under the curve?

Solution:

Let’s graph function  y = x2 on the coordinate plane:

2 Rectangles

First, we need to find the length of each sub-partition, or base, of each rectangle.

Use the formula

n = number of rectangles

a = start of the interval

b = end of the interval

In the problem b = 2, a= 0, and n =2, so let’s apply the formula:

Therefore, the length of the base of each rectangle is 1. Now we will find the value of each x value going by 1 starting from a = 0:

x a = 0 1 b = 2
f(x) 0 1 4

Next, we need to figure out the height of each rectangle.

Our first rectangle is on the interval of [0,1].  Since we are using a midpoint estimate, the height of the triangle will be when x = 0.5, so the height is f(0.5) = 0.25.

The area of the first rectangle is therefore A1= b * h = 1 * 0.25 = 0.25

Our second rectangle is on the interval of [1,2].  Since we are using a midpoint estimate, the height of the triangle will be when x = 1.5, so the height is f(1.5) = 2.25.

The area of the second rectangle is A2= b * h = 1 * 2.25 = 2.25

Finally, let’s add the areas of each rectangle:

A1+ A2= 0.25 + 2.25 = 2.50

The approximate area under the curve is 2.50 square units.

Below is a visual of the Riemann sum estimate:

4 Rectangles

First, we need to find the length of each sub-partition, or base, of each rectangle.

Use the formula

n = number of rectangles

a = start of the interval

b = end of the interval

In the problem b = 2, a= 0, and n = 4, so let’s apply the formula:

Therefore, the length of the base of each rectangle is ½. Now we will find the value of each x value going by ½ starting from a = 0:

x a = 0 1/2 1 1.5 b = 2
f(x) 0 0.25 1 2.25 4

Next, we need to figure out the height of each rectangle.

Our first rectangle is on the interval of [0,½ ].  Since we are using a midpoint estimate, the height of the triangle will be when x = 0.25, so the height is f(0.25) = 0.063.

The area of the first rectangle is therefore A1= b * h = 1/2 * 0.063 = 0.0315

Our second rectangle is on the interval of [½ ,1].  Since we are using a midpoint estimate, the height of the triangle will be when x = 0.75, so the height is f(0.75) = 0.563.

The area of the second rectangle is A2= b * h = 1/2 * 0.563 = 0.2815

Our third rectangle is on the interval of [1 ,1.5].  Since we are using a midpoint estimate, the height of the triangle will be when x = 1.25, so the height is f(1.25) = 1.563.

The area of the third rectangle is A3= b * h = 1/2 * 1.563 = 0.7815

Our fourth rectangle is on the interval of [1.5 ,2].  Since we are using a midpoint estimate, the height of the triangle will be when x = 1.75, so the height is f(1.75) = 3.063.

The area of the fourth rectangle is A4= b * h = 1/2 * 3.063 = 1.5315

Finally, let’s add the areas of each rectangle:

A1+ A2+ A3+A4= 0.0315 + 0.2815+0.7815+1.5315 = 2.626

The approximate area under the curve is 2.626 square units. Below is a graph of the approximation:

6 Rectangles

First, we need to find the length of each sub-partition, or base, of each rectangle.

Use the formula

n = number of rectangles

a = start of the interval

b = end of the interval

In the problem b = 2, a= 0, and n= 6, so let’s apply the formula:

Therefore, the length of the base of each rectangle is 1/3. Now we will find the y value of each x value going by 1/3 starting from a = 0:

x a = 0 1 4/3 5/3 b = 2
f(x) 0 0.111 0.444 1 1.778 2.778 4

Next, we need to figure out the height of each rectangle.

Our first rectangle is on the interval of [0, 1/3]. Since we are using a midpoint estimate, the height of the triangle will be when x = 1/6, so the height is f(1/6) = 0.028.

The area of the first rectangle is therefore A1= b * h = 1/3 * 0.028 = 0.0093

Our second rectangle is on the interval of [⅓,⅔ ].   Since we are using a midpoint estimate, the height of the triangle will be when x = 1/2, so the height is f(1/2) = 0.25.

The area of the second rectangle is A2= b * h = 1/3 * 0.25 = 0.0833

Our third rectangle is on the interval of [⅔ ,1].   Since we are using a midpoint estimate, the height of the triangle will be when x = 5/6, so the height is f(5/6) = 0.694.

The area of the third rectangle is A3= b * h = 1/3* 0.694 = 0.2313

Our fourth rectangle is on the interval of [1 ,4/3].   Since we are using a midpoint estimate, the height of the triangle will be when x = 7/6, so the height is f(7/6) = 1.361.

The area of the fourth rectangle is A4= b * h = 1/3 * 1.361 = 0.4536

Our fifth rectangle is on the interval of [4/3 ,5/3].   Since we are using a midpoint estimate, the height of the triangle will be when x = 3/2, so the height is f(3/2) = 2.25.

The area of the fifth rectangle is A5= b * h = 1/3 * 2.25 = 0.75

Our sixth rectangle is on the interval of [5/3 ,2].   Since we are using a midpoint estimate, the height of the triangle will be when x = 11/6, so the height is f(11/6) = 3.361.

The area of the sixth rectangle is A6= b * h = 1/3 * 3.361 = 1.120

Now let’s add the areas of each areas:

A1+ A2+ A3+A4+ A5+A6= 0.0093+0.0833+0.2313+0.4536+0.75+1.120 =2.6475

The approximate area under the curve is 2.6475 square units. Below is a graph of the approximation:

From our estimates, M2=2.50 square units, M4= 2.626 square units, and M6=2.647 square units.

Let’s use an integral calculator to find the exact area underneath the curve:

M2, M4, and M6 is less than the exact area, so our midpoint approximations are underestimates.

Summary of Section

Riemann sums is an approximation of the area under the curve. The sum is calculated by dividing the region into shapes (such as rectangles) that form the area under the curve, calculating the area of each rectangle, then adding all the areas together.

Because the area occupied by the rectangles isn’t usually exactly the same shape as the area under the curve, the Riemann sum will be different from the area being measured. This error can be lowered by dividing up the region into more rectangles.

The sum of all the rectangles can be summarized using sigma notation:

Using the number of subintervals, or rectangles, you want to use (n) and the length of the interval (b-a), then the length of each subinterval, or the base of each rectangle, is

References:
https://www.khanacademy.org/math/ap-calculus-ab/ab-integration-new/ab-6-2/a/left-and-right-riemann-sums
http://scidiv.bellevuecollege.edu/dh/Calculus_all/CC_4_1_SigmaNot.pdf
http://www.opentextbookstore.com/appcalc/Chapter3-1.pdf