Entering 2-D Math
2-D math entry allows you to enter mathematical expressions in standard form as found in papers and books.
This document discusses general entry and entry for specific classes of expressions using 2-D math.
To interact with the examples on this page, open it as worksheet and execute the steps.
Note for non-Windows users: The keystrokes given in this document are for Windows. There will be differences for other platforms. For instance, for Mac users, replace Ctrl with Command to follow the examples. For more keyboard shortcuts for your platform, see Shortcut Keys.
Executable and Nonexecutable Math
Separators while Programming in 2-D Math
Derivative Notation and Implied Dependency
Generalized Operators and Equations
Atomic Variables (Literal Names)
Much of the standard entry is covered on the 2-D Math Shortcut Keys help page, including how to navigate 2-D expressions and how to escape characters that are shortcut keys.
For more introductory information, see the basic Overview of 2-D Math and the material found under Getting Started in the Maple Help System.
This page covers some further details and demonstrates a few nuances using some helpful examples.
2-D math expressions are by default executable.
To evaluate an expression and display the result on a new line, press:
Enter, Windows and Linux
To evaluate an expression and display the result inline, press:
Alt + Enter, or Ctrl + =, Windows and Linux
Alt + Return, or Command + =, Mac
You can toggle a 2-D math expression to nonexecutable math. Use nonexecutable math for expressions that are intended only for display.
When you are editing a 2-D math expression, the background color indicates if the math is executable (blue background) or nonexecutable (gray background).
To toggle between executable and nonexecutable math, click an expression and use the shortcut key Shift + F5. Alternatively, under the Edit menu, clear the check box beside Executable Math.
Tip: If an expression is executed accidentally, it can lead to error messages (if it is not valid Maple syntax) or unwanted output. If this happens, toggling the expression to nonexecutable math removes the error message or output and changes the math to nonexecutable.
Top of the Page
In general, you can use * or a space to imply multiplication. In 2-D math, * appears as a center dot (⋅).
2-D math input allows for some implicit multiplication, that is, writing a multiplication operation without requiring a multiplication sign. For example, a space is used between x and x to mean multiplication:
x x = x2
Tip: Troubleshooting your mathematics is easier if you use explicit multiplication symbols.
Exceptions to this rule include cases where it is clear that only multiplication can be implied. Then a space is not necessary:
Note: For a product containing integers and decimals, implicit multiplication can be used only if the number occurs in the left-most position in the product. For products of numbers, use explicit multiplication (*). However, you can use implicit multiplication for products containing fractions.
2 x = 2⁢x
Error, missing operation
2⋅3 = 6
2.3⋅5.3333333333 = 12.26666667
23 53 = 109
To avoid common errors in entering expressions in 2-D math, Maple automatically inserts an explicit multiplication symbol in certain cases. You can control this feature. For details, see the Convert Space to Explicit Multiplication Operator section of the Options Dialog.
Using space to imply multiplication
Expression and result
Space between x and x
x x = x2
Space between x and (x+1)
Space between f and (x+1)
When you type a space between x and (x+1), Maple automatically inserts an explicit multiplication symbol to indicate multiplication.
expandx⋅x+1 = x2+x
expandf⋅x+1 = f⁢x+f
No space between f and x
The expression parses differently than
expandf ⋅x+1 = f⁢x+f
because without the space it means function application.
expandfx+1 = f⁡x+1
Caution: Do not put a space between a function name and its arguments. This will be interpreted as multiplication.
This results in the incorrect result see here, because a space between cos and (a) is multiplication!
With no space, this is the cos function applied to a, and the result is 1, as expected.
cos⋅a = 0
cosa = 1
In addition, by default, expressions like 2x and 2.1667y parse to products instead of operators (the latter being the default in 1-D math).
This behavior can be changed using the Typesetting Rule Assistant, or by adjusting Typesetting settings as follows:
The 2-D math mode allows direct entry of 2-D mathematical objects, such as integrals, sums, products, and limits.
Command-Symbol Completion Keys
Esc, Mac, Windows, and Linux
Ctrl + Space, Windows
Ctrl + Shift + Space, Linux
These are also available on the Expression and Calculus palettes.
∑i=1ni = n+122−n2−12
Type sum and use command completion to select ∑
Press Ctrl + ' and type i=1
Use Right Arrow key to exit subscript
Press Ctrl + Shift + " and type n
Use Right Arrow key to exit superscript
Type sum and use command completion to select ∑lr⁡f
Press Tab to move between placeholders and replace:
l with i=1
r with n
f with i
limx→0+1x = ∞
Type lim or limit, press Ctrl + ' , type x ->0+
Press Right Arrow key
Type lim and use command completion to select limx→a⁡f
x with x
a with 0+
f with 1x
limitx→0−1x = −∞
Type lim or limit, press Ctrl + ' , type x ->0−
Integrals require a special character for the 'd' prefix of the integration variable (DifferentialD):
∫010x ⅆx = 50
Type int and use command completion to select ∫
Press Ctrl + Shift + _ and type 0.
Press Shift + ^ and type 10
Type x d and use command completion to select the Differential'd'
The integration limits can also be entered over and under the integral sign:
Press Ctrl + ' and type 0
Press Ctrl + Shift + " and type 10
In addition, many formatted 2-D notations are directly available in the command-symbol completion mechanism. This alternative entry technique is demonstrated here:
Type intand use command completion to select ∫abfⅆx
a with 0
b with 10
f with x
Inert functions are used to delay evaluation. That is, during computations, the operation they represent remains unperformed.
Inert versions of the int, sum, and limit functions are denoted by the symbols appearing gray in color, the inert version of eval has the evaluation bar in gray, and the inert diff function has the differentiation symbols in gray.
You can enter these functions in 2-D math in two ways:
Example: ∫x ⅆx = ∫xⅆx
Using command-symbol completion:
The inert functions can be entered with command-symbol completion using the inert versions of the function names, such as Int and Sum.
Type Int and use command completion to select ∫fⅆx
Press Tab to replace the placeholders f and x with x
The active (noninert) functions can be entered from the palettes. You can then convert the expression to its inert form.
From the Expression or Calculus palette, select the template ∫fⅆx.
From the Context Panel for the expression, select 2-D Math > Convert To > Inert Form. (The ∫ and ⅆ turns gray in color.)
Top of the page
In general, 2-D math statements do not need to be terminated with a semicolon. However, a statement separator (semicolon or colon) is necessary between two statements in one input region. Otherwise, there will be ambiguity when Maple parses multiple statements.
In the following example, an error occurs because a separator has been omitted between the two statements entered between the use and end use keywords.
use LinearAlgebra in y≔a z≔a end use
Error, unterminated 'use'
This issue can be resolved by adding a semicolon after the first statement.
use LinearAlgebra in y≔a; z≔a end use
To suppress the output, use a colon after the end use statement:
use LinearAlgebra in y≔a; z≔a end use:
Many standard derivative notations are supported for 2-D math entry methods, including prime notation, dot notation, Leibniz notation, and repeated index notation, but there are a number of settings that you must be aware of when using these. Display in output can be controlled as well.
Prime notation, by default, uses the variable x. When entering a derivative in prime notation, if no dependency is present, then the function is assumed to be a function of x. For example:
y'+3 y =0
If an explicit dependency is present, the function is assumed to be the derivative of a function of x evaluated at that value. If the dependent variable is not assigned, or is a known function (like sin), then D notation is used:
To enter the prime notation:
Type the expression in math mode, or
From the Calculus palette, select the appropriate template. To fill in the content, navigate through the placeholders using the Tab key.
If the dependent variable is assigned, and is not a known function, then eval/diff notation is used:
q ≔ procx 'procname'x; end proc:
The variable becomes more important when prime is applied to an expression, as follows:
Dot notation, by default, uses the variable t, so names with a dot and no dependencies explicitly listed are assumed to depend on t:
y.+3 y =0
The dot notation can be entered in one of the following ways:
Using keyboard shortcuts
Using palette templates
Press Ctrl + Shift + "
Use the Right Arrow key to leave the superscript position
Select A.. from the Calculus palette
Replace A with f
Just as for primes, the use of dot with an explicit dependency different from the dot variable is assumed to be the derivative of a function of t evaluated at that value:
To enter the dot notation:
Prime or Dot Notation in Output Display
The output display can be modified to use prime and/or dot notation in the interactive Typesetting Rule Assistant, or by using the Typesetting package Settings command.
For example, use dot notation in typeset derivatives in place of ⅆⅆt notation:
Leibniz notation can be used to specify derivatives and partial derivatives. Short-form use for partial derivatives requires that the function dependencies be suppressed. Function dependency suppression can be enabled in the interactive Typesetting Rule Assistant, or by using the Typesetting package Suppress command.
ⅆⅆ x x2+x
To enter the Leibniz notation for univariate differentiation, select ⅆⅆx⁡f and ⅆ2ⅆx2⁡f , respectively, from the Calculus palette and press Tab to fill in the contents.
∂∂ xx2 y
∂2∂ x⁢∂ y x2+y2+z2
To enter the Leibniz notation for multivariate differentiation, select ∂∂x⁡f and ∂2∂x⁢∂y⁡f , respectively, from the Calculus palette and press Tab to fill in the contents.
Short form of Leibniz notation:
You can use Typesetting:-Suppress to evaluate the derivative as follows:
∂∂ x f
This typeset enables short-form entry of function names as well:
To enable repeated index notation for partial derivatives, use the following command:
In addition to standard matrix and vector-style entry, 2-D math also supports vector and vector calculus operations in standard syntax through the VectorCalculus package.
Type &x as cross-product operator:
1,2,3 &x 7,8,0
Or, use × from the Common Symbols palette:
In the following example, note the change in display of output for 1,2,3×7,8,0 after unloading the package.
The coordinate system can be specified within individual calls:
Or, set coordinate system as follows:
Choose from one of the following input style:
From the Common Symbols palette, select ∇, or type nabla and use command completion to select ∇.
Alternatively, type Gradient, select ∇x and enter the vector field.
Note: For computation using other coordinate systems, see VectorCalculus[Coordinates].
Use one of the following methods:
Nabla . x2,y2,z2
Del . VectorFieldx2,y2,z2
The vector field can be assigned separately as well:
From the Common Symbols palette, select ∇ followed by · .
Alternatively, type Del or Nabla to enter the Del operator, or type Divergence, select ∇·x and enter the vector field.
Note: For computation using other coordinate systems, see VectorCalculus/Coordinates.
Nabla &x VectorFieldx y,y,z
Del &x VectorFieldx y,y,z
Create the vector field separately:
C ≔ VectorFieldx y,y,z
From the Common Symbols palette, select ∇ followed by × . Or, type Del or Nabla to enter the Del operator, or type Curl, select ∇×x and enter the vector field.
∇×x y, y,z
Laplacian in Cartesian coordinates:
Laplacian using polar coordinates:
Laplacian using cylindrical coordinates:
Laplacianr+cosθ+z, 'cylindrical'r, θ,z
Use expressions of the form (Del . Del)(f), Del . (Del(f)), or Del . Del(f):
Type Del or Nabla to enter the Del operator, or type Laplacian, select ∇2x and enter the vector field.
Alternatively, press Shift + ^ to enter 2 as exponent of Del. Use right arrow key to leave exponent.
From the Expression palette, select ab. Use the Tab key to move between placeholders and replace a with ∇ (available in the Common Symbols palette) and b with 2.
For convenience and control you can customize 2-D math typesetting of special functions. There are three ways to input special functions: by calling sequence, by command completion, or by enabling parsing rules. You can control the output display of special functions as well.
Special Functions Entry in Input
You can enter special functions in Maple using their calling sequences, for example, BesselJ(v,x) is the Bessel function of the first kind.
You can also use the command completion mechanism to enter special functions in a typeset mathematical notation (textbook notation).
For example,type BesselJ, use command completion to select Jv⁡x, and press Tab to replace v with v and x with x.
Similarly, enter the BesselI function.
In addition, the completion of functions where the mathematical notation is based on an alphanumeric character is available by using command-symbol completion on that character. For example, to enter the BesselI function using command completion, type I and select Iv⁡x.
The final option is to enable parsing rules so you can enter, for example, J with a subscript and have it parsed as the BesselJ function. In most cases, the rules for 2-D math entry must be enabled using the Typesetting Rule Assistant or from the command line using the Typesetting[EnableParseRule] function.
Enable the parse rules for Bessel functions.
Now you can enter Bessel functions in standard notation.
Type input as shown:
Special Function Display in Output
You can change the display of special functions in the output using the Typesetting:-EnableTypesetRule command.
Note: Under standard typesetting mode, the option for typeset display of special functions has no effect:
You can also control the typeset display for individual special functions through the Typesetting Rule Assistant.
MathML operators available within Maple parse, by default, to binary operators using the same name as the normalized entity name.
Note: The precedence of these operators is the same as for '=' for any operators in the Arrows, Relational, Relational Round, and Negated palettes, and the same as neutral operators '&...' for all other operators.
expr⁢≔ a ≪b;
expr is actually stored as a function with function name `≪`. If you enter the following:
Enter the much less than operator from the Relational palette.
The ≤operator can be entered in one of the following ways:
Type leq and use the command completion method
Select the operator from the Relational palette
Following is an example which demonstrates that any non-equivalence operators have higher precedence than multiplication:
a⋅b ⊠ c⋅da⋅d
Now, compare this result to the the following:
Here the multiplication operator has higher precedence.
For the first example:
Select the ab template from the Expression palette
To enter the boxtimes operator, type boxtimes and use the command completion method.
Press Tab to enter a*d as denominator
The ± and ∓ operators have special precedence rules that enable them to be used in two forms.
The default is to treat them with the same precedence as addition, in which case they can be used to describe an expression with two optional values, one choosing the upper operator, and the other choosing the lower operator. In this case, these operators are internally represented as unary operators.
An optional equation using ±and/or ∓:
At this point, the value of 'whichval' lets you change the value of the expression:
Alternatively, the ± symbol can be used as a binary operator to describe a tolerance from the Tolerances package.
The meaning of the symbol can be switched from use for optional values to tolerances in either the Typesetting Rule Assistant, by the command line Typesetting:-Settings command, or simply by loading the Tolerances package:
5.00 ± 0.300
2.01 ± 0.300
Available logical (boolean) operators in 2-D math include nand, nor, and iff, defined in terms of the existing logic operations not, and, or, xor, and implies. Each boolean operation has a symbolic counterpart.
Each logic operation, the MathML symbol used, and the symbolic form are demonstrated in the following table:
not⁢a = nota
¬a = nota
a⁢nand⁢b = notaandb
a⁢↑b = notaandb
a⁢and⁢b = aandb
a⁢∧b = aandb
a⁢nor⁢b = notaorb
a⁢↓b = notaorb
a⁢or⁢b = aorb
a⁢∨b = aorb
a⁢xor⁢b = axorb
a⁢⊻b = axorb
a⁢implies⁢b = a⇒b
a⁢⇒b = a⇒b
a⁢iff⁢b = a⇒bandb⇒a
a⁢⇔b = a⇒bandb⇒a
As an additional convenience, the nand, nor, xor, and implies operations have completion shortcuts available for their corresponding symbols (as their MathML entity names are quite different).
Type a implies
Use command completion to enter ⇒
Type b and press Enter to evaluate
When the Logic package is loaded, the logic expressions, in both symbolic and verbal form, parse to Logic package operations. Note: While the outputs display similarly, there are differences between the underlying implementation of the Logic package operators and the top-level logical operators. For more information, see the help pages boolean, Logic, and Logic Package Operators.
Note: When the Logic package is loaded, the standard logic operations are still available in prefix form.
Maple can work with composite or colored objects that are to be considered distinct from the components making up the objects or the object without the same color attributes. These objects are called atomic objects.
If you want to display a single Maple expression as an atomic object, select the expression, and then in the Format>Convert to menu, select the Atomic Variable check box. This can also be accessed through the Context Panel for the expression: 2-D math>Convert To>Atomic Variable. Alternatively, press Ctrl + Shift + A (Windows and Linux) or Command + Shift + A (Mac).
In simple cases where a script object is composed with a base and one or more scripts of a simple type (identifier, operator, or number), which otherwise has no meaning in Maple, these objects become atomic automatically.
Press Ctrl + Shift + " to enter the overscript for x
Use one of the following methods to enter tilde:
Press Shift + ~
Select ~ from the Common Symbols palette
Type tilde and use command completion method
Use Right Arrow key to leave overscript
This name assigned to var is different from x, and in fact has no relation to x, as it is x tilde.
Assigning the value of x does not affect this name.
Furthermore, x tilde is treated as any other name in Maple.
For this reason, in some cases where a parse error would result, the expression is instead assumed to be of atomic type, and is treated as such. For example, the following three values would result in parse errors, but since they are simple objects, are instead identified as atomic objects.
To enter the superscript for x press Shift + ^ . Use Right Arrow key to leave superscript.
The internal representations of these atomic variables are composed of MathML construct, which can be displayed in the following manner:
If this automatic behavior is not desired, it can be disabled through the Typesetting Settings command or through the Typesetting Rule Assistant:
Error, invalid power
Expressions that would normally parse as Maple objects can be converted to atomic objects using the context menu. For example, x with a subscript of 1 is normally interpreted as a table reference:
Note that this returns '1' subscripted by '1' because x was assigned to 1 earlier.
To work with this notation as a name, different from x, enter the expression, select it, then from the Context Panel select 2-D math>Convert To>Atomic Variable and evaluate.
Alternately, in this specific case, you can use two underscores (Shift + _ _) to create a subscripted name called a literal subscript.
Note that the atomic variable x is different from the indexed one.
Again, note the following example with Array:
A â‰” 0,1,3,4
The following indexed subscript returns the element in the first position of Array A (equivalent to A):
However, once A subscript 1 is converted to an atomic variable, it evaluates in this manner:
This is equivalent to calling A__1.
In addition to the ability to compose objects to construct semantically different objects, you can also use color. When an automatic atomic object contains colors different from the default, these become part of the atomic object. If the View>Atomic Variable option is set, then all atomic variables, including ones with non-default colors, are shown in magenta. It is recommended that you avoid using the default input and output colors (black and blue) to distinguish objects.
For example, you can construct the name green x that is different from x by changing the color of an x to green. Select the x. From the Context Panel select 2-D Math>Format>Color. Select green, and click OK. To make it atomic, select the green x, and from the Context Panel select 2-D Math>Convert To>Atomic Variable.
And as an example of using green x in a for loop:
for x to 5 do printx,x; end do
2-D Math Shortcut Keys
Typesetting Rule Assistant
Quick Help Details
Download Help Document