Chapter 2 - Maple Basics

2.3 Simple Algebra

Maple knows how to do simple arithmetic; it knows how to add (+), subtract (-), multiply(*), divide (/), and exponentiate (^). It understands and uses parenthesis "(" and ")" following the usual algebraic rules.

All Maple "line" or "command" must be terminated by a semicolon ";". Maple is a free-format language with no imposed command line length, and where spaces do not matter. Use spaces to make the typing easier to read and interprept. A ";" implies the end of a "command block" for the compute engine.  In general the syntax of  Maple commands is:

            command ( argument list );

Maple always defaults to algebraic mode. If there are numbers in the expression, Maple defaults to integer arithmetic, i.e., presents the results in rational fractions. The command "evalf" forces Maple to evaluate an expression in floating point via the syntax

evalf(exp,acc);

where "exp" is any valid Maple expression and "acc" is the number of digits with which to do arithmetic. Maple defaults to 10 digits accuracy. In this sense, Maple constitutes an excellent calculator. Maple also defaults to floating point arithmetic if it detects floating point numbers in an expression. The reader should get the Maple help on the evalf command (i.e., by typing ?evalf at the prompt).

Maple also knows how to do algebra. In particular, the commands "expand(exp)", "factor(exp)", and "simplify(exp)" allow to expand, factor, and simplify any algebraic expression. These commands are particularly useful in manipulating polynomials.

Recall that the results in this sectiion can also be displayed in 2D math notation.


  Section 2.2 Chapter 2 Section 2.4       TOC

Any questions or suggestions should be directed to
Michel Vallières at vallieres@physics.drexel.edu