Back

 

Getting Started with Maple



General

Maple can solve one equation or a whole system of equations; Maple can factor complicated expressions instantly; Maple does Calculus, and Maple is great at 2D and 3D graphics. With Maple you can produce an animated diagram -- a movie -- of a surface changing over time.

Start Maple by clicking on the Maple Leaf icon in Windows. You get a blank worksheet. Here you type in Maple commands ending each command with a semicolon(;) Maple is case sensitive so be careful about the use of capital letters. Factor or FACTOR are not the same as factor.

Let's try: Enter

factor(x^2-1=0);

Did you get (x+1)(x-1)? Good! Next enter

solve(2*x-3);

I hope you got x=3/2. Now try some of your own.

You enter a command followed by parameters in parentheses and ending with a semicolon, as follows

comm(par1, par2, ... );

and Maple responds with an answer centered in the line below.

Use Pi for 'pi' and exp(1) for 'e'. The square root of x is 'sqrt(x);' Maple keeps all its answers in exact numbers. This means that values such as those above and fractions like 1/3 are not usually shown in decimal form. To convert a number to decimal form use the evalf function. Like this

evalf(1/3);

You can assign a value to a letter with := as follows

a := 2 + 3;

Then if you type in a; you'll get 5, and if you type in a+17; you'll get 22.

To be honest Maple is a fairly difficult but interesting system -- when you get into it. So at first try the easy things and work slowly into more difficult calculations.

You can move the cursor up and down the worksheet, recalculating values anywhere. Sometimes this produces strange results. If you find your work becoming illogical just recalculate everything from the top down, or start over by clicking on the blank white page icon. It's the first item on the toolbar. Also typing restart; will usually clear things up.

Maple works in complex numbers, so you'll sometimes see I for i = sqrt(-1). In the real number system -1 hasn't got a square root, but in the complex system it does. So that's what I is.

The best way to learn Maple is by playing with it, and browsing the help files.

Back to the top

Arithmetic

Maple is great for doing arithmetic calculations. Just type them in, end with a semicolon, and press enter. Thus

5*(7-2)^2;

comes to 125. But if you enter 1/5; don't expect to get 0.2. Why? Well maple prefers fractions over decimals. If you want a decimal use the evalf(); command. So

evalf(1/5);

yields 0.2. evalf stands for evaluate to a floating point number. Floating point is the computer scientists word for a decimal. Also, you'll get a decimal answer if you include a decimal in your input. Try entering 1/3.0; as opposed to 1/3;.

Would you like to know the value of Pi to 50 places, just enter

evalf(Pi, 50);

and you've got it. Now try 1000 places or more! Maple recognizes the same functions you're used to from your calculator, like sin();, cos();, ln();, and so on. Just don't forget to use evalf(); when you want a decimal.

To factor integers use the ifactor(); function. Try ifactor(12);

To get the quotient and remainder of a long division use iquo(); and irem(); We get results like iquo(17,5); which is 3. And irem(17,5); which is 2. The i in all these stands for integer. But Maple does a lot more than arithmetic -- read on!

Back to the top

Functions

The solve(); command. To solve an equation enter it using the solve command. For example enter

solve(x^2 - 16 = 0);

to see Maple respond with x = -4, 4. Try harder ones.

Now try solving an equation like a*x^2 + b*x + c = 0. You need to enter a second parameter to tell Maple which letter to solve for. Enter

solve(a*x^2+b*x+c=0, x);

to see the result.

What about systems of equations. Enter a 2 by 2 system, like {x + y = 1, x - y = 0} with the solve command. Maple has no trouble with that. Now enter a 10 by 10 system. Maple does it with no problem.

The factor(); command. Try entering

factor(x^3-27);

to factor the cubic expression. You see (x-3)(x-3x+9). Maple is great at factoring. Try a few for yourself.

The expand(); command. To add, subtract, and multiply algebraic expressions use expand(); Experiment with

expand((x-3) * (x^2 - 3*x + 9));

to reverse the factoring we did above.

The simplify(); command. to get a better form for an expression use simplify(); Frequently we compose commands, using expand and simplify together. Try expand();, simplify();, and then

simplify(expand());

with an expression like (a+b)^3/c.

Quotients and remainders. Long division results can be obtained using the quo(); and rem(); commands. To get (x^2+7*x+12) (x+5) enter

quo(x^2+7*x+12, x+5, x);

rem(x^2+7*x+12, x+5, x);

What you see here is the quotient and remainder of a long division.

True or false. Is 5/8 greater or less than 0.7? If your not sure just type in

evalb(5/8 > 0.7);

and Maple will respond with false. The evalb(); command evaluates as a boolean (that is, true or false) expression.

Back to the top

Calculus

The limit(); command. Maple does limits. To get a feeling for how this works try these

limit( 1/x, x = infinity);

You should get 0.

limit( exp(-x), x = -infinity);

You should get infinity.

limit( (x^2 + 8*x + 15) / (x + 3), x = -3);

You should get 2.

The diff(); command. Maple also does derivatives. You can use this to take or check a derivative quickly. For example:

diff( sin(a*x^2), x);

will give you 2ax cos(ax^2). You can practice derivatives all night with maple. But you can do much more. By composing the commands you can solve complex problems. Frequently we want to set a derivative to zero and solve to find the extrema of a function. Try this

solve( diff( x^2 + 5*x + 3, x) = 0);

Here you are taking the derivative, setting it to zero and solving, all at once. You should get x = -5/2, a number known as a critical value.

Back to the top


Calculus II

The int(); command. Of course Maple also does integrals. Try a few for fun.

int(cos(2*x),x);

ought to yield 1/2 sin(2x). Now try a definite integral, say

int(x^2, x = 2..5);

which should come to 39. You can even do partial fractions on Maple. Enter

convert( (5*x+1) / (x^2-1), parfrac, x);

to get the partial fractions decomposition 2/(x+1) + 3/(x-1).

Back to the top


More

Maple can handle series, vectors, matrices, find eigenvalues and eigenvectors, do partial derivatives and multiple integrals. Maple includes its own programming lanuage, so you can extend it as you see fit. In fact Maple will be useful throughout university work in mathematics, science, or engineering and into a professional career. To learn more you can read the help files, manuals and books that are available, but the best way to learn Maple is to play with it, enjoy it, and have fun with it.

Maple's main competitor is an application called Mathematica. Maple and Mathematica are the two most serious computer mathematics applications that exist today.

Back to the top