next up previous
Next: Exercises Up: Discussion Previous: Discussion

Maple Commands

The Maple commands that we want to use are contained in the Student package. To access these commands, begin your session by entering

    with(student);
In addition to loading the commands in the package, this will list all the commands in the package. The commands that we will be using are
    rightbox    rightsum   leftbox   leftsum   
    middlebox   middlesum  value     limit
The ``box'' commands produce a plot of the graph of a function showing rectangles that fill the area under the graph. In combination with value, a ``sum'' command computes the sum of the areas of the rectangles plotted with the corresponding ``box'' command.

Let's illustrate these for the function tex2html_wrap_inline1347 between x = 0 and tex2html_wrap_inline1351 . First, try the command

    leftbox(1 + sin(x), x=0..Pi, 5);
This plots the graph of f and 5 rectangles. Notice that the rectangles all have the same width, tex2html_wrap_inline1355 . The height of each rectangle is the height of the graph at the left endpoint of the base of the rectangle. That's why this command has the name leftbox. Now try
    rightbox(1 + sin(x), x=0..Pi, 5);
and
    middlebox(1 + sin(x), x=0..Pi, 5);

We can see from any of these three plots, that using 5 boxes leaves a noticeable amount of ``white'' space underneath the curve and also creates ``green'' space above the curve. Let's try these commands again with more than 5 boxes (change 5 to larger numbers in these commands).

Of course, ``eyeballing'' it doesn't prove very much. What we need to do is calculate the sum of the areas of these boxes. For this we use value and the sum commands. The next commands compute the sum of the areas of the 5 boxes that you plotted above with the leftbox command. Try each of them.

    value(leftsum(1 + sin(x),x=0..Pi,5));

    evalf(value(leftsum(1 + sin(x),x=0..Pi,5)));
The second command gives a decimal value for the result of the first command. Now try the evalf and value combination on each of the box commands that you tried above.

Caution: It is easy to make mistakes with parentheses, be sure each Maple command has the same number of left parentheses as right parentheses.


next up previous
Next: Exercises Up: Discussion Previous: Discussion


Thu Jul 29 16:28:25 EDT 1999