Entering 2D Math
2D math entry allows you to enter mathematical expressions in standard form as found in business and academic documents.
This document discusses general entry and entry for specific classes of expressions using 2D math.
Standard Entry
2D Operators
Separators while Programming in 2D Math
Derivative Notation and Implied Dependency
Vector Calculus
Special Functions
Generalized Operators and Equations
Tolerances/Optional Forms
Logic
Atomic Identifiers (Literal Names)

Standard Entry


Much of the standard entry is covered on the 2D Math Shortcut Keys help page, including how to navigate 2D expressions and how to escape characters that are shortcut keys. This page covers some further details and demonstrates a few nuances using examples that may be helpful.
2D math input allows for implicit multiplication, that is, writing a multiplication operation without requiring a multiplication sign.
In general, you can use a space to imply multiplication.
The following examples use a space to imply multiplication.
Using space to imply multiplication

Expression and result

Space between x and x

=

Space between x and (x+1)
Space between f and x

=
=

No space between f and x
The expression parses differently than
=

=



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 leftmost position in the product. For products of numbers, use explicit multiplication (). However, products containing fractions can use implicit multiplication.
Valid

=

Not valid

Error, missing operation
 

Valid

=
=

Valid

=



With 2D math input, multiple addition/subtraction operators and operations merge, unlike the situation with 1D input:
=
In addition, by default, expressions like and parse to products instead of operators (the latter being the default in 1D math).
This behavior can be changed using the Typesetting Rule Assistant, or by adjusting Typesetting settings as follows:
=
=
Top of the Page


2D Operators


The 2D math mode also allows direct entry of 2D mathematical objects, such as integrals, sums, products, and limits. Note that these are also available on the Expression palette.
CommandSymbol Completion Keys
•

Command + Shift + Space, Macintosh

•

Ctrl + Shift + Space, UNIX




Note: The following examples identify key strokes. The "Ctrl"+"=" key strokes can be substituted with pressing Enter.
As an example, you can enter a definite sum using the following keystrokes:
sum<command completion, and select the sum symbol><Ctrl+'>i=1<Right Arrow><Ctrl+">n<Right Arrow>i
<Ctrl+=>
=
A product can be entered in much the same way.
As for limits, the standard notation is also supported, including directional limits with the direction either inline or as a superscript. Here is an example with keystrokes:
lim<Ctrl+'>x>0+<Right Arrow>1/x<Right Arrow><Ctrl+=>
=
And another example:
limit<Ctrl+'>x>0^<Right Arrow><Right Arrow>1/x<Right Arrow><Ctrl+=>
=
Integrals require a special character for the 'd' prefix of the integration variable (DifferentialD), as shown in the following:
int<command completion and select the 'int' symbol>_0<Right Arrow>^10<Right Arrow>x d<command completion, and select 'd (differential)'>x<Ctrl+=>
=
Note: Integration limits can be entered over and under the integral sign if desired, as in the following:
int<command completion and select the 'int' symbol><Ctrl+'> 0< Right Arrow><Ctrl+">10<Right Arrow>x d<command completion and select 'd (differential)'>x<Ctrl+=>
=
In addition, many formatted 2D notations are directly available in the commandsymbol completion mechanism.
For the int example above, an alternative entry technique is as follows:
int<command completion and select int with limits>0<tab>10<tab>x<tab>x<Ctrl+=>
=
Inert Functions
Inert versions of these functions are denoted by color. The inert versions of int, sum, and product have their symbol in dark gray, the inert version of eval has the evaluation bar in dark gray, and the inert diff function has the differentiation symbols in dark gray.
You can enter these functions in 2D math in two ways:
1) Using commandsymbol completion:
The inert functions can be entered with commandsymbol completion using the inert versions of the function names, such as Int and Sum. For example:
Int<command completion and select the Int (inert) pattern with no limits>x<tab>x<Ctrl+=>
=
Note that inert operations are indicated by a trailing (inert) on the rule name.
In addition, inert versions of the operators themselves are also available as follows:
Int<command completion and select the "Int (inert)" symbol>x d<command completion and select "d (inert)">x<Ctrl+=>
=
2) Using the context menu:
An entered integral can be converted to inert. Select the integral sign, and rightclick (Controlclick, for Macintosh) to display the context menu. Select 2D Math>Convert To>Make Inert.
int<command completion enter>x d<command completion and select "d (differential)">x<highlight the integral sign and convert to inert><click after dx><Ctrl+=>
=
Top of the page


Separators while Programming in 2D Math


In general, 2D 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.
This issue can be resolved by adding a semicolon after the first statement.
 (3.1) 
To suppress the output, use a colon after the end use statement:


Derivative Notation and Implied Dependency


Many standard derivative notations are supported for 2D 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.
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:
Windows/UNIX

Macintosh

f'''<Ctrl + =>

f'''<Command + =>



=
If an explicit dependency is present, then 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:
Windows/UNIX

Macintosh

f'''(0)<Ctrl + =>

f'''(0)<Command + =>



=
If the dependent variable is assigned, and is not a known function, then eval/diff notation is used:
Windows/UNIX

Macintosh

q''(0)<Ctrl + =>

q''(0)<Command + =>



=
The variable becomes more important when prime is applied to an expression, as follows:
Windows/UNIX

Macintosh

(x^2<Right Arrow>+x)'<Ctrl + =>

(x^2<Right Arrow>+x)'<Command + =>



=
The variable to which prime corresponds can be changed in the Typesetting Rule Assistant, or using the command line Typesetting:Settings command.
It has one special value, the empty identifier (blank or ``), which indicates that prime notation corresponds to use of D or eval/diff notation:
=
=
=
Note that the placeholder was used for eval/diff notation.
Dot notation, by default, uses the variable , so names with a dot and no dependencies explicitly listed are assumed to depend on :
Windows/UNIX

Macintosh

f<Ctrl + Shift + ">..<Right Arrow><Ctrl + =>

f<Command + Shift + ">..<Right Arrow><Command + =>



=
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 evaluated at that value:
Windows/UNIX

Macintosh

f<Ctrl + Shift + ">..<Right Arrow>(0)<Ctrl + =>

f<Command + Shift + ">..<Right Arrow>(0)<Command + =>



=
Unlike prime, dot can only be used on function names.
The above are examples of implied dependencies, and when used, also provide a short form for entry of differential equations and conditions without requiring an explicit dependency:
 (4.1) 
Leibniz notation can be used to specify derivatives and partial derivatives, but shortform 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.
Univariate Examples:
Windows/UNIX

d<Ctrl + Space and select d>/d<Ctrl + Space and select d>x<Right Arrow>(x^2<Right Arrow>+x)<Ctrl + =>

Macintosh

d<Command + Space and select d>/d<Command + Space and select d>x<Right Arrow>(x^2<Right Arrow>+x)<Command + =>



=
Windows/UNIX

d<Ctrl + Space and select d>^2<Right Arrow>f<Shift + Backspace>/d<Ctrl + Space and select d>x^2<Right Arrow><Right Arrow><Ctrl + =>

Macintosh

d<Command + Space and select d>^2<Right Arrow>f<Shift + Backspace>/d<Command + Space and select d>x^2<Right Arrow><Right Arrow>
<Command + =>



=
Short form and Multivariate Examples (require Suppress):
Windows/UNIX

Pa<Ctrl + Space and select PartialD>f<Shift + Backspace>/Pa<Ctrl + Space and select PartialD>x<Right Arrow><Ctrl + =>

Macintosh

Pa<Command + Space and select PartialD>f<Shift + Backspace>/Pa<Command + Space and select PartialD>x<Right Arrow><Command + =>



=
Windows/UNIX

Pa<Ctrl + Space and select PartialD>^4<Right Arrow>g<Shift + Backspace>/Pa<Ctrl + Space and select PartialD>x^3<Right Arrow>/Pa<Ctrl + Space and select PartialD>z<Right Arrow><Ctrl + =>

Macintosh

Pa<Command + Space and select PartialD>^4<Right Arrow>g<Shift + Backspace>/Pa<Command + Space and select PartialD>x^3<Right Arrow>/Pa<Command + Space and select PartialD>z<Right Arrow><Ctrl + =>



=
Note: Suppression also enables shortform entry of functions by name.
=
In addition, repeated index notation for partial derivatives can be used, if enabled.
Windows/UNIX

Macintosh

g_x,x,x,z<Right Arrow><Ctrl + =>

g_x,x,x,z<Right Arrow><Command + =>



=
Top of the page


Vector Calculus


