Numerical Calculations

Maple performs mathematical calculations swiftly and accurately. Unlike a calculator, Maple's worksheet can keep a permanent record of your calculations for later use.

> 123.4*8.2^3;

                                   68038.8112

> (23.4*43)/(43.5-(3.2*2))+(12.4*34.8);

                                 458.6412938

Maple also recognizes many special operators such as factorial, square roots, least common divisor, etc. For example:

> 13!;

                                   6227020800

> (5^8)/(3*Pi^2)*sqrt(5);

                                           1/2
                                          5
                                 390625/3 ----
                                             2
                                           Pi

Note that Maple kept answer in the form of an expression, i.e., it does not round off the answer. Maple will allow this expression to carry over as is so that rounding errors do not plague the user. If one wants to see the final answer as a decimal floating point, the evalf command can be used. Also note that the quotation mark (") is used to represent the last expression computed:

> evalf(");

                                  29500.13725
Maple also calculates finite and infinite sums and products:

> Sum((2*i+5)/(3*i^2-5),i=1..10);

                                   10
                                 -----
                                  \     2 i + 5
                                   )   --------
                                  /       2
                                 ----- 3 i  - 5
                                 i = 1

> value(");

                                   29392799449
                                 - -----------
                                   48571966058

> evalf(");

                                  -.6051391746

> Product((3*Pi*i-5)/(2*i^2-Pi),i=1..10);

                                 10
                              --------'
                             '  |  |    3 Pi i - 5
                                |  |    ----------
                                |  |        2
                                |  |     2 i  - Pi
                               i = 1

> value(");

  (3 Pi - 5) (6 Pi - 5) (9 Pi - 5) (12 Pi - 5) (15 Pi - 5) (18 Pi - 5)

                                                        /
      (21 Pi - 5) (24 Pi - 5) (27 Pi - 5) (30 Pi - 5)  /  ((2 - Pi) (8 - Pi)
                                                      /

      (18 - Pi) (32 - Pi) (50 - Pi) (72 - Pi) (98 - Pi) (128 - Pi) (162 - Pi) (200 - Pi))

> evalf(");

                                  -1.089588169

Notice the above gets a little messy on an ASCII screen. It looks better on an X-Window session

One can round off the value to any number of decimal places desired:

> 5/3;

                                      5/3

> evalf(",3);

                                      1.67

Maple also utilizes complex numbers:

> (12+8*I)*(9+3*I)/(2+I);

                                276/5 + 132/5I


This page Maintained by Dale H. Leschnitzer
Last Modified Monday, November 4, 1996

L O S   A L A M O S   N A T I O N A L   L A B O R A T O R Y
Operated by the University of California for the U.S. Department of Energy

Copyright © 1998 UC - Disclaimer