Entering 2-D Math - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Create Maple Worksheets : Enter Expressions : Enter 2-D Math : worksheet/documenting/2DMathDetails

Entering 2-D Math

2-D 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 2-D math.


Standard Entry

2-D Operators

Separators while Programming in 2-D Math

Derivative Notation and Implied Dependency

Vector Calculus

Special Functions

Generalized Operators and Equations

Tolerances/Optional Forms


Atomic Identifiers (Literal Names)

Standard Entry

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. This page covers some further details and demonstrates a few nuances using examples that may be helpful.


2-D 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

xx = x2

Space between x and (x+1)


Space between f and x

expand(x+1x) = x2+x

expandfx+1 = fx+f

No space between f and x

The expression parses differently than

expandfx+1 = fx+f

expandfx+1 = f(x+1)

Exceptions to this rule include cases where it is clear that only multiplication can be implied. Then a space is not necessary:

 2x2 = x

expandx+1x = x2+x


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, products containing fractions can use implicit multiplication.



2x = 2x

Not valid


2.3 5.3333333333

Error, missing operation


23 = 6

2.35.3333333333 = 12.26666667


23 53 = 109


With 2-D math input, multiple addition/subtraction operators and operations merge, unlike the situation with 1-D input:


a++b = a+b

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:



2x = 2


2x = 2x


Top of the Page

2-D Operators

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

Command-Symbol Completion Keys


Command + Shift + Space, Macintosh


Ctrl + Space, Windows


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

i&equals;1ni = 12&lpar;n&plus;1&rpar;212n12

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+=>

limx0+1x = &infin;

And another example:

limit<Ctrl+'>x->0^-<Right Arrow><Right Arrow>1/x<Right Arrow><Ctrl+=>

limitx01x = &infin;


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+=>

010x&DifferentialD;x = 50

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+=>

010x&DifferentialD;x = 50


In addition, many formatted 2-D notations are directly available in the command-symbol 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+=>

010x&DifferentialD;x = 50


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 2-D math in two ways:


1) 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. For example:

Int<command completion and select the Int (inert) pattern with no limits>x<tab>x<Ctrl+=>

x&DifferentialD;x = x&DifferentialD;x

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+=>

x &DifferentialD;x = &int;x&DifferentialD;x 


2) Using the context menu:

An entered integral can be converted to inert. Select the integral sign, and right-click (Control-click, for Macintosh) to display the context menu. Select 2-D 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+=>

x&DifferentialD;x = x&DifferentialD;x

Top of the page

Separators while Programming in 2-D Math

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   ya   za end use

Error, unterminated 'use'

This issue can be resolved by adding a semicolon after the first statement.

use LinearAlgebra in  ya&semi;  za end use



To suppress the output, use a colon after the end use statement:

use LinearAlgebra in  ya&semi;  za end use&colon;

Derivative Notation and Implied Dependency

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.


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:




f'''<Ctrl + =>

f'''<Command + =>

f&apos;&apos;&apos; = &DifferentialD;3&DifferentialD;x3fx

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:




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

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

f&apos;&apos;&apos;0 = D3f0


If the dependent variable is assigned, and is not a known function, then eval/diff notation is used:
q  procx &apos;procname&apos;x&semi; end proc&colon;




q''(0)<Ctrl + => 

q''(0)<Command + =>

q&apos;&apos;0 = &DifferentialD;2&DifferentialD;x2qxx&equals;0|&DifferentialD;2&DifferentialD;x2qxx&equals;0


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




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

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

x2+x&apos; = 2x&plus;1

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:


f&apos;&apos; = D2f

q&apos;&apos;0 = &DifferentialD;2&DifferentialD;_x2q_x_x&equals;0|&DifferentialD;2&DifferentialD;_x2q_x_x&equals;0

x2+x&apos; = 2Dxx&plus;Dx


Note that the placeholder _x was used for eval/diff notation.

Dot notation, by default, uses the variable t, so names with a dot and no dependencies explicitly listed are assumed to depend on t:



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

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

f.. = &DifferentialD;2&DifferentialD;t2ft


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:



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

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

f..0 = D2f0

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:





Leibniz notation can be used to specify derivatives and partial derivatives, but 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.

Univariate Examples:



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


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

&DifferentialD;&DifferentialD;xx2+x = 2x&plus;1


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 + =>


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 + => 

&DifferentialD;2f&DifferentialD;x2 = &DifferentialD;2&DifferentialD;x2fx


Short form and Multivariate Examples (require Suppress):


Typesetting:-Suppressfx&comma;y&comma; gx&comma;y&comma;z&colon;


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


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

fx = xfx&comma;y


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 + =>


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 + =>

4gx3z = 4zx3gx&comma;y&comma;z


Note: Suppression also enables short-form entry of functions by name.

f&comma;g = fx&comma;y&comma;gx&comma;y&comma;z


In addition, repeated index notation for partial derivatives can be used, if enabled.




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

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

gx&comma;x&comma;x&comma;z = 4zx3gx&comma;y&comma;z

Top of the page

Vector Calculus

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.



<1&comma;2&gt;&period;<0&comma;1&gt; = 2

<1,2,0>times<command completion and select "times x"> enter <0,1,0><Ctrl+=>

<1&comma;2&comma;0&gt;×<0&comma;1&comma;0&gt;= 0ex&plus;0ey&plus;ez

Use of vector differential expressions with the nabla(&rpar; symbol is also supported, but coordinates must be explicitly set using VectorCalculus[SetCoordinates] before use.




nabla<command completion>(x^2<Right arrow>+y z)<Ctrl+=>

x2+yz = 2xe&lowbar;x&plus;&lpar;z&rpar;e&lowbar;y&plus;&lpar;y&rpar;e&lowbar;z



nabla<command completion>.<x,x,x><Ctrl+=>

&period;<x&comma;x&comma;x&gt; = 1



nabla<command completion>times<command completion and select "times x"> enter <x,x,x><Ctrl+=>

×<x&comma;x&comma;x&gt; = 0e&lowbar;xe&lowbar;y&plus;e&lowbar;z



nabla<command completion>^2<Right arrow>(x^2<Right arrow>+y z)<Ctrl+=>

2x2+yz = 2


Other coordinate systems supported by VectorCalculus can be used as well.