

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


In Maple's " student" library, there are several commands that can be used to illustrate
the computation of integrals via Riemann sums. To use these commands, you must first
enter the command:
> restart:
> with(student):
The colon at the end of the line surpresses the output (if you use a semicolon, you will get
a list of all of the commands available in the student library).
We demonstrate the use of the commands by working through the following example: Use
Riemann sums to compute:
> Int(1/t,t=1..2);
ó
ô
ô
ô
õ
1
2
t
dt
Recall that the " Int" command with a capital I is used to get Maple just to type integrals.
It does not evaluate them -- the " int" command with a small i does that. But the form of
the two int (for integral) commands is the usual verb(what,how); form of many Maple
commands. Before the comma, you enter the (name of the) expression to be integrated
("Integrate what?") and after the comma you give the name of the variable and the range of
integration ("Integrate it how?").
We will illustrate only the left-hand sums. Maple has three relevant commands: " leftbox
", which draws pictures, " leftsum", which gives summation notation for the area under
the left boxes, and "value", which computes the sums (evalf can also be used). So, as we
approximate the above integral using 10 rectangles which touch the curve on the left, we
can have Maple illustrate the boxes by typing:
> leftbox(1/t,t=1..2,10);
1 1.2 1.4 1.6 1.
1
t
2
0
The syntax of leftbox matches that of int, except it has a third argument which
specifies the number of boxes to be used to approximate the integral.
Notice that in this case, the sum of the areas of the boxes gives an overestimate of the area
under the curve because the curve is concave up.
To calculate the sum of the areas of the boxes, use the command
> leftsum(1/t,t=1..2,10);
i = 0
9
i
box is equal to 1/10*(1/(1+i/10)). Notice that 1/10 is
t and the other factor is the
value of the function 1/t at the left side of the box. To calculate the sum, we can ask Maple
for: