Executable or Nonexecutable Math - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Getting Started : Menus : Document Menu Bar : Edit Menu : Executable or Nonexecutable Math

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.

 

 

Standard Entry

Executable and Nonexecutable Math

Multiplication

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

Logic

Atomic Variables (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.

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.

Executable and Nonexecutable Math

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

• 

Return, Mac

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).

 

Executable Math

Nonexecutable Math


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

Multiplication

In general, you can use * or a space to imply multiplication.  In 2-D math, * appears as a center dot ().

 

2aa3

2a4

(3.1)

expandx+ax+b

ab+ax+xb+x2

(3.2)

 

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:

2 x2

x

(3.3)

expandx+1x

x2+x

(3.4)

 

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.

 

Valid

2 x = 2x 

Not valid

23

Error, missing operation

2.3 5.3333333333

Error, missing operation

Valid

23 = 6 

2.35.3333333333 = 12.26666667

Valid

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.

expandxx+1 = x2+x

expandfx+1 = fx+f   

No space between f and x

The expression parses differently than

expandf x+1 = fx+f 

because without the space it means function application.

expandfx+1 = fx+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.

a0:

cosa = 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:

 

Typesetting:-Settingsnumberfunctions=true:

2x

2

(3.5)

Typesetting:-Settingsnumberfunctions=false:

2x

2x

(3.6)

 

 

 

Top of the Page

2-D Operators

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.

 

Examples

Steps

Definite sum:

i=1ni = n+122n212

1. 

Type sum and use command completion to select

2. 

Press Ctrl + ' and type i=1

3. 

Use Right Arrow key to exit subscript

4. 

Press Ctrl + Shift + " and type n

5. 

Use Right Arrow key to exit superscript

6. 

Type i

 

 

Alternatively:

1. 

Type sum and use command completion to select lrf

2. 

Press Tab to move between placeholders and replace:

• 

l with i=1

• 

r with n

• 

f with i

 

Directional limit:

limx0+1x =

1. 

Type lim or limit, press Ctrl + ' , type x ->0+

2. 

Press Right Arrow key

3. 

Type 1x

 

 

Alternatively:

1. 

Type lim and use command completion to select limxaf

2. 

Press Tab to move between placeholders and replace:

• 

x with x

• 

a with 0+

• 

f with 1x

 

 

Directional limit:

limitx01x =

1. 

Type lim or limit, press Ctrl + ' , type x ->0

2. 

Press Right Arrow key

3. 

Type 1x

 

Integrals require a special character for the 'd' prefix of the integration variable (DifferentialD):

010x ⅆx = 50

1. 

Type int and use command completion to select

2. 

Press Ctrl + Shift + _ and type 0.

3. 

Press Right Arrow key

4. 

Press Shift + ^ and type 10

5. 

Press Right Arrow key

6. 

Type x d and use command completion to select the Differential'd'

7. 

Type x

 

The integration limits can also be entered over and under the integral sign:

010x ⅆx = 50

1. 

Type int and use command completion to select

2. 

Press Ctrl + ' and type 0

3. 

Press Right Arrow key

4. 

Press Ctrl + Shift + " and type 10

5. 

Press Right Arrow key

6. 

Type x d and use command completion to select the Differential'd'

7. 

Type x

 

In addition, many formatted 2-D notations are directly available in the command-symbol completion mechanism. This alternative entry technique is demonstrated here:

010x ⅆx = 50

1. 

Type intand use command completion to select abfⅆx

2. 

Press Tab to move between placeholders and replace:

• 

a with 0

• 

b with 10

• 

f with x

• 

x with x

 


Inert Functions
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

Steps

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.

 

1. 

Type Int and use command completion to select fⅆx

2. 

Press Tab to replace the placeholders f and x with x

Using palettes:

The active (noninert) functions can be entered from the palettes. You can then convert the expression to its inert form.

1. 

From the Expression or Calculus palette, select the template fⅆx.

2. 

Press Tab to replace the placeholders f and x with x

3. 

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

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

za

(5.1)

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

use LinearAlgebra in  ya;  za end use:

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. Display in output can be controlled as well.

