MAPLE can evaluate most of the summations that one finds in Calculus books.
As we saw last week for limits, there is a useful way of getting MAPLE to write out such things nicely (we shall see the same thing with integrals below). This is to use the command > Sum(f(i), i=1..n); This returns a nicely formatted expression for the sum. Therefore, if you want the whole thing to look good, try > Sum(f(i), i=1..n)= sum(f(i), i=1..n); .
Try the following commands:
> Sum(i2,i=1..10) = sum(i2,i=1..10);
The command for indefinite integration is
> int(f(x), x);
but this does NOT give you an arbitrary constant at the end (you must supply that). For definite integration, the command is
> int(f(x), x=a..b);
Note that in both of these, is an expression.
MAPLE will try and do the definite integral symbolically and give an exact answer. If it cannot do so, it will return the expression for the integral. To evaluate integrals exactly, use > value(.); to get a decimal approximation use > evalf(.);
There is a special MAPLE package to help students with Calculus exercises. Type
> ?student; to see what it has.
NAME STUDENT #
Before you start these exercises type
Now define the expressions and to be
1. Riemann sums. Type the following commands:
Write down two inequalities for
2. Repeat question 1. with 80 subintervals.
Write down two new inequalities for
3. Type the following commands:
(i) Find a decimal approximation for this integral
> Int(f,x=0..2)= int(f,x=0..2);
(ii) What theorem is verified by the last two formulas?
4. Type the following command:
What does this tell you about this integral?
§5.9 of the text is called Numerical Integration. It talks about two methods for finding numerical approximations to integrals. These are the Trapezoid Rule and Simpson's Rule. There is not much point in talking about them in class when you have MAPLE available. MAPLE will do both as follows:
Give the decimal approximation to this integral using these two methods:
[OVER] But the following is most powerful; it attempts to achieve 10 digits of accuracy (or more, depending on the currrent value of Digits), using a very sophisticated algorithm. You just type "evalf" outside of "Int":
Which of the two rules used above (Trapezoid and Simpson) is the more accurate?
5. Areas Between Curves: Type
> f := x4 - 3*x2 + 2*x + 1;
> g := x2 + cos(x);
Find the area trapped between these two curves.
> x0 := fsolve(f=g,x,-3..-2);
> x1 := fsolve(f=g,x,-2..0.5);
> A1 := int(g-f,x=x0..x1);
> x2 := fsolve(f=g,x,0.5..1);
> A2 := int(f-g,x=x1..x2);
> x3 := fsolve(f=g,x,1..2);
> A3 := int(g-f,x=x2..x3);
What is the area between the curves?
Theoretically, the following should give the same answer:
> Int(abs(f-g),x=x0..x3) = int(abs(f-g),x=x0..x3);
But it didn't!? Maple, while pretty smart, has difficulty doing Calculus with absolute values.