DISP Mathematics (Scie 1500R)

MAPLE Lab. Tutorial 1 Introduction to Maple Monday January 17.


Maple V is a Computer Algebra System, meaning it has the ability to handle mathematical objects like functions, graphs, equations, and more. Moreover, it is capable of carrying out sophisticated operations on these objects, like differentiating or integrating a function, solving equations, and so on.

1 GETTING STARTED.

To start Maple V, double-click on the Maple V icon on the Windwos desktop. Or, if you do not see such an icon, simply click Start, then select Programs, followed by Math, and click on Maple V Release 5. Note that when Maple starts up, it puts you in a window (your current Maple worksheet).

The MAPLE prompt is $>$. This indicates that MAPLE is ready to work for you.

Commands end with ; (followed by the ``Enter'' key). i.e. that is how you tell MAPLE to go to work. One of the commonest mistakes for beginners is to forget the ;

Note: You may also end with : instead, BUT if you do, MAPLE will do the work but NOT show you the answer! (Sometimes this is useful for intermediate steps, but not often).

You define things by using := . Thus $x:= 5$ means that $x$ is defined to be $5$ and now, anytime you use $x$, MAPLE will substitute $5$ for it. If, after using $x:= 5$ in some calculations you want to have $x$ as a variable again, i.e. you want to ``unassign'' it, then type x:= 'x'; . Another way to think of this := command, is that it assigns names (abbreviations) for long expressions that you don't wish to keep retyping.

Help is available. To get help either click on the help box on the tool bar at the top or type ? followed by the particular topic or command that you need help with.

To exit MAPLE you can type $>$quit; .

2 ARITHMETIC.

The basic arithmetic operations are:

+    -     * (for $\times$)    / (for $\div$) and $\,^{\wedge}$ for exponent.

Try a few simple commands like:

> 10*25 + 30;
> 10 + 25*30;
> 2$\,^{\wedge}$30;
> 2/7 + 3/13;

MAPLE can handle fractions. If we want to convert the answer to a decimal approximation, we use the evalf command:

> evalf(47/91);

If we want more precision, say 20 significant digits, we can use the Digits command:

> Digits := 20;

> evalf(47/91);

Reset Digits to its default value (10):

> Digits := 10;

Maple has a large number of built-in constants as well. The number $\pi$, for example, is typed Pi.

> Pi;
> evalf(Pi);



There are some more sophisticated arithmetical commands:

! for factorial, ifactor(n) to factorize number $n$ (this is hard even for big machines - don't try numbers with more than 30 digits - if you do ask MAPLE to do something that takes too long, you can stop a calculation with the STOP button on the toolbar), and gcd(n, m) to find the greatest common factor (denominator) of $m$ and $n$.



3 ALGEBRA

Try the following commands, or make up similar ones for yourself.

> f:= x$\,^{\wedge}$3 - x$\,^{\wedge}$2 - 14*x + 24;
> factor(f);     (factorizes $f$)
> subs(x = 5, f);     (substitutes $x = 5$ in $f$).
> solve(f = 0, x);     (solves the equation $f = 0$ for the variable $x$).
> solve(f = 1.2,x);     (also solves but will now give a decimal solution).
> g:= (3*x + 2)$\,^{\wedge}$4;
> expand(g);

NB ALWAYS use * when multiplication is needed (as in the above polynomials). Another very common mistake for beginners is to forget a *.

4 EXERCISES

NAME STUDENT #

Before you start these exercises type restart. This is in case you have already assigned various things to various letters. This command ``unassigns'' everything.

In what follows $N$ is your student number (without the B and initial zeros), $a$ is the last digit of $N$, $b$ is the next last digit of $N$, $c$ is the third last, and $d$ is the fourth last. Hint: Use the a:= command.

1. Fill in the answers (using MAPLE!!):

$ a + bc = $

$ ab + c = $

$a^2 + b^3 + c^4 = $

$ (a + b)(c + d) = $

$ a/3 + b/4 + c/5 = $

2. Now type > evalf(%);

and enter the result here ....

3. Type > ?% to find out what this command does. It is a very useful shortcut.

Now explain the answer you wrote in Question 2.




4. Factor $N$.

5. Find the highest common factor of your birthday and today's date: 170100.

6. Define $f$ to be $(ax + b)$ and define $g$ to be $f^5$. Expand $g$:

7. Try and solve the equation:

\begin{displaymath}g(x) = d.\end{displaymath}

If this doesn't seem to work try:

> fsolve(g = d, x);

Look up fsolve under help and explain your last answers.



Tony Thompson
2000-08-16