Subscripts - Maple Help

Subscripts

Maple has two types of subscripts: index subscripts and subscripted variable names, sometimes called literal subscripts.

 Action Shortcut Key Palette Entry Index Subscript Ctrl + Shift + _ (Command + Shift + _, for Mac) Subscripted Variable Name __(two underscores)

Index Subscript

The first is used when you want to refer to an entry in a list or Matrix.  This is referred to as an index subscript.

If a list is defined by

 >
 ${L}{≔}\left[{1.2}{,}{3.5}{,}{6.1}\right]$ (1)

Then you can select the second entry using square brackets.

 > $L\left[2\right]$
 ${3.5}$ (2)

Alternatively, you can use subscript notation

 >
 ${3.5}$ (3)

which is found on the Expression palette.  Note the tooltip for it shows the equivalent square bracket notation.

If a matrix is defined by

 > $M≔⟨1,2,3;-4,-3,-2⟩$
 ${M}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\\ {-4}& {-3}& {-2}\end{array}\right]$ (4)

We can select any entry using M[i,j]

 > $M\left[1,2\right]$
 ${2}$ (5)

or using the subscript notation ${M}_{i,j}$.

 > ${M}_{1,2}$
 ${2}$ (6)

The shortcut key to enter an index subscript is Ctrl + Shift + _ (Command + Shift + _, Mac)

You can change the shortcut key for index subscripts to a simple underscore, if desired.  For details, see Underscore Entry in the Options>Interface help page.

Subscripted Variable Name

The second type of subscript is a subscripted variable name.  In the example below, $\mathrm{x__1}$ is a name that is not related to the name $x$.  This is sometimes referred to as a literal subscript.  To enter a subscripted variable name in Maple, use the second subscripted name shown in the Expression palette, .  It is shown all in one color.

To enter a subscripted variable name using a shortcut key, type two underscores (__).

 >
 ${x}{≔}\left[{1}{,}{2}{,}{3}\right]$ (7)
 > $\mathrm{x__1}≔a$

Note we have not changed the entries of the list $x$ because $\mathrm{x__1}$ is simply a subscripted variable name that is not related to $x$.

 > $x$
 $\left[{1}{,}{2}{,}{3}\right]$ (8)

In Maple, subscripted variable names are one kind of atomic variable.  There is an option in the View menu that displays atomic variables in a different color, to visibly distinguish them from other math.  For more information, see atomic variables.

Here, we form an indexed name, ${y}_{i}$ and then verify it is of type indexed.

 > ${y}_{i}$
 ${{y}}_{{i}}$ (9)
 > $\mathrm{type}\left({y}_{i},\mathrm{indexed}\right)$
 ${\mathrm{true}}$ (10)

Next form a subscripted name using double underscores.

 > $\mathrm{x__i}$
 $\mathrm{x__i}$ (11)
 > $\mathrm{type}\left(\mathrm{x__i},\mathrm{indexed}\right)$
 ${\mathrm{false}}$ (12)

The subscripted name is of type symbol.

 > $\mathrm{type}\left(\mathrm{x__i},\mathrm{symbol}\right)$
 ${\mathrm{true}}$ (13)
 >
 ${\mathrm{false}}$ (14)