The primary purpose of this lab is to get you acquainted with the most basic commands of the MAPLE computer algebra system, while reviewing some precalculus concepts as well. You should follow the syntax of the computer commands very closely, typing it just as it is printed in the manual. If you have any questions, be sure to ask the instructor.
Topics covered: general syntax, abs, sqrt, evalf, solve, fsolve, simplify, expand, factor, functions, operations, assignment statements, plot, editing, errors, and help.
Getting Started
After the MAPLE system has been loaded, a blank window titled - "Untitled (1)"-with a single prompt ([>) in the upper left hand corner should appear on the screen. You will notice that there is the typical menu bar at the top of the screen.

On the left side of the window are four buttons. The active
button is the one highlighted in blue, which is initially
.
These buttons provide contextual buttons directly underneath them. Click
on
and observe how that button
becomes "blue" and the buttons below those top four buttons change.
Now that you have accessed MAPLE, it is time to learn some elementary syntax. In this lab, whenever you see the instruction to ÒtypeÓ or Òenter the expressionÓ, you see how the MAPLE worksheet should look. YOU DO NOT NEED TO TYPE THE PROMPT ([>);; MAPLE WILL ALWAYS PUT UP A NEW PROMPT SECTION AFTER A COMMAND HAS BEEN EXECUTED.
Type the expression
[> 1+1;
and press the "enter" or ÒreturnÓ key, which is located at the far right of the keyboard. Your command to add 1 and 1 will be executed, and the output 2 should appear. The color "red" indicates input and "blue" indicates output. THE COMMAND THAT IS EXECUTED IS THE ONE ON THE COMMAND LINE WHERE THE CURSOR IS BLINKING.
NOTE: The cursor can be anywhere on the line to be executed when you press the ÒenterÓ or ÒreturnÓ key.
The MAPLE operations/relations are defined as follows:
^ exponentiation = is equal to
/ division <= less than or equal to
* multiplication >= greater than or equal to
- subtraction <> not equal to
+ addition < is less than
> is greater than
Thus to write
in proper MAPLE
syntax, we would type
[> (3*x^2+2*x-3)/5;
MAPLE's precedence of operators is standard, and is given as listed above, with the operator of highest precedence (exponentiation) at the top. However, parentheses have precedence over all operators. When in doubt, it is always best to use them.
Examples:
[> 3-7/5;
8/5
[> (3-7)/5;
-4/5
[> (2^(3*1))^2;
64
MAPLE ignores blank spaces between characters. MAPLE DOES NOT ACCEPT BLANK SPACES IN PLACE OF THE MULTIPLICATION SYMBOL, even though it prints output that way. IN FACT, YOU MUST USE * TO DENOTE MULTIPLICATION.
Some MAPLE Library
Functions
[> abs(-3);
MAPLE prints the number 3.
Use the command
abs(expression);
to get the absolute value of any numerical expression. (If youÕre not sure what ÒexpressionÓ means in this context, check with your instructor.) The part of the command in Italics describes what form the syntax requires. Be sure the expression is enclosed by parentheses.
sqrt(expression);.
For example typing the command
[> sqrt(4);
will yield 2. If the square root is an irrational number, MAPLE will only rewrite the expression using factors and fractional exponents.
[> sqrt(2);
![]()
To get a numerical value, use the command:
evalf(expression);
Example:
[> evalf(sqrt(2));
1.414213562
A convenient way to avoid retyping the last expression that was entered is to use the percent sign (%). It always represents the most recent output in MAPLE's memory and can be treated as a variable. For example:
[> sqrt(16);
4
[> %+1;
5
[> %*3;
15
[> evalf(sqrt(%));
3.872983346
Example:
Evaluate
to seven decimal places.
[> evalf(sqrt(10));
3.162277660
Rounding off to seven decimal places, the answer is 3.1622777.
You
can specify how many digits of the decimal expansion of a number you want in
Maple. Thus to evaluate
to seven decimal places you could type:
[> evalf(sqrt(10),8);
Notice that we used
"8" in the command since there is one digit before the decimal point.
To evaluate
to 29 decimal places, we use:
[>
evalf(sqrt(10),30);
3.16227766016837933199889354443
You see the 30 digits of the decimal expansion
of
.
User Defined Functions
You can define your own functions in MAPLE by using Ò->Ó. This arrow is constructed by typing a dash followed by a greater than symbol. To define the function named f whose output is given by
, you simply type:
[> f:=x ->
x^2-4*x+3;
Now MAPLE recognizes what operations function f performs to any input.
[> f(a+b);
![]()
[>f(5);
Variable Assignments
At the prompt type
[> x:=2;
and press the enter key. MAPLE should confirm this expression, which is a variable assignment, by printing the same statement. This means whenever you use x, it will be treated as 2. You may now ask MAPLE the value of the variable x by typing
[>x;
[> x:= 'x';
x:= x
confirming that x is undefined again.
Before continuing we need to talk about naming expressions, which is very efficient when using MAPLE. During a MAPLE session there may be many times when you might want to work with a long expression such as (x^4-3*x^3+6*x^2-36*x+2)/(sqrt(x^6-2*x^5+4)*(x-4/x)). We note that this is a somewhat complicated expression, and thus would not necessarily be enjoyable to enter into MAPLE more than once. Hence it would be nice to name this expression so that if you want to use it again you can refer to it by its name rather than retyping it. Making an assignment statement does this. An assignment statement always has the symbols Ò:=Ó in it. The assignment of names to expressions takes the form
name:=expression
Thus if you wanted to name the complex expression above Òex1Ó, you would type:
[> ex1:= (x^4-3*x^3+6*x^2-36*x+2)/(sqrt(x^6-2*x^5+4)*(x-4/x));
Now whenever you wanted to work with that complex expression you could use its name. For example you could type
[> expand(ex1)
[> subs(x=2, ex1);
to substitute the value of 2 in for every occurrence of x in the expression named ex1. You can use assignment not only for expressions, but also for functions and equations.
Solve
To find the solution to any algebraic equation use the solve command:
solve({equation(s)}, {variable(s) for which you
want solutions});
Examples:
[> solve(2*x + 5=7, x);
1
Try solving 3*a*b+4 = 3 for b.
The "solve" command can be used to find solutions of inequalities as well.
Example: Find the solutions of |x Ð 2| < 5.
[> solve(abs(x - 2)
< 5, x);
RealRange(Open(-3),Open(7))
Now interpret the MAPLE solution and state that the solution set is the open interval (Ð3,7).
Other possibilities for solutions to inequalities follow.

As you have seen, there can be more than one variable in an equation. In fact, MAPLE can solve a system of equations for the variables. First the set of equations and then the set of variables each need to be enclosed in set brackets.
Example: To solve the system
3x + 2y Ð z = 5
x Ð 4y + 3z = 9
2x Ð 3y + 5z = 0
we would type
[> solve({3*x+2*y-z=5,x-4*y+3*z=9,2*x-3*y+5*z=0},{x,y,z});
Fsolve
The command "fsolve" performs the same operation as the solve command, but it gives solutions in floating point (decimal) notation. Unless otherwise changed, "fsolve" will print numbers out to ten digits. Type
[> fsolve(2*x = Pi,x);
The "fsolve" command will not solve equations that have symbolic expressions in their solutions. Thus the command
[>fsolve(3*a = b,a);
will produce an error , even if a and b have numerical values.
Simplify, Expand, Factor
The MAPLE command "simplify" will take any expression and perform a wide range of operations on it to rewrite in what MAPLE decides to be the simplest symbolic form. Although it can make substitutions, it cannot evaluate numerical approximations. The "evalf" command should be used in these cases. If an expression cannot be simplified further, MAPLE simply rewrites the expression.
[> simplify((x+1)*(x+1));
![]()
[> simplify(2*x);
[>simplify(test);
Two other commands that are useful in manipulating an
answer's form are the "expand"
and "factor"
commands. As one would expect, "expand" multiplies everything
out while "factor" takes an expression and puts it into factored form
if possible. The "factor"
command usually requires a large amount of computer memory and should be used
conservatively. First, initialize (or clear) x by typing
[> x:= 'x';
Then type
[>expand((x+1)*(x+1));
Finally type
[> factor (%);
Plot
Functions and expressions are graphed with the plot command. In this lab, youÕll plot either expressions or MAPLE library functions. The next lab will explain how to plot functions that youÕve defined in MAPLE. The plot command takes the form
plot(expression
in a variable, variable)
plot(expression in a variable, variable=a..b) or
plot(expression
in a variable,
variable=a..b,c..d)
where ÒaÓ and ÒbÓ represent the limits of the plot in the horizontal direction, and ÒcÓ and ÒdÓ represent the limits of the plot in the vertical direction. In the first case, MAPLE will choose the viewing window. The command
[> plot(x^2, x= 0..5, 0..10);
will plot the graph of
over the
x-interval [0, 5] in the vertical direction from 0 to 10. However, the graph will not be seen
beyond x = 3, because
are greater than
10 and hence out of viewing window.
For practice, first have MAPLE plot the expression
by not
specifying a viewing window. Then
specify a horizontal window from Ð8 to 8.
Finally, specify the vertical window from Ð5 to 5. Compare the plots: which gives the best
view? Is there a better window in
which to view this plot?
MAPLE can also graph several expressions at once. Like sets of equations, sets of
expressions are enclosed in braces, separated by commas. For example, to graph
and y = 2x over
the x-interval [0, 5] with a better vertical window so the whole graph can be
seen), type
[> plot({x^2,
2*x},x=0..5,0..25);
Editing and Error Messages
Depending upon how you manage the computer, you may have scattered pieces of work in various places in the worksheet. There are a number of ways of cleaning this ÒmessÓ up. One way is to cut and paste as you would in any word processing program. There are a also a number of ways to deal with the worksheet found under both the ÒEditÓ and ÒFormatÓ pull down menus. You can Òplay aroundÓ with these to see what they do.
When first working with MAPLE, you will probably encounter
error messages quite frequently.
Often, they will be syntax errors.
Do not get frustrated with this; it is quite normal. MAPLE will try to identify what the
error is or use the Ò^Ó symbol to point to where the error occurred. This may or may not be helpful. You can edit a previously typed command just as
you would any document. Do remember that "%" refers to the last
output in Maple's memory. It does not necessarily refer to the output above the
command you're editing.
To be safe, you could go to the end of your session and make sure you have a new MAPLE prompt ([>). To be really safe, you could use "restart" or even quit the current MAPLE session and begin over.
Example:
[> evalf(6/3)garbage;
results in
Error, missing operator or ';'
MAPLE can declare errors for several technical reasons, some of which might have nothing to do with what the user did. Thus errors can happen even if the syntax is correct. When this happens, don't get frustrated. Check to make sure your variables are defined (or in some cases, undefined) and that you have entered the proper parameters. Edit the screen of all error messages and try running the command again. You can either retype the command or move the cursor to anywhere on the previous line and press "enter".
Help
MAPLE has an on-line help facility that enables the user to obtain
help while in a MAPLE session. You
can access help by using the ÒHelpÓ
menu or by clicking on
at the top of the MAPLE window.
Problems
Use MAPLE to work the following problems. Be certain you know which, if any, portions of this problem set your instructor requires you to submit. If you need a new worksheet, open one from the file menu. Be sure to save a copy of your Worksheet with these problems on it. You may be asked to turn in this electronic copy of your worksheet as part of the lab.
1. Give the numerical value of the following expressions to the fifth decimal place.
![]()
2. Give the solution set for the following inequalities. Be sure to interpret the MAPLE output.
(a) |2x-3| > 7 (b) |x/2 + 7| ³ 2 (c) 7x Ð 4 ² 3x + 8
3. Solve the equations.
(a) x2 Ð 3x - 4 = 0 (b) 7a + 6b = 42 (solve for a)
4. Solve the system.
3x Ð 2y + 2 = 0
3x Ð y = 0
5. Using the distance formula, find the distance between (1, Ð3) and (6, 6). Approximate to five
decimal places.
6. Define
a function f(x) =
. Calculate
(a) f(6) (b) f(2.22) (c) f(0.793)
(d) Graph the expression
over the
x-interval [Ð5, 5]
7. Plot
the relation
so the entire
graph can be seen. What shape is
it?
Either print the plot file or sketch the graph yourself to turn in. (Hint: First solve the equation for y using the "solve" command. The solutions will be in terms of x. Plot all the solutions on the same graph using the "plot" command. Also be sure that the variables you are using above have not been assigned to some other expression.)
8. Sketch the graph y = sec(x/10).
9. Plot the expression
![]()
labeling all interesting points (like intercepts, asymptotes). Be careful!
10. First, submit the electronic copy of the MAPLE Worksheet you used to do the problems above. Then write a paragraph or more describing briefly what you learned about MAPLE in this lab. Finally, in a paragraph, state your reaction to using MAPLE. Some questions you might want to answer are: "Was it easy to learn?", "Was it useful?", "Where did you encounter the most difficulty?".