Maple can perform basic mathematics or arithmetic. The following examples show how to add, subtract, multiply, divide, assign values to a variable or string, use exponential notation, find square roots, use the number e, and find logarithms.
To add, subtract, multiply, and divide we type our input (or command), a semi-colon, and then press the ENTER key (not return).
For example, adding 4 + 2 is done as follows.
(Your input is typed in blue, Maple's output in red. Press the ENTER key after the semi-colon.)
Subtracting, multiplying and dividing are done in the same way as addition. (Use the * for multiplying.)
Assigning Values to a Variable
To assign values to a variable or string we type the variable followed by a colon and an equal sign as follows.
Exponents
There are two ways to type exponents. We may use either a caret or two asterisks.
Examples:
However, we cannot use more than one caret or one set of asterisks, unless we also include parentheses.
Examples:
or
The Number e
Maple will calculate e with the use of the command exp( expression );.
Using the command evalf also generates the decimal approximation above.
Square Roots
To calculate square roots use the command sqrt( expression );.
Logarithms
Maple calculates both natural logs and logs to base 10 (or other base).
To find natural logs (base e) use ln( expression ); as follows.
Using the command simplify( expression ); gives
To compute logs with base 10 use readlib( log 10 ):. readlib loads the log 10 procedure, and the colon causes Maple to suppress printing the output. In this case press RETURN after the colon. Then press ENTER after the semi-colon.
Then use simplify(");. The quote means use the previous expression.
Link to Maple Arithmetic Handout
Link to Maple Home Page
Back to Ellerbruch Web Site Home
Link to Math Department Home
Link to Northern Michigan University
Jo Norby-Davis: jnorbyda@nmu.edu.