Application Center - Maplesoft

App Preview:

Riemann sums and the definite integral

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

Learn about Maple
Download Application


 

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 ) = x^2+3 .

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;

f := proc (x) options operator, arrow; x^2+3 end pr...

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

[Maple Plot]

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

[Maple Plot]

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

1/2*Sum(1/4*i^2+3,i = 0 .. 7)

> evalf(%);

29.50000000

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

[Maple Plot]

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

1/4*Sum(1/16*i^2+3,i = 0 .. 15)

> evalf(%);

31.37500000

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

[Maple Plot]

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

1/32*Sum(1/1024*i^2+3,i = 0 .. 127)

> evalf(%);

33.08398438

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(x^2+3,x)

> int(f(x),x);

1/3*x^3+3*x

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

100/3

> evalf(%);

33.33333333

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;

g := proc (x) options operator, arrow; x+5 end proc...

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

[Maple Plot]

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);

[Maple Plot]

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

Sum(i+5,i = 0 .. 2)

> evalf(%);

18.

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

[Maple Plot]

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

1/4*Sum(1/4*i+5,i = 0 .. 11)

> evalf(%);

19.12500000

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

[Maple Plot]

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

1/81*Sum(1/81*i+5,i = 0 .. 242)

> evalf(%);

19.48148148

> Int(g(x),x);

Int(x+5,x)

> int(g(x),x);

1/2*x^2+5*x

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

39/2

> evalf(%);

19.50000000

Example 3

Repeat exercise 1 with `right endpoint rectangles'.

Compare your answers that those from (1).

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

h := proc (x) options operator, arrow; x^2+3 end pr...

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

[Maple Plot]

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

1/2*Sum(1/4*i^2+3,i = 1 .. 8)

> evalf(%);

37.50000000

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

[Maple Plot]

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

1/4*Sum(1/16*i^2+3,i = 1 .. 16)

> evalf(%);

35.37500000

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

[Maple Plot]

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

1/32*Sum(1/1024*i^2+3,i = 1 .. 128)

> evalf(%);

33.58398438

> Int(h(x),x);

Int(x^2+3,x)

> int(h(x),x);

1/3*x^3+3*x

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

100/3

> evalf(%);

33.33333333

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