restart

Prime Notation

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''

ⅆ2ⅆx2fx

(6.1.1)

y'+3 y =0

ⅆⅆxyx+3yx=0

(6.1.2)

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:

f'''0

D3f0

(6.1.3)

To enter the prime notation:

1. 

Type the expression in math mode, or

2. 

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:

q''0

ⅆ2ⅆx2qxx=0|ⅆ2ⅆx2qxx=0

(6.1.4)

To enter the prime notation:

3. 

Type the expression in math mode, or

4. 

From the Calculus palette, select the appropriate template. To fill in the content, navigate through the placeholders using the Tab key.

 

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

x2+x'

2x+1

(6.1.5)

Dot 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..

ⅆ2ⅆt2ft

(6.2.1)

y.+3 y =0

ⅆⅆtyt+3yt=0

(6.2.2)

The dot notation can be entered in one of the following ways:

Using keyboard shortcuts

Using palette templates

1. 

Type f

2. 

Press Ctrl + Shift + "

3. 

Type ..

4. 

Use the Right Arrow key to leave the superscript position

1. 

Select A.. from the Calculus palette

2. 

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:

f..0

D2f0

(6.2.3)

To enter the dot notation:

3. 

Type f

4. 

Press Ctrl + Shift + "

5. 

Type ..

6. 

Use the Right Arrow key to leave the superscript position

7. 

Type 0

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:

Typesetting:-Settingstypesetdot=true:

f..

f..t

(6.3.1)

y.+3 y =0

y.t+3yt=0

(6.3.2)

Leibniz 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.

 

Univariate examples:

ⅆⅆ x x2+x

2x+1

(6.4.1)

ⅆ2ⅆx2 x2+x

2

(6.4.2)

To enter the Leibniz notation for univariate differentiation, select ⅆⅆxf  and ⅆ2ⅆx2f  , respectively, from the Calculus palette and press Tab to fill in the contents.

 

Multivariate examples:

 xx2 y

2xy

(6.4.3)

2 x y x2+y2+z2

y2+z2

(6.4.4)

To enter the Leibniz notation for multivariate differentiation, select xf  and 2xyf  , 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:

Typesetting:-Suppressfx,y

 x f

fx

(6.4.5)

This typeset enables short-form entry of function names as well:

f

f

(6.4.6)

To enable repeated index notation for partial derivatives, use the following command:

Typesetting:-Settingsuserep=true:

fx,x,y

fx,x,y

(6.4.7)

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.

Command-Symbol Completion Keys

  

Esc, Mac, Windows, and Linux

  

Ctrl + Space, Windows

  

Ctrl + Shift + Space, Linux

Dot Product

Type <1,2>.<0,1>:

1&comma;2&period;0&comma;1

2

(7.1.1)

Cross Product

withVectorCalculus&colon;

 

Type &x as cross-product operator:

1&comma;2&comma;3 &x 7&comma;8&comma;0

Or, use × from the Common Symbols palette:

1&comma;2&comma;3×7&comma;8&comma;0

In the following example, note the change in display of output for 1&comma;2&comma;3×7&comma;8&comma;0 after unloading the package.

unwithVectorCalculus&colon;

1&comma;2&comma;3×7&comma;8&comma;0

−2421−6

(7.2.1)

Gradient

restart

withVectorCalculus&colon;

 

The coordinate system can be specified within individual calls:

Gradientx2&plus;y2&plus;z2&comma; x&comma;y&comma;z

Or, set coordinate system as follows:

SetCoordinates&apos;cartesian&apos;x&comma;y&comma;z&colon;

 

Choose from one of the following input style:

Nablax2&plus;y2&plus;z2

Delx2&plus;y2&plus;z2

Gradientx2&plus;y2&plus;z2

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.

x2&plus;y2&plus;z2

 

Note: For computation using other coordinate systems, see VectorCalculus[Coordinates].

Divergence

restart

withVectorCalculus&colon;

SetCoordinates&apos;cartesian&apos;x&comma;y&comma;z&colon;

 

Use one of the following methods:

Nabla &period; x2&comma;y2&comma;z2

2x+2y+2z

(7.4.1)

Del &period; VectorFieldx2&comma;y2&comma;z2

2x+2y+2z

(7.4.2)

The vector field can be assigned separately as well:

VVectorFieldx2&comma;y2&comma;z2

&period;V

2x+2y+2z

(7.4.3)

DivergenceV

2x+2y+2z

(7.4.4)

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.

·x2&comma;y2&comma;z2

 

Note: For computation using other coordinate systems, see VectorCalculus/Coordinates.

2x+2y+2z

(7.4.5)

Curl

restart

withVectorCalculus&colon;

SetCoordinates&apos;cartesian&apos;x&comma;y&comma;z&colon;

 

Use one of the following methods:

Nabla &x VectorFieldx y&comma;y&comma;z

Del &x VectorFieldx y&comma;y&comma;z

CurlVectorFieldx y&comma;y&comma;z

Create the vector field separately:

C  VectorFieldx y&comma;y&comma;z

CurlC

 

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&comma; y&comma;z

 

Note: For computation using other coordinate systems, see VectorCalculus/Coordinates.

Laplacian

restart

withVectorCalculus&colon;

SetCoordinates&apos;cartesian&apos;x&comma;y&comma;z&colon;

1. 

Laplacian in Cartesian coordinates:

Laplacianx2&plus;y2&plus;z2

6

(7.6.1)

 

2. 

Laplacian using polar coordinates:

Laplacianr&plus;&theta; &comma;&apos;polar&apos;r&comma;&theta;

1r

(7.6.2)

 

3. 

Laplacian using cylindrical coordinates:

Laplacianr&plus;cosθ&plus;z&comma; &apos;cylindrical&apos;r&comma; θ&comma;z

1cosθrr

(7.6.3)

 

4. 

Use expressions of the form (Del . Del)(f), Del . (Del(f)), or Del . Del(f):

·x2&plus;y2&plus;z2

6

(7.6.4)

·x2&plus;y2&plus;z2

6

(7.6.5)

·x2&plus;y2&plus;z2

6

(7.6.6)

5. 

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.

 

6. 

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.

 

2x2&plus;x2&plus;x2

 

6

(7.6.7)

Top of the page

Special Functions

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).

Command-Symbol Completion Keys

  

Esc, Mac, Windows, and Linux

  

Ctrl + Space, Windows

  

Ctrl + Shift + Space, Linux

For example,type BesselJ, use command completion to select Jvx, and press Tab to replace v with v and x with x.
Similarly, enter the BesselI function.

exprJvx&plus;Ivx

exprBesselJv&comma;x+BesselIv&comma;x

(8.1.1)

 

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 Ivx.

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.

TypesettingEnableParseRuleBesselJ&comma;BesselY&comma;BesselI&comma;BesselK&colon;

Now you can enter Bessel functions in standard notation.
Type input as shown:

expr Jvx&plus;Ivx

exprJvx+Ivx

(8.1.2)

 

Special Function Display in Output

You can change the display of special functions in the output using the Typesetting:-EnableTypesetRule command.

TypesettingEnableTypesetRuleTypesettingSpecialFunctionRules&colon;

expr

Jvx+Ivx

(8.2.1)

  Note: Under standard typesetting mode, the option for typeset display of special functions has no effect:

interfacetypesetting&equals;standard&colon;

expr

BesselJv&comma;x&plus;BesselIv&comma;x

(8.2.2)

interfacetypesetting&equals;extended&colon;

You can also control the typeset display for individual special functions through 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

Steps

expr a b&semi;

exprab

(9.1)

expr is actually stored as a function with function name `&ll;`. If you enter the following:

op0&comma;expr

(9.2)

evalexpr&comma;&equals;a&comma;ba+b

a+b

(9.3)

Enter the much less than operator from the Relational palette.

axb

axb

(9.4)

The operator can be entered in one of the following ways:

1. 

Type <=

2. 

Type leq and use the command completion method

3. 

Select the operator from the Relational palette

Following is an example which demonstrates that any non-equivalence operators have higher precedence than multiplication:

ab  cdad

bc

(9.5)

Now, compare this result to the the following:

ab&plus;cdad

ab+cdad

(9.6)

Here the multiplication operator has higher precedence.

For the first example:

4. 

Select the ab template from the Expression palette

5. 

Type a*b

6. 

To enter the boxtimes operator, type boxtimes and use the command completion method.

7. 

Type c*d

8. 

Press Tab to enter a*d as denominator

 

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.

 

whichval &apos;whichval&apos;&colon;

&+−:=aifwhichval&equals;1&comma;a&comma;ifwhichval&equals;2&comma;&uminus0;a&comma;&apos;&+−&apos;a&colon;

&−+:=aifwhichval&equals;1&comma;a&comma;ifwhichval&equals;2&comma;a&comma;&apos;&−+&apos;a&colon;

An optional equation using ±and/or :

ans:=x2±x+1x2&colon;

At this point, the value of 'whichval' lets you change the value of the expression:

whichval1&colon;

ans

x2&plus;x&plus;1x2

(10.1)

whichval2&colon;

ans

x2x&plus;1x&plus;2

(10.2)

 

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:

 

withTolerances&colon;

5±0.3

5.00 ± 0.300

(10.3)

1±0.12±0.1

2.01 ± 0.300

(10.4)

Top of the page

Logic

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:

 

Operation

Standard Form

Symbol

Symbol Form

not

nota = nota

not

¬a = nota

nand

anandb = notaandb

uarr

ab = notaandb

and

aandb = aandb

and

ab = aandb

nor

anorb = notaorb

darr

ab = notaorb

or

aorb = aorb

or

ab = aorb

xor

axorb = axorb

veebar

ab = axorb 

implies

aimpliesb = ab

Implies

ab = ab

iff

aiffb = abandba

iff

ab = abandba 

 

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:

• 

Type a implies 

• 

Use command completion to enter

• 

Type b and press Enter to evaluate

 

a b

ab

(11.1)

 

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.

nota

nota

(11.2)

anda&comma;b

aandb

(11.3)

ora&comma;b

aorb

(11.4)

 

Top of the page

Atomic Variables (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 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.

 

Example

Steps

var x~&colon;

1. 

Press Ctrl + Shift + " to enter the overscript for x

2. 

Use one of the following methods to enter tilde:

• 

Press Shift + ~

• 

Select ~ from the Common Symbols palette

• 

Type tilde and use command completion method

3. 

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.

x1&colon;

var

x˜

(12.1)

Assigning the value of x does not affect this name.

Furthermore, x tilde is treated as any other name in Maple.

difffvar&comma;var

&DifferentialD;&DifferentialD;x˜fx˜

(12.2)

 

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.

 

Example

Steps

x&commat;&comma;x&amp;&comma;x&period;

x@&comma;x&&comma;x.

(12.3)

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:

sprintfx~

#mover(mi("x"),mo("˜"))

(12.4)

 

If this automatic behavior is not desired, it can be disabled through the Typesetting Settings command or through the Typesetting Rule Assistant:

Typesetting:-Settingsautoatomic&equals;false&colon;

x&commat;

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:

x1

11

(12.5)

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.

x__1

x__1

(12.6)

Alternately, in this specific case, you can use two underscores (Shift + _ _) to create a subscripted name called a literal subscript.

x__1

x__1

(12.7)

 

Note that the atomic variable x is different from the indexed one.

 

Again, note the following example with Array:

A0&comma;1&comma;3&comma;4

A0&comma;1&comma;3&comma;4

(12.8)

The following indexed subscript returns the element in the first position of Array A (equivalent to A[1]):

A1

0

(12.9)

However, once A subscript 1 is converted to an atomic variable, it evaluates in this manner:

A__1

A__1

(12.10)

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.

x

And as an example of using green x in a for loop:

for x to 5 do printx&comma;x&semi; end do

1&comma;1

2&comma;1

3&comma;1

4&comma;1

5&comma;1

(12.11)

Top of the page

See Also

2-D Math

2-D Math Shortcut Keys

Entering Expressions

Typesetting Package

Typesetting Rule Assistant

Quick Help Details