Вы находитесь на странице: 1из 2

Constants 20/04/2015 8:56 pm

Lesson 1 - The basics

Maple's Constants
There are three constants that are important for us. Maple knows these constants as "Pi", "I" and "infinity".

To see the value of (lower case pi) type

> evalf(Pi); NOTE the capital P here. Typing "pi" instead of "Pi" is one of the
most common errors made by first year students.

Maple uses I for the square root of -1. Try the following two
Maple commands.

Complex numbers is the first algebra topic in MATH1131 and


> sqrt(-1); MATH1141.
> I^2;
You can type these two commands one at a time or in one
execution group by typing shift-enter after the first one (try
it!)

The concept of infinity is useful in many calculations that Maple


can do, for example in calculating limits as x tends to infinity. In
Maple, the word "infinity" is reserved for this purpose.

This command uses the Maple constant "infinity" and the


> limit(x^2, x=infinity); result of this command is also infinity.

Maple knows some other constants such as Euler's constant,


(lower case gamma).

There will be more use of sums like this in the second


> limit(sum(1/k,k=1..n)-ln(n), semester courses MATH1231 and MATH1241.
n=infinity );
> evalf(%);

Maple also knows Euler's constant as gamma.

Euler's constant is an irrational real number just like e and


> evalf(gamma); . This command gives a 10 decimal place approximation.

Note that there is no symbol defined to be the mathematical


constant e (the base of the natural logarithm.) This constant can
be obtained by

This is a very common cause of errors in first year. For the


> exp(1);
exponential function ex in Maple you must use "exp(x)"
> evalf(exp(1));

http://moodle.telt.unsw.edu.au/file.php/12406/Maple/MapleSelfPaced/lesson1/Lesson1_constants.html Page 1 of 2
Constants 20/04/2015 8:56 pm

As far as Maple is concerned, e is just another variable and


e^x has no special meaning.

Summary Self-test Exercise

Maple has some special symbols that represent Use Maple to verify the well known result that e to the
constants, in particular, "Pi", "I" and "infinity". power of i times , that is ei, is -1.

Beware: "e" in Maple is not the mathematical constant There are lots of ways to go wrong here, so here are
you might expect. some hints:

Don't forget the `*' for mulitplication.


Remember that ex in Maple is exp(x).
Whether a letter is upper or lower case is
important in Maple.

If you're still stuck ask a Maple consultant in the RC-


G012B lab.

http://moodle.telt.unsw.edu.au/file.php/12406/Maple/MapleSelfPaced/lesson1/Lesson1_constants.html Page 2 of 2

Вам также может понравиться