display

We can use Maple to see and evaluate Riemann Sums.

> f := x -> exp(-x^2);

f := proc (x) options operator, arrow; exp(-x^2) en...

Notice that to use the function e^x, I have to type exp(x)!

> plot(f(x),x=0..1, filled=true, color=grey);

[Maple Plot]

>

I'd like to approximate this area, by subdividing [0,1] into 4 subintervals. Before I get to work on figuring that out, I can graph it using Maple. But first I have to load the student package.

> with(student);

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

> leftbox(f(x),x=0..1,4);

[Maple Plot]

Now that I can look at it, I can see that the base of each rectangle is 1/4.

I can also see that the height of the leftmost rectangle is f(0), the height of the second is f(1/4), the height of the third is f(1/2), and the height of the fourth is f(3/4). I can use that to write the sum.

> L_4 := 1/4*(f(0)+ f(1/4)+f(1/2)+f(3/4) );

L_4 := 1/4+1/4*exp(-1/16)+1/4*exp(-1/4)+1/4*exp(-9/...

This is the exact approximation, but since I'm just approximating anyway, I might as well ask Maple to approximate this for me.

> evalf(%);

.8219991677

>