Introduction to Maple
To launch Maple 8 from the NT Labs (340 or 342 DH):
Choose: Start -> Programs -> Mathematical Applications -> Maple 8 -> Maple 8
Create a new worksheet by clicking on the first item of the toolbar (just below "File").
Once Maple 8 has been started, computations may
be executed immediately. Commands are typed to the right of the prompt;
a semicolon is placed at the end of the command, and then it is evaluated
by pressing ENTER. If a colon is placed at the end of a command,
the resulting evaluation is not displayed.
To type comments, begin each line with the symbol
#.
You may SAVE your work (once you have an account) by selecting the H drive and choosing the MyHome directory.
(A) Arithmetic and High-School Algebra.
In each of the following examples, type the given command at the prompt, press ENTER and see what happens. Note that multiplication is represented using *, and exponentiation by using ^. exp(g(x)) represents eg(x); so exp(1) is just the constant e. Pi represents the constant p. See if you can determine the meaning of the symbol % through an examination of the output.
> 13 + 44;
> 2/3 + 3/5 ;
> 4*9;
> % + 13;
> # What role does % play here?
> 2* %;
> # What role does % play here?
> evalf( 1/3 + 1 /4);
> evalf( exp(1) );
> # Explain the difference between exp(1) and
evalf(exp(1)) ?
> evalf (Pi*15);
> sin(Pi/6);
> tan(Pi/6);
> evalf(%); # What is the role of
evalf
?
> 3*4^(1/2) + 5;
> simplify(%); # How does simplify
differ from evalf
?
> p := x^2 + 5x + 6;
> factor(p);
> factor (x^6 - 64);
> factor(x^2 - 10*x*y + 21*y^2);
> factor (x^2 + -7x - 44); # What seems
to be wrong here? Make a correction.
> ifactor(123456);
> arcsin(1/2); # Is the answer in degrees
or in radians?
> arcsec(13);
> evalf(%);
> gcd(45, 933); # What is the meaning
of gcd ?
> lcm(18,34); #
What is the meaning of lcm?
> convert(72*degrees, radians);
> convert(Pi/12, degrees); # What
is the role of convert
?
> solve (x^2 - 10*x + 21 = 0);
> solve (sin(x) = cos(x));
> solve (x^6 = 2); # How many
of these solutions are real numbers ?
> evalf(%);
> plot ( x * sin(1/x) , x = -0.4 .. 0.4 );
> plot ( x * exp (-x) , x = -1 .. 5 );
> # To display the graphs of two or more functions,
we may use braces to signal the beginning and end of our list of functions.
> plot ( {x^2 - x, 6 - x^2}, x = -5 ..
5 );
> plot ({sin(Pi*x), cos(2*Pi*x), 0.15*x}, x =
0..2*Pi);
Exercises:
1. Solve the equation x4 – 20x3 + 130x2 - 300x + 189 = 0.
2. Sketch the graph of the function y = x cos x over the interval [0, 10].
3. Sketch the pair of functions y = ln(x) and y = x1/2 on the same pair of axes over the interval (0,25].
4. Determine where the two parabolas y =
x2 - 3x - 4 and y = 1 - 3x2 intersect. (Determine
each coordinate to the nearest hundredth.)
Sketch their graphs on the same set of axes.
Graphing parametric equations
Consider a spider traveling in the xy-plane whose position (x,y) (in
cm.) at time t (in minutes) is given by x(t) = t2 and y(t) =
t3/(1+t2).
How can we plot the graph of the trajectory of the spider as time varies
from 0 to 13 minutes?
> x := t^2;
> y := t^3/(1+t^2);
> plot ([x, y, t = 0..13]);
Exercises:
1. Graph the function given parametrically by: x = 3 cos (s), y = 5 sin(s), 0 < s < 2p.
2. Graph the cycloid: x = 3(t - sin t), y = 3(1 - cos t), 0 < t < 25.
Calculus
The Student package is a collection of subpackages designed to assist with the teaching and learning of standard undergraduate mathematics. To invoke the Student package in Maple we use:
> with (Student):
Differentiating a function in Maple is relatively straightforward.
> restart;
> with(Student): # This library is optional
for what we are about to do.
> y:= ln(sin(3*x));
> Diff(y, x); # This is called pretty printing.
> diff(y, x); # This actually performs
the differentiation. The second variable is just the variable with which
differentiation is performed.
> x := s*tan(s)/(1+s^3);
> diff (x, s);
> diff (sqrt(1+x^3), s);
Computing a definite integral is also easy.
> restart; # This is very important since
we have already assigned an expression to the variable x.
> y := x*ln(x);
> Int(y, x=1..2); # Again, this is just
pretty printing.
> int (y, x=1..2);
> int (y, x); # This returns an anti-derivative.
Exercises:
1. Find the area between the two parabolas y = x2 - 3x - 4 and y = 1 - 3x2 that you graphed in an earlier exercise.
2. Find an anti-derivative of x4 ln(1+x).
3. Find the area under the curve x4
ln(1+x) between x = 0 and x = 1.
Help commands:
?f and help(f) give information about the Maple function (or package) f. Such information will appear in a separate window. For example, try:
> ? help
> ? plot
> ? radians
I see men as trees, walking.
- St. Mark, 8:24
A fool sees not the same tree that a wise man sees.
- William Blake
All theory, dear friend, is gray, but the golden tree of actual life springs ever green.
- Johann Wolfgang Von Goethe