Maple Commands
If Something Goes Wrong
- Hit "Enter" again on any command lines to make sure Maple's computer knows how everything is defined.
- Go back and check that you have typed everything EXACTLY correctly. Even one missing symbol can create a big error.
- Save your work and quit Maple and then restart Maple. Once you reopen the file, make sure you hit "Enter" on all command lines before proceeding from where you left off.
- E-mail me with the commands you typed and what is going wrong. Make sure you include the commands EXACTLY as you typed them.
Common Errors
- Any error with the word "delimiter" in it means your parentheses don't match up.
- Did you enter "e" correctly from the Expressions Tab? What about "Pi"? What about sin(x) with parentheses around it?
- If your plot is showing up empty, it usually means there is something wrong with the way you defined the function or the data.
Basic Commands
Defining a Function
To define a function we need to tell Maple the name of the function (f, g, A, etc.), the name of the variable (x,t, etc.), and the equation defining the function. We do this as follows:
function name := variable name -> equation
So to define f(x)=x^3+1 we type f := x -> x^3+1 .
To define A(t)=sin(t) +4 we type A :=t ->sin(t)+4.
We can also use the "Expression" Tab on the left side of the Maple window to input many different symbols from superscripts to subscripts to trig functions to log functions.
Defining Data/List of Ordered Pairs
To define data (usually a list of ordered pairs) we need to tell Maple the name of the data and then input the data, as pairs, between left and right brackets. We do this as follows:
data name:=[ [1st term of first point, 2nd term of first point] , [1st term of second point, 2nd term of second point], . . . ]
So to define the data set called DATA which has points [0,1], [1,2], [5,3], [6,1] we would type:
DATA:=[ [0,1], [1,2], [5,3], [6,1] ]
plot
The plot command requires as input the name(s) of the items you would like to plot. If there is more than one item, put the names of the items in squiggly parentheses { and }.
If we want to plot the function f we would type plot( f ) .
If we want to plot the functions f, g, and h we would type plot( { f, g, h } )
If we want to plot the function f and the datapoints named DATA we would type plot(f,data).
As optional additions to the command, you can restrict the domain and range on which you view the graph. If you want to restrict to the interval [a,b] you enter a..b after the name of the function, with a comma between the name and the interval.
So if we want to plot the function f with x values from -4 to 4 and y values from 0 to 20, we would type plot(f,-3..3, 0..20)
If you are plotting data points it is usually best to add an optional command at the end: style=point
This will plot the points individually instead of trying to connect up the points.
So if we want to plot DATA we would type plot(DATA,style=point) .
evalf
Sometimes Maple leaves a value in symbolic notation. There are reasons for this if we are doing advanced computations but it is not what we will usually want in this class. For instance, if we enter 17^(1/3) for the cube root of 17 or ln(17) for the natural log of 17 Maple would just return 17^(1/3) or ln(17).
If we want the numeric value of these expressions, we need to add the evalf command to the front of whatever expression we would like Maple to evaluate.
So if we want to find the numeric value of the cube root of 17 we type: evalf(17^(1/3)) and if we want to find the numeric value of the natural log of 17 we type ln(17).
subs
This command will substitute one variable for another. This will be useful when we are trying to find the inverse of a function in Maple. The first input to the function is the variables you want to swap and the second input is the name of the function where you would like the swapping to occur.
If we want to place an x anywhere there is a y in an equation named equation1 we would type subs(x=y, equation1).
If we want to do the substitution concurrently (like we do when finding inverses) we put the substitutions in between { and }. So to swap x with y and y with x in equation1 we would type subs({x=y,y=x}, equation1).
solve
Maple can solve many equations for us. This is the command we used to help us find an equation for the inverse of a function. To solve the equation "equation1" for variable y we would type solve(equation1, y).
surd
Maple treats cube roots and higher differently than we would like. They find what is called the "principal" root and which is often a complex number (involving the value i). To return a real nth root of a real number, we use the command surd. So to find a real nth root of an algebraic expression blah we type surd(blah,n).
Finding Limits
We can use Maple to find limits of functions. The limit symbol is under the "Expressions Tab". Be sure to replace "a" with the value x is approaching and to replace "f" with "f(x)" or whatever the name of the function is, including the variable name.
To evaluate limits as x approaches infinity, we replace "a" with the infinity symbol which can be found under the "Common Symbols" tab.
Last Updated: September 20, 2010