Application Center - Maplesoft

# Riemann sums and the definite integral

You can switch back to the summary page by clicking here.

L25-definiteIntegral.mws

Calculus I

Lesson 25: Riemann Sums and the Definite Integral

In this lesson, we view some more examples of left- and right-sided Riemann sums and show their relationship to the definite integral.

> restart: with(student): with(plots):

```Warning, the name changecoords has been redefined
```

Example 1

Let f ( x ) = .

a) Plot f ( x ) for positive x values.

b) Plot `left endpoint rectangles' for x from 0 to 4 using 8 rectangles.

c) Have Maple calculate a `leftsum' for the above rectangles.

d) Increase the number of rectangles to 16 and repeat parts (b) and (c).

e) Increase the number of rectangles to 128 and repeat parts (b) and (c).

f) What happens to the area of the rectangles as the number of rectangles increases?

g) Compute the integral of f ( x ) for x from 0 to 4.

> f:= x -> x^2 + 3;

> plot(f(x), x = 0..4, color = blue);

> leftbox(f(x), x = 0..4, 8, color = blue, shading = magenta);

> leftsum(f(x), x = 0..4, 8);

> evalf(%);

> leftbox(f(x), x = 0..4, 16, color = blue, shading = magenta);

> leftsum(f(x), x = 0..4, 16);

> evalf(%);

> leftbox(f(x), x = 0..4, 128, color = blue, shading = magenta);

> leftsum(f(x), x = 0..4, 128);

> evalf(%);

As the number of rectangles increases, the total area of the rectangles limits to

the area of the curve from x = 0 to 4.

> Int(f(x),x);

> int(f(x),x);

> int(f(x),x= 0..4);

> evalf(%);

Example 2

Let g ( x ) = x + 5.

a) Plot g ( x ) for x from 0 to 3.

b) Using triangles and rectangles, compute the area of the graph of g ( x ) for x from 0 to 3.

c) Plot `left endpoint rectangles' for x from 0 to 3 using 3 rectangles.

d) Have Maple calculate a `leftsum' for the above rectangles.

e) Increase the number of rectangles to 12 and repeat parts (c) and (d).

f) Increase the number of rectangles to 243 and repeat parts (c) and (d).

g) What happens to the area of the rectangles as the number of rectangles increases?

h) Compute the integral of g ( x ) for x from 0 to 3.

> g:= x -> x + 5;

> plot(g(x), x = 0..3, y = 0..8, color = blue);

We break the area under the curve into two regions. One a triangle, B, and the

other a rectangle, A. The area of rectangle A i s 3 x 5 = 15 square units.

The area of triangle B is .5 x 3 x 3 = 4.5 square units.

Thus the area under the graph of g from 0 to 3 is 19.5 square units.

> leftbox(g(x), x = 0..3, 3, color = blue, shading = magenta);

> leftsum(g(x), x = 0..3, 3);

> evalf(%);

> leftbox(g(x), x = 0..3, 12, color = blue, shading = magenta);

> leftsum(g(x), x = 0..3, 12);

> evalf(%);

> leftbox(g(x), x = 0..3, 243, color = blue, shading = magenta);

> leftsum(g(x), x = 0..3, 243);

> evalf(%);

> Int(g(x),x);

> int(g(x),x);

> int(g(x), x = 0..3);

> evalf(%);

Example 3

Repeat exercise 1 with `right endpoint rectangles'.

> h:= x -> x^2 + 3;

> rightbox(h(x), x = 0..4, 8, color = blue, shading = magenta);

> rightsum(h(x), x = 0..4, 8);

> evalf(%);

> rightbox(h(x), x = 0..4, 16, color = blue, shading = magenta);

> rightsum(h(x), x = 0..4, 16);

> evalf(%);

> rightbox(h(x), x = 0..4, 128, color = blue, shading = magenta);

> rightsum(h(x), x = 0..4, 128);

> evalf(%);

> Int(h(x),x);

> int(h(x),x);

> int(h(x), x = 0..4);

> evalf(%);

The corresponding right-sided sums are greater than the left-sided.