Basic Maple Syntax next up previous
Next: Some useful Maple commands Up: Maple for Intensive Analysis: Previous: Defining Functions and Constants

Basic Maple Syntax

Colon and Semicolon
All Maple statements must be terminated by a semicolon (;) or a colon (:). Maple will not execute a statement unless it is terminated by a semicolon or colon. Usually you should end a statement with a semicolon. If you use a colon, the Maple output from the statement is suppressed. This may be useful if the output is long or is only one step along the way to an answer.

Arithmetic Operations
Maple uses the standard arithmetic operations, +, -, *, and / for addition, subtraction, multiplication and division, ^ for exponentiation and ! for factorial. The order in which operations are executed follows the standard mathematical rules. If there are any ambiguities, uses parentheses.

Note: * cannot be omitted. For example, you must enter 5*x for 5x.

Entering a range of values
The expression x = a..b denotes x from a to b. This can be used to enter a domain or range in a plot command or endpoints of integration for a definite integral in the int command as well as in other contexts.

Maple commands
Maple commands are called using the syntax
      commandname(parameter 1, parameter 2, . . .);
Maple is case-sensitive so it is important to be careful when entering the command name. The parameters for the command can be Maple expressions, numbers, other Maple commands or previously generated Maple output. If you are uncertain about a particular command, you should use the Help Browser or Keyword Search to determine the appropriate usage of the command.

Loading Packages
Not all Maple commands are immediately accessible. Some commands are found in specialized packages such as linalg, plots, geometry, etc. These packages can be loaded with the command
      with(packagename);
After the package is loaded, any command in the package can be accessed as above.

Assignment operator
The := operator can be used to assign a Maple expression to a variable name. This expression could be anything from a constant to the output of a Maple command. This is particularly useful if the output will be used in subsequent Maple commands. For example, the command
      x:= 5;
assigns the value 5 to the variable x. The command
      area:= int(1/x, x = 1..3);
computes the definite integral tex2html_wrap_inline379 and assigns that value to the variable area.

You should be cautious when choosing names that you do not use a name which represents a Maple command, function or constant. If you do, the standard meaning of the command name is temporarily lost which may lead to errors. In order to unassign a previously assigned variable use the command

      x:= 'x';


next up previous
Next: Some useful Maple commands Up: Maple for Intensive Analysis: Previous: Defining Functions and Constants


Thu Jul 29 16:02:26 EDT 1999