Professional Documents
Culture Documents
What is Maple?
Maple is a computer program for people doing mathematics. Using Maple to do
your calculations should make the work more interesting, allow you to focus more
on the concepts, and help you to avoid mistakes in calculation.
[> 4+5;
9
[> 6^2;
36
[> 3*4 + 7;
19
[> 3*(4+7);
33
[>2^2;
4
[>sqrt(4);
2
If you don't include a semicolon or colon at the end of a command, MAPLE will
interpret the next command line as a continuation of the previous command.
Arithmetic operations
The symbols +, -, *, /, and ^ (or **) denote addition, subtraction, multiplication,
division, and exponentiation (4^2 = 4**2 = 42 = 16). When a string of operations are
specified in a command, MAPLE first does exponentiations, then multiplications and
divisions, then additions and subtractions. To change the order, use parentheses.
Editing commands.
If you make a mistake in a command (like forgetting a semicolon) or want to change a
command, you can go back and edit the command with the cursor and mouse as you
would a word-processor text.
Exact arithmetic and floating-point arithmetic
MAPLE calculates fractions (exact arithmetic) unless you specify that you want
decimals (floating-point arithmetic) with the evalf function ("evalf" stands for
"evaluate using floating-point arithmetic"):
Defining variables
Use the colon-equal symbol (:=) to define variables--that is, to assign values to them.
Once you have defined a variable, simply typing its name will show its value, and
using the name in a formula will cause the value to be substituted.
[> A := 5; B := 2;
A := 5
B := 2
(Notice that you can string commands together on the same line.)
[> A;
5
[> 4*A/B;
10
[> f := x^2;
f := x2
[> f;
x2
[> g(x);
1/(x+1)
[> g(4);
1/5
[> p:=(x+1)^4*(x-6)^3;
[> expand(p);
[> factor(p);
Maple also divides polynomials. Here the command you execute has a syntax which is
a little bit more complicated. Consider the following example:
[> p := (x^10) 1;
[> p := x 1;
We assign the polynomials x10 - 1 and x - 1 to the variables p and q, respectively, and
then ask Maple to divide p by q. Maple replies with the statement true to indicate that
the polynomial q = x - 1 divides the polynomial p = x10 - 1 exactly, and places the
quotient in the third argument of the divide command. Thus, if you want to know the
value of the quotient, you must see what the variable b stands for now:
[> b;
Of course, the answer produced by divide will be false if the polynomials do not
divide each other exactly. Then one can use the commands quo and rem to find
the quotient and remainder of the division:
[> r := x^2 + 2x + 3;