Penn Math Penn Math  
Undergrad  

Introductory Maple Tutorial

To start Maple, click (or doubleclick) on the Maple icon -- or click on Maple in the list of programs on your computer.

  1. The Maple prompt looks like this: >
    In Maple, the user types in commands at the prompt. After typing Enter, Maple will display any relevant output and then a new prompt will appear.

    Note that typing Enter on a Windows computer means using either the regular Enter key on the keyboard or the Enter key on the number pad. However, on a Macintosh, the key on the keyboard is a Return key, not an Enter key. On a Macintosh, you must use the Enter key on the number pad for Maple to process a command.

  2. There are two different ways to type things into a Maple worksheet: text and input. Input is typed at the prompt. Text is information that is not actually processed by Maple. It is usually used for comments. To add text, you can turn a prompt into a text field. With the cursor at the prompt, click on the "T" button at the top of the window (or press Ctrl-T).If you are in a text field and you want to return to the prompt, you can click on the button next to the "T" button that looks like a Maple prompt (or press Ctrl-J). The button that looks like a summation sign next the the "T" can be used to insert (non-executable) mathematical notation into your text.

  3. There are two ways to end a Maple command: with a semicolon or with a colon. If the command does not have either a semicolon or a colon, then Maple will not process the information.
    1. If you end the command with a semicolon, the information will be processed and the output will be displayed.
    2. If you end the command with a colon, the information will be processed, but the output will not be displayed.

  4. Basic arithmetic: + - * /
    These are the four basic arithmetic operations used by Maple. Some examples:

    > 52 + 9;

    61

    > 42 * 357;

    14994

    > (52 + 9) / (42 * 357);

    _61
    14994

  5. The command evalf will turn output into a decimal value:

    > evalf ( (52 + 9) / (42 * 357) );

    .004068293984

  6. A few more built-in functions and what they mean in Maple:
    2 ^ 3; 23
    exp (7); e7
    ln (9); log e 9
    log (72); log e 72
    Note: both ln and log indicate log base e. log does not indicate base 10.
    To get log base 10 of 72 type log[10](72)
    abs (47); | 47 |
    sqrt (4); the square root of 4
    sin (Pi); sin (3.14159...)
    cos (2*Pi); cos (2*3.14159...)
    arcsin(1/2); sin-1 (1/2) or arcsin (1/2)
    arccos(sqrt(3)/2);cos-1 (sqrt(3)/2) or arccos (sqrt(3)/2)

    Some examples:

    > log (10^4);

    ln(10000)

    > sqrt (25);

    5

    > sin (2*Pi);

    0

    > abs (-17.3);

    17.3

  7. Maple is more than just a calculator, though. It can use variables. In order to assign a value to a variable, use :=

    For instance;

    > a := 17;

    a := 17

    > b := 3:

    > a + b;

    20

  8. The := assignment can also be used to write expressions. The command subs can be used to substitute a value into an expression. In the following example, f is an expression.

    > f := x^2 - 2*x + 1;

    f := x2 - 2x + 1

    > subs (x=3, f);

    4

  9. In addition to expressions, Maple can also create functions. These are similar to expressions, but they use different notation. We will turn the above expression f into a function named g.

    > g := x -> x^2 - 2*x + 1;

    g := x -> x2 - 2x + 1

    > g(3);

    4

  10. Maple also has a plot function. To plot the expression f over the range x=-5 to x=5, this is what you would enter at the prompt:

    > plot (f, x=-5..5);

    In Versions 4 and 5, the plot will automatically appear on your worksheet. In Version 3 and on the Macintosh, it will appear in a separate window. You can then copy the image from the window and paste it into your worksheet. Copy and Paste can be found under the Edit menu on every version of Maple.

    To plot g instead of f, you would type: plot(g(x), x=-5..5);

  11. Note: You need to have taken calculus to understand this section.
    To take the derivative of an expression or a function, use the command diff. To take the integral of an expression or a function, use the command int. Again, using f and g:

    > diff (f, x);

    2x - 2

    > diff (g(x), x);

    2x - 2

    > int (f, x);

    1/3x3 - x2 + x

    > int (g(x), x);

    1/3x3 - x2 + x

  12. Maple knows several constants. However, Maple is case sensitive. So if you are using one of these constants, make sure that it is properly entered. The constants are used in place of a regular number. Here are some constants in Maple and their mathematical equivalents:
    Pi 3.141592654...
    I the square root of -1

  13. When you open a saved worksheet in Maple, you will see all of the input and output that was on the screen when the worksheet was saved. However, Maple does not "know" what input was entered when the worksheet was originally used. So there is a command called Execute Worksheet that will execute all of the input again in the order it appears on the screen. On Windows Versions 4 and 5, click on the Edit menu, highlight Execute, and select Worksheet. On Windows Version 3, click on the Format menu and select the Execute Worksheet command.


To the Penn Math Undergrad Web Page.
How to contact us.