Skip to main content

Exploring Calculus with Maple Introductory Calculus

Appendix A List of Common Errors

In this section, we will review some of the most common errors encountered when using Maple. Many of these errors are caused when using 2D Math, which makes complicated expressions look pretty but can cause other issues. For a description of font styles, see The Maple Environment.

Missing Brackets.

In Maple, we will use several types of brackets such as parentheses, square brackets, and curly braces. Maple refers to these as delimiters. If these delimiters are not found in pairs, then Maple will be unable to understand the syntax of your command.

Example A.1.

In this example, there is an open square bracket, but no square closed bracket.
> plot( [f(x), g(x), x =-5..5);
Error, mismatched or missing bracket

Spelling Errors.

Maple cannot correct for poor spelling. If a command is misspelled, then it will treat the command as a variable name.

Example A.2.

Maple doesn’t know to solve this equation if you don’t spell the solve() command properly!
> slove(x^2 = 4);
\begin{equation*} \displaystyle slove \left( {x}^{2}=4 \right) \end{equation*}

The % Shortcut Not Working as Intended.

The % shortcut will only use the output command that was last run and not necessarily the output of the command that is on the Maple input immediately above. It is usually a good practice to use the % operator on the same line as the previous command to avoid this issue.

Example A.3.

In this example, the expected output of the second command is the decimal value of \(\cos(\pi)\text{,}\) which is equal to \(-1\text{.}\) However, it appears that the second command was run again after the running third, producing the decimal approximation of the third command.

Aside

> subs(x = Pi, cos(x));
\begin{equation*} \displaystyle \cos \left( \pi \right) \end{equation*}
> evalf(%)
\begin{equation*} \displaystyle 0.6735930582 \end{equation*}
> fsolve(x^3 + 4*x = 3);
\begin{equation*} \displaystyle 0.6735930582 \end{equation*}

Missing Multiplication Between Variables.

Whenever two variables (such as \(x\) and \(y\)) are multiplied together, you must explicitly include the multiplication sign between them. If no * or space is included between the variables, it may be interpreted as an entirely different variable name.

Example A.4.

In this example, no multiplication was included between \(x\) and \(y\text{.}\) Maple mistakenly thinks that \(xy\) is the name of a third variable.
> implicitplot(x^2 + y^2 = 6xy, x =-5..5, y =-5..5);
invalid input: the following extra unknowns were found in the 
input expression: xy

Spaces and Parentheses: Multiplication versus Functions.

When typing in 2D Math (the default font), spaces and parentheses may be interpreted by Maple in unintended ways. When using commands, make sure that there is no space between the command name and its parentheses. This will be treated as multiplication.

Example A.5.

In this example, Maple thinks that the word β€œplot” should be multiplied by the expression in parentheses. This is why the name of the command appears in the output.
> plot (x^2 + 5);

\begin{equation*} \displaystyle plot \, \left( {x}^{2}+5 \right) \end{equation*}
Similarly, if there is no space or * between a variable name and the parentheses, the notation may be mistaken as function notation.

Example A.6.

Clearly, Maple should be able to expand this basic expression. However, it misinterprets the user’s input as being function notation. Maple reads this expression as β€œ\(x\) of \(x^3-1\)”.
> expand(2*x(x^3 - 1));

\begin{equation*} \displaystyle 2\,x \left( {x}^{3}-1 \right) \end{equation*}

Assigning Expressions to \(x\) or Other Common Variable Names.

It’s never a good idea to assign an expression to \(x\text{,}\) \(y\text{,}\) \(t\text{,}\) or other common variable names. If you want to unassign everything at once, you can do this with the restart command on a separate line.

Aside

Example A.7.

In this example, the value \(3\) is assigned to \(x\text{,}\) so the expression \(x^2-4x-12\) is equal to the value \(-15\text{.}\) This is remedied after using the restart command.
> x := 3;
\begin{equation*} \displaystyle x\, := \,3 \end{equation*}
> factor(x^2 - 4x - 12);
\begin{equation*} \displaystyle -15 \end{equation*}
> restart; factor(x^2 - 4x - 12);
\begin{equation*} \displaystyle \left( x+2 \right) \left( x-6 \right) \end{equation*}

Equals Signs versus Assignment Operator.

The equals sign = must be used for an equation and the assignment operator := is used to store a value or expression for later use.

Example A.8.

The equals sign should be used for the subs() command here, since we are not assigning the value for the remainder of the document.
> subs(x := 5, cos(x) - 1);
Error, invalid assignment

Changing the Order of the Parameters in a Command.

Many commands have multiple parameters and often the order in which the parameters is listed is important. Typing the parameters in an incorrect order in certain commands may cause an error message to be displayed when the command is executed.

Example A.9.

In this example, the two parameters in the subs() command need to be interchanged.
> subs(4x-3, x=2);
Error, invalid input: subs received 4x-3, which is not valid for its 1st argument

Assigning a Function and Not Using Function Notation.

If you have assigned a function (such as \(f(x)\)) in Maple, make sure to use function notation in other commands, rather than using only the name of the function.

Example A.10.

In this example, the factor() command should be factor(f(x)).
> f(x) := x^2 - 4;
\begin{equation*} \displaystyle f\, := \,x\mapsto {x}^{2}-4 \end{equation*}
> factor(f);
\begin{equation*} \displaystyle f \end{equation*}

Case-Sensitive Commands.

Commands are case-sensitive. Make sure to use the correct capitalization.

Example A.11.

The correct command here is solve(), which needs a lowercase β€˜s’.
> Solve(3*x + 5 = 2);
\begin{equation*} \displaystyle \textit{Solve} \left( 3\,x+5=2 \right) \end{equation*}
There are examples of commands where the capitalized version behaves differently from the non-capitalized version.

Example A.12.

In this example, the Int() command and int() command behave differently. Using Int() followed by value(%) is a good way to display the integral and then evaluate it.
> Int(2*x, x = 10 .. 13)
\begin{equation*} \displaystyle \int_{10}^{13}\!2\,x\,{ d}x \end{equation*}
> int(2*x, x = 10 .. 13)
\begin{equation*} \displaystyle 69 \end{equation*}