The Maple FAQ

This Book contains answers to all of your Maple questions. If you have any more questions, or if an answer does not solve your problem, please post it in the comments and someone should solve your problem for you.

Development tools

What are your favorite development tools in Maple?

Help for New Users

Questions that apply to new users will appear here.

How do I get the program to give me help I can actually use?

Instead of trying to follow the numerous Help menus, try entering ?topic to go directly to the help page you want. For example, to get help with the int (integration command), enter

?int

at the Maple prompt. You will working examples for each command at the bottom of the help page for the command.

How do I print my session?

Click on "File" and select "Print" from the menu.

I am a new Maple user and I do not know how to program in Maple. What should I do?

Maple's syntax is very intuitive and not complicated. The best way to learn how to use Maple is to take The New User's Tour . The New User's Tour presents the fundamental Maple commands that every user should be aware of. The tour covers many areas of Maple, including: The Maple Worksheet Environment, Numerical Calculations, Algebraic Computations, Graphics, Calculus, Differential Equations, Linear Algebra, Finance and Statistics, Programming, and Online Help. The tour is easy to proceed through, and it can take up to two hours if all topics are examined.

In order to start The New User's Tour you should go to Help --> New User's Tour . The New User's Tour should start in a new window.

I opened a worksheet that I saved before, but now Maple doesn't know the values of the variables I used. Why?

When you open a Maple worksheet you must execute it to get the variables defined. You can do this by stepping through the commands from the beginning, or by clicking on the execute all button on the toolbar which looks like this, !!!

What does "unexpected" mean?


Here are some examples to illustrate syntax errors.
 > fsolve((1-x)/x^2),x);
 `)` unexpected
In this case, I made a typing error; there is an extra right parenthesis after the "2". Removing it fixes the problem.
 
 > fsolve((1-x)/x^2,x);
                                        1.
 
 > y : = sqrt(4);
 `=` unexpected
In this case, the problem is that the ":=" has a blank separating the ":" and the "=".
 
 > y := sqrt(4);
                                      y := 2
 
 > by:=3;
 `:=` unexpected
In this case, the problem is that the variable name "by" is a word reserved by Maple for another meaning. Here's a list of such reserved words:
by do done elif else end fi for from if in local od option options proc quit read save stop then to while

Why doesn't Maple recognize the standard mathematical function name I gave it?


Here is an example to illustrate the problem.
  
 > y := SQRT(4);
                                   y := SQRT(4)
To get the square root function, you must use the name "sqrt", because Maple is case sensitive. Other examples of this are:
  • use "Pi" rather than "pi" to get 3.141etc
  • use "exp(1)" rather than "e" to get 2.718etc
  • use "I" rather than "i" to get the square root of minus 1
Also note that, for example, "Int" and "int" are both Maple commands, but work differently.

Help with Plotting

Any questions that apply to plotting in Maple will appear here.

Plots for statistics and probabilities

Click on links below to obtain tips, tricks and FAQ about plotting for probability and statistics.

Density plot (surface) and Value at Risk plot

Here is a sheet that shows how to use surface to plot density functions.

It shows also how to use such plot for "Value at Risk" figures.

See Value at Risk definition at Wikipedia.

View 744_plot-fill.mw on MapleNet or Download 744_plot-fill.mw
View file details

Why did my graph turn out empty or blank?

A1: You forgot to specify a range on the independent variable.

 > f:=2-x;
 > plot(f);              WRONG
 Plotting error, empty plot
 > plot(f,x=-1..1);      RIGHT
 

A2: You might be plotting a quantity that isn't defined.
For example, you might have defined Y but then asked Maple
to plot y. Maple is case-sensitive, and many strange
behaviors are the result of typing a variable name in the
wrong case.

Another way a plotted quantity can be undefined is if you
didn't use the assignment operator := to define it.

 > y=sin(x);              WRONG
 > plot(y,x=-1..1);
 Plotting error, empty plot
 

A3: There might be a scaling problem, as in this example.

 > plot(exp(x^2),x=0..10);
 

Here the numbers get so big that all of the points Maple
calculates before the last one are negligible compared to the
last point in the plot, so they are all lost in the x-axis
and no curve appears.