In addition to standard matrix and vectorstyle entry, 2D math also supports vector and vector calculus operations in standard syntax through the VectorCalculus package.
<1,2>.<0,1><Ctrl+=>
=
<1,2,0>times<command completion and select "times x"> enter <0,1,0><Ctrl+=>
=
Use of vector differential expressions with the nabla( symbol is also supported, but coordinates must be explicitly set using VectorCalculus[SetCoordinates] before use.
Gradient:
nabla<command completion>(x^2<Right arrow>+y z)<Ctrl+=>
=
Divergence:
nabla<command completion>.<x,x,x><Ctrl+=>
=
Curl:
nabla<command completion>times<command completion and select "times x"> enter <x,x,x><Ctrl+=>
=
Laplacian:
nabla<command completion>^2<Right arrow>(x^2<Right arrow>+y z)<Ctrl+=>
=
Other coordinate systems supported by VectorCalculus can be used as well.
nabla<command completion>^2<Right arrow>(r^2<Right Arrow> sin(theta<command completion>)<Ctrl+=>
=
Top of the page


Special Functions


Standard entry forms for special functions are supported by a fixed set of available rules. Display using these rules is also supported from extended typesetting mode. You can set extended display rules using the Options dialog or the command line
•

Ensure that the Typesetting level is set to extended. From the Tools menu, select Options. Click the Display tab, and from the Typesetting level dropdown menu select Extended.

•

Alternately, use the interface(typesetting=extended) option. For details, see the interface help page.

In most cases, the rules for 2D 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.
Enter Bessel functions in standard notation, and display them in standard notation.
J_v<Right arrow>(x)I_v<Right arrow>(x)<Ctrl+=>
 (6.1) 
expr<Ctrl+=>
=
Even when the rules are not enabled, entry of special functions in standard notation is available using the command completion mechanism.
BesselJ<command completion enter><Right Arrow>+BesselI<command completion enter><Ctrl+=>
=
In addition, the completion of functions where the mathematical notation is based on an alphanumeric character is available by using commandsymbol completion on that character.
J<command completion, select J (BesselJ)><Right Arrow>+I<command completion, select I (BesselI)><Ctrl+=>
=
For a complete set of available special function rules, see the Typesetting Rule Assistant.
Top of the page


Generalized Operators and Equations


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.
Example:
expr := a ll<command completion enter>b;<Enter>
 (7.1) 
expr is actually stored as a function with function name `≪`. If you enter the following:
=
=
In addition, entry syntax for equations and inequalities, including any of the extended operators with the same precedence, has been extended to allow inline entry as:
a leq<command completion enter>x<b<Ctrl+=>
=
a ll<command completion enter>x ll<command completion enter>b<Ctrl+=>
=
As an example for other operators, note the precedence:
a*b boxtimes<command completion>c*d<select expression>/a*d<Right Arrow><Ctrl+=>
=
which demonstrates that any nonequivalence operators have higher precedence than multiplication.
Top of the page


Tolerances/Optional Forms


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:
=
=
Top of the page


Logic


Available logic operators in 2D math include nand, nor, and iff, defined in terms of the existing logic operations not, and, or, xor, and implies. Each of these, as well as the standard logic operations, has a symbolic counterpart.
Each logic operation, the MathML symbol used, and the symbolic form are demonstrated in the following table:
Operation

Standard Form

Symbol

Symbol Form

not

=

not

=

nand

=

uarr

=

and

=

and

=

nor

=

darr

=

or

=

or

=

xor

=

veebar

=

implies

=

Implies

=

iff

=

iff

=



In addition, when the Logic package is loaded, these expressions, in both symbolic and verbal form, parse to Logic package operations, as demonstrated in the following table:
Operation

Standard Form

Symbol

Symbol Form

not

=

not

=

nand

=

uarr

=

and

=

and

=

nor

=

darr

=

or

=

or

=

xor

=

veebar

=

implies

=

Implies

=

iff

=

iff

=



Note: When the Logic package is loaded, the standard logic operations are still available in prefix form.
=
=
=
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). For example:
a implies<command completion  select implies arrow> b<Ctrl+=>
=
Top of the page


Atomic Identifiers (Literal Names)


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 Identifier check box. This can also be obtained through the context menu. Rightclick (Controlclick, for Macintosh) and select 2D math>Convert To>Atomic Identifier. Alternatively, press Ctrl + Shift + A (Windows and UNIX) or Shift + Command + A (Macintosh).
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. For example:
var := x<Ctrl+">~<Right Arrow>:<Enter>
This name assigned to is different from , and in fact has no relation to , as it is .
:
=
Assigning the value of does not affect this name.
Furthermore, 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.
[x^@<Right Arrow>,x^&<Right Arrow>,x^.<Right Arrow>]<Ctrl+=>
=
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
 
It is also possible to use expressions that normally would parse to a Maple object as atomic objects by using the context menu. For example, with a subscript of is normally interpreted as a table reference.
x<Ctrl+_>1<Right Arrow><Ctrl+=>
=
Note that this returns '1' subscripted by '1' because was assigned to 1 earlier.
To work with this notation as a name, different from , enter the expression, select it, then rightclick (Controlclick, for Macintosh) and select 2D math>Convert To>Atomic Identifier. Then press Enter to view the result.
 (10.1) 
Alternately, in this specific case, you could use two underscores (_ _) to create a subscripted name, called a literal subscript.
x_ _1<Right Arrow><Ctrl+=>
=
Both of the above are correctly evaluated as the subscripted name, different from x.
The expression above is actually a name composed of the MathML construct needed to display it, or:
 (10.2) 
This is the internal representation for the identifier .
In addition to the ability to compose objects to construct semantically different objects, you can also use color. Note that color is never used as a cue for automatic atomic objects, but when an automatic atomic object does contain colors different from the default, these do become part of the atomic object. 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 that is different from by changing the color of an to . Select the , rightclick (Controlclick, for Macintosh), and select 2D Math>Format>Color. Select green, and click OK. To make it atomic, select the green , rightclick, and select 2D Math>Convert To>Atomic Identifier.
=
And as an example of using green in a for loop:
>


 (10.3) 
Top of the page

