Entering 2-D Math - Maple Help

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

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$ = ${{x}}^{{2}}$ Space between x and (x+1)   Space between f and x $\mathrm{expand}(\left(x+1\right)x)$ = ${{x}}^{{2}}{+}{x}$  $\mathrm{expand}\left(f\left(x+1\right)\right)$ = ${f}{}{x}{+}{f}$ No space between f and x The expression parses differently than $\mathrm{expand}\left(f\left(x+1\right)\right)$ = ${f}{}{x}{+}{f}$ $\mathrm{expand}\left(f\left(x+1\right)\right)$ = ${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:

$\frac{2x}{2}$ = ${x}$

$\mathrm{expand}\left(\left(x+1\right)x\right)$ = ${{x}}^{{2}}{+}{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 ($\mathbf{\cdot }$). However, products containing fractions can use implicit multiplication.

Valid

$2x$ = ${2}{}{x}$

Not valid

$23$

 Error, missing operation 



Valid

$2\cdot 3$ = ${6}$

$2.3\cdot 5.3333333333$ = ${12.26666667}$

Valid

= $\frac{{10}}{{9}}$

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 $2\left(x\right)$ and $2.1667\left(y\right)$ 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:

$\mathrm{Typesetting}:-\mathrm{Settings}\left(\mathrm{numberfunctions}=\mathrm{true}\right):$

$2\left(x\right)$ = ${2}$

$\mathrm{Typesetting}:-\mathrm{Settings}\left(\mathrm{numberfunctions}=\mathrm{false}\right):$

$2\left(x\right)$ = ${2}{}{x}$

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

$\sum _{i=1}^{n}i$ = $\frac{{1}}{{2}}{}{{(}{n}{+}{1}{)}}^{{2}}{-}\frac{{1}}{{2}}{}{n}{-}\frac{{1}}{{2}}$

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

$\underset{x\to 0+}{\mathrm{lim}}\frac{1}{x}$ = ${\mathrm{∞}}$

And another example:

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

$\underset{x\to {0}^{-}}{\mathrm{limit}}\frac{1}{x}$ = ${-}{\mathrm{∞}}$

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

${{\int }_{0}}^{10}xⅆ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+=>

$\stackrel{10}{\underset{0}{\int }}xⅆ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+=>

${\int }_{0}^{10}xⅆ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+=>

${\int }x{ⅆ}x$ = ${\int }{x}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{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}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$

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

${\int }xⅆx$ = ${\int }{x}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$



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.

 

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

 ${a}$ (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 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:

 Windows/UNIX Macintosh f''' f'''

$f'''$ = $\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}{}{f}{}\left({x}\right)$



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) f'''(0)

$f'''\left(0\right)$ = ${{\mathrm{D}}}^{\left({3}\right)}{}\left({f}\right){}\left({0}\right)$

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

 Windows/UNIX Macintosh q''(0) q''(0)

$q''\left(0\right)$ = $\genfrac{}{}{0}{}{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{q}{}\left({x}\right)}{\phantom{{x}{=}{0}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{q}{}\left({x}\right)}}{{x}{=}{0}}$

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

 Windows/UNIX Macintosh (x^2+x)' (x^2+x)'

$\left({x}^{2}+x\right)'$ = ${2}{}{x}{+}{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:

$\mathrm{Typesetting}:-\mathrm{Settings}\left(\mathrm{prime}=\mathrm{}\right):$



$f''$ = ${{\mathrm{D}}}^{\left({2}\right)}{}\left({f}\right)$



$q''\left(0\right)$ = $\genfrac{}{}{0}{}{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{\mathrm{_x}}}^{{2}}}{}{q}{}\left({\mathrm{_x}}\right)}{\phantom{{\mathrm{_x}}{=}{0}}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{\mathrm{_x}}}^{{2}}}{}{q}{}\left({\mathrm{_x}}\right)}}{{\mathrm{_x}}{=}{0}}$



$\left({x}^{2}+x\right)'$ = ${2}{}{\mathrm{D}}{}\left({x}\right){}{x}{+}{\mathrm{D}}{}\left({x}\right)$



$\mathrm{Typesetting}:-\mathrm{Settings}\left(\mathrm{prime}=x\right):$

Note that the placeholder $\mathrm{_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$:

 Windows/UNIX Macintosh f.. f..

$\stackrel{..}{f}$ = $\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{t}}^{{2}}}{}{f}{}\left({t}\right)$

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:

 Windows/UNIX Macintosh f..(0) f..(0)

$\stackrel{..}{f}\left(0\right)$ = ${{\mathrm{D}}}^{\left({2}\right)}{}\left({f}\right){}\left({0}\right)$



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:

$\mathrm{dsys}:=\left\{y''+y=0,y\left(0\right)=1,y'\left(0\right)=0\right\};$

 $\left\{{y}{}\left({0}\right){=}{1}{,}{\mathrm{D}}{}\left({y}\right){}\left({0}\right){=}{0}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right){+}{y}{}\left({x}\right){=}{0}\right\}$ (4.1)

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:

 Windows/UNIX d/dx(x^2+x) Macintosh d/dx(x^2+x)

$\frac{ⅆ}{ⅆx}\left({x}^{2}+x\right)$ = ${2}{}{x}{+}{1}$



 Windows/UNIX d^2f/dx^2 Macintosh d^2f/dx^2

$\frac{{ⅆ}^{2}f}{ⅆ{x}^{2}}$ = $\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{f}{}\left({x}\right)$

Short form and Multivariate Examples (require Suppress):



 Windows/UNIX Paf/Pax Macintosh Paf/Pax

$\frac{\partial f}{\partial x}$ = $\frac{{\partial }}{{\partial }{x}}{}{f}{}\left({x}{,}{y}\right)$



 Windows/UNIX Pa^4g/Pax^3/Paz Macintosh Pa^4g/Pax^3/Paz

$\frac{{\partial }^{4}g}{\partial {x}^{3}\partial z}$ = $\frac{{{\partial }}^{{4}}}{{\partial }{z}{}{\partial }{{x}}^{{3}}}{}{g}{}\left({x}{,}{y}{,}{z}\right)$

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

$f,g$ = ${f}{}\left({x}{,}{y}\right){,}{g}{}\left({x}{,}{y}{,}{z}\right)$

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

$\mathrm{Typesetting}:-\mathrm{Settings}(\mathrm{userep}=\mathrm{true}):$



 Windows/UNIX Macintosh g_x,x,x,z g_x,x,x,z

${g}_{x,x,x,z}$ = $\frac{{{\partial }}^{{4}}}{{\partial }{z}{}{\partial }{{x}}^{{3}}}{}{g}{}\left({x}{,}{y}{,}{z}\right)$



 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,2>.<0,1> $<1,2>.<0,1>$ = ${2}$  <1,2,0>times enter <0,1,0> $<1,2,0>×<0,1,0>$= ${0}{{e}}_{{x}}{+}{0}{{e}}_{{y}}{+}{{e}}_{{z}}$  Use of vector differential expressions with the nabla($\mathbf{\nabla }\mathbf{)}$ symbol is also supported, but coordinates must be explicitly set using VectorCalculus[SetCoordinates] before use.   $\mathrm{VectorCalculus}\left[\mathrm{SetCoordinates}\right]\left(\mathrm{cartesian}\left[x,y,z\right]\right):$  Gradient: nabla(x^2+y z) $\nabla \left({x}^{2}+yz\right)$ = ${2}{}{x}{\stackrel{{_}}{{e}}}_{{x}}{+}{(}{z}{)}{\stackrel{{_}}{{e}}}_{{y}}{+}{(}{y}{)}{\stackrel{{_}}{{e}}}_{{z}}$   Divergence: nabla. $\nabla . = ${1}$   Curl: nablatimes enter $\nabla × = ${0}{\stackrel{{_}}{{e}}}_{{x}}{-}{\stackrel{{_}}{{e}}}_{{y}}{+}{\stackrel{{_}}{{e}}}_{{z}}$   Laplacian: nabla^2(x^2+y z) ${\nabla }^{2}\left({x}^{2}+yz\right)$ = ${2}$   Other coordinate systems supported by VectorCalculus can be used as well.   $\mathrm{VectorCalculus}\left[\right]$