A4: The quantity you are trying to plot might contain variables
other than the independent variable in the plot.

 > g:=x^2-3*a;
                                        2
                                  g := x  - 3 a

 > plot(g,x=-1..1);
 Plotting error, empty plot.

Here both a and x are variables in the definition of g. In order
to plot a function Maple needs to compute numerical values for it
at different values of x, and that's impossible until all of the
other quantities in the function have been given numerical values.
In this example, assigning a value to "a" fixes the problem.

 > a:=1;
 > plot(g,x=-1..1);          Now this command works.

Basic Maple Commands

Help with using the simple Maple Commands

How do I undefine a variable to put it back to being a variable?

To undefine x, enter

x:='x';

To restart Maple with its memory cleared, enter restart.

Pass to a procedure the name of a geometrical object

It is possible to pass to a procedure a name which will be used to name a geometric object.

with(geometry):

f:=proc(n, x,y); point(n, x,y); end proc;

Maple Equation

f('A', 1, 1);

Maple Equation

coordinates(A);

Maple Equation

This post was generated using the MaplePrimes File Manager

View 744_name-geometry.mw on MapleNet or Download 744_name-geometry.mw
View file details

What does "a constant is invalid as a variable" mean?


Here are some examples illustrating this problem
 
 > x:=3;
   ...various other calculations, during which you forget that you
      gave x a value
 > solve(2*x=1,x);
 Error, (in solve) invalid arguments
 
 > plot(2*x,x=-1..1);  No complaint is written out, but the plot is
                       just the line y=6.
Here x already equals 3, so it doesn't make sense to use it in an assertion like "2*x=1", and plotting "2*x" is just plotting "6". Just as the above section shows an example of having too many indeterminates, this example shows what happens when there are too few. Putting x back to a symbol solves the problem.
 
 > x:='x';
 > solve(2*x=1,x);     Now these commands work as expected.
 > plot(2*x,x=-1..1);
Notice that the quote marks are single regular quote marks, not double (") or back-quote (`) marks.
 
 > solve(g=0,x,x=-1..2);
 Error, (in solve) invalid arguments
This message means you supplied too many or too few arguments to the command, or arguments of the wrong kind. In this example the problem is that the "solve" command does not expect an interval over which to search for solutions (it's "fsolve" that can do that). Removing the extra parameter fixes the problem.
 
 > solve(g=0,x);
                                    1/2     1/2
                                   3   , - 3

"Solve" can handle (some) inequalities, but "fsolve" can't.
 
 > fsolve(g>0,x);
 Error, (in fsolve) invalid arguments

When I enter the same command repeatedly, why does it do something different each time?

Some commands change the internal state of the calculation, so the results have to be different each time. For example, if x is 1, entering x:=x+1; repeatedly obviously yields values of x that count up.

A less obvious way that a command can do different things different times it is used is if it includes the % reference to the previous result. Then, the result from the command will depend on what the previous result was. It is less confusing to assign a name to a result you want to use again, rather than referring to it with %.

Why doesn't my function definition work?


Here are two correct ways to define functions.
 
 > f:=2-x;           One way is by assigning a formula to a name.
 > plot(f,x=-1..1);  If you use this method you can refer to f,
 > solve(f=0,x);     BUT referring to "f(x)" yields nonsense.
 > f(x);      WRONG      
                                     2 - x(x)
 
 
 > f:=x->x^2;          Another way is by using an arrow. 
 > f(x);               If you use this method you can refer to f(x),
 > f(1);               BUT referring to just "f" only yields "f",
 > plot(f(x),x=-1..1); not the function.
 > solve(f(x)=0,x);
 > f;         WRONG
                                       f

Here is an INCORRECT way of defining a function.
 
 > f(x):=2-x;        This assigns the formula to the name "f(x)",
                     but for f(1) and similar expressions Maple
                     just returns the same thing you type in.
Here is another INCORRECT way of defining a function.
 
 > f=2-x;            This is an assertion rather than an assignment,
                     so it doesn't change the value of f at all,
                     and for f Maple will just return the name "f"
                     rather than 2-x.