Integrals 215 problem 01.mws

1. Estimating area under a curve.

In first semester calculus, you used Riemann sums to estimate the area under a curve. If an interval [a,b] is divided into n equal parts, and we use left end points to evaluate the function, let us develop a formula for the Riemann sum corresponding to this situation. Recall that the Riemann sum is given by

(b-a)/n*Sum(f(c[i]),i = 1 .. n)

and for left sums, c[i] = x[i-1] , where x[i] = a+i*(b-a)/n . This allows us to define a formula for left hand sums as follows.

> ls:=n->(b-a)/n*sum(f(a+(i-1)*(b-a)/n),i=1..n);

ls := proc (n) options operator, arrow; (b-a)/n*sum...

Let us use this formula to estimate the area under the curve y = x^2+x+1 , on the domain [0,1].

First we define the function.

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

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

Then we tell Maple the endpoints of the interval.

> a:=0;b:=1;

a := 0

b := 1

Let us estimate the area by using n = 100 .

> ls(100);


Recall that to convert the answer to a decimal approximation, you use the evalf command. The percentage sign means to use the value of the last Maple command output as the input to this command.

> evalf(%);


We can compute the area under the curve by taking a limit in Maple.

> limit(ls(n),n=infinity);


> evalf(%);


The limit is pretty close to the estimate using n = 100 . But you would not want to evaluate the Riemann sum by hand. We can also evaluate the area using integration and the fundamental theorem of calculus. Maple can compute this integral for us.

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



For the arctan function,

(a) Estimate the area under the curve over the interval [0,1] by using left hand sums for n=1000.

(b) Compute the area by using the limit of the left hand sums.

(c) Verify your answer by using Maple's definite integral command.

Submission worksheet:


2. Approximating area by rectangles.

This exercise will show you how to approximate the area under a curve by rectangles. To begin, you need to load the package student, by entering the command below:

> with(student);

[D, Diff, Doubleint, Int, Limit, Lineint, Product, ...
[D, Diff, Doubleint, Int, Limit, Lineint, Product, ...

Look up the syntax for the rightbox command using the help menu. We can use this command to draw the following pictures:

> f:=x->x^2;

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

> rightbox(f(x),x=0..1,5);

[Maple Plot]

We can increase the number of boxes (rectangles) and draw the following:

> rightbox(f(x),x=0..1,20);

[Maple Plot]

Next, look up the syntax for the rightsum command, and use it to calculate the sums corresponding to the areas of the boxes in our figures.

> rightsum(f(x),x=0..1,5);

1/5*Sum(1/25*i^2,i = 1 .. 5)

Notice that the answer is given as a sum using sigma notation, and not as a number. To get a number for the answer,

you can proceed in various manners. You can use the value command to get a fraction for the answer, the evalf command to obtain a decimal approximation, or simply place the cursor on your result and right click to get a menu

which will allow you to choose the format for the output.

Error, missing operator or `;`

> value(%);


> evalf(%);


Let's do rightsum when n = 20 .

> rightsum(f(x),x=0..1,20);

1/20*Sum(1/400*i^2,i = 1 .. 20)

> value(%);


> evalf(%);


Finally, use Maple to compute Limit(S[n],n = infinity) by using the limit command as follows:

> Limit(rightsum(f(x),x=0..1,n),n=infinity);

Limit(1/n*Sum(i^2/n^2,i = 1 .. n),n = infinity)

OK, lets do it again with a lower case l !

> limit(rightsum(f(x),x=0..1,n),n=infinity);




(a) Repeat this process, but now use leftbox and leftsum, and use the same values for n.

(b) Repeat this process, but now use middlebox and middlesum, and use the same values for n.

(c) You should get different values for the six sums using finite values for n! What happens when you take the limit

in all three cases? Write a paragraph explaining what you see regarding the three limits. Be sure to explain

why all three are the same.

Submission worksheet:


3. More on approximating areas.

Now consider the function f(x) = cos(x) over the interval [ 0, 3/2*pi ].


(a) Repeat the process of activity 1, plotting 9 graphs corresponding to n=10,30,50 with right, middle and left box.

(b) Compute the 9 sums corresponding to each plot.

(c) Compute the three limits corresponding to right, middle and left box.

(d) From the answers you got in (c) and not using any computation what are the areas between the graph of f(x) = cos(x) and the x-axis, on the intervals [ 0, Pi/2 ], [ Pi/2, Pi ], [ Pi/2, 3*Pi/2 ], and finally [ 0, 2*Pi ] ?

Submission worksheet: