Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  The Teacher's Book /  Basic Calculations /  Input and Output in Notebooks /

11.2 Entering Two-Dimensional Input

When Mathematica TE reads the text x^y, it interprets it as x raised to the power y.

In[1]:= x^y

Out[1]=

In a notebook, you can also give the two-dimensional input directly. Mathematica TE again interprets this as a power.

In[2]:=

Out[2]=

One way to enter a two-dimensional form such as into a Mathematica TE notebook is to copy this form from a palette by clicking the appropriate button in the palette.

Here is a palette for entering some common two-dimensional notations.

There are also several ways to enter two-dimensional forms directly from the keyboard.

Ways to enter a superscript directly from the keyboard. ControlKey LeftModified RightModified stands for Control-Space.

You type ControlKey LeftModified ^RightModified by holding down the Control key, then pressing the ^ key. As soon as you do this, your cursor will jump to a superscript position. You can then type anything you want and it will appear in that position.
When you have finished, press ControlKey LeftModified RightModified to move back down from the superscript position. ControlKey LeftModified RightModified stands for Control-Space; you type it by holding down the Control key, then pressing the space bar.

This sequence of keystrokes enters .

In[3]:= x ControlKey LeftModified^RightModified y

Out[3]=

Here the whole expression y+z is in the superscript.

In[4]:= x ControlKey LeftModified^RightModified y + z

Out[4]=

Pressing ControlKey LeftModified RightModified (Control-Space) takes you down from the superscript.

In[5]:= x ControlKey LeftModified^RightModified y ControlKey LeftModified RightModified + z

Out[5]=

You can remember the fact that ControlKey LeftModified ^RightModified gives you a superscript by thinking of ControlKey LeftModified^RightModified as just a more immediate form of ^. When you type x^y, Mathematica TE will leave this one-dimensional form unchanged until you explicitly process it. But if you type x ControlKey LeftModified^RightModified y then Mathematica TE will immediately give you a superscript.
On a standard English-language keyboard, the character ^ appears as the shifted version of 6. Mathematica TE therefore accepts ControlKey LeftModified6RightModified as an alternative to ControlKey LeftModified^RightModified. Note that if you are using something other than a standard English-language keyboard, Mathematica TE will almost always accept ControlKey LeftModified6RightModified but may not accept ControlKey LeftModified^RightModified.

This is an alternative input form that avoids the use of control characters.

In[6]:= \!\( x \^ y \)

Out[6]=

With this input form, Mathematica TE automatically understands that the + z does not go in the superscript.

In[7]:= \!\( x \^ y + z \)

Out[7]=

Using control characters minimizes the number of keystrokes that you need to type in order to enter a superscript. But particularly if you want to save your input in a file, or send it to another program, it is often more convenient to use a form that does not involve control characters. You can do this using \! sequences.
If you copy a \! sequence into Mathematica TE, it will automatically jump into two-dimensional form. But if you enter the sequence directly from the keyboard, you explicitly need to choose the Make 2D menu command in order to get the two-dimensional form.

When entered from the keyboard \( ... \) sequences are shown in literal form.

Choosing the Make 2D command in the Edit menu converts these sequences into two-dimensional forms.

Ways to enter a subscript directly from the keyboard.

Subscripts in Mathematica TE work very much like superscripts. However, whereas Mathematica TE automatically interprets as x raised to the power y, it has no similar interpretation for . Instead, it just treats as a purely symbolic object.

This enters y as a subscript.

In[8]:= x ControlKey LeftModified_RightModified y

Out[8]=

Here is another way to enter y as a subscript.

In[9]:= \!\( x \_ y \)

Out[9]=

Ways to enter a built-up fraction directly from the keyboard.

This enters the built-up fraction .

In[10]:= x ControlKey LeftModified/RightModified y

Out[10]=

Here the whole y + z goes into the denominator.

In[11]:= x ControlKey LeftModified/RightModified y + z

Out[11]=

But pressing ControlKey KeyBar SpaceKey takes you out of the denominator, so the + z does not appear in the denominator.

In[12]:= x ControlKey LeftModified/RightModified y ControlKey LeftModified RightModified + z

Out[12]=

Mathematica TE automatically interprets a built-up fraction as a division.

In[13]:=

Out[13]=

Here is another way to enter a built-up fraction.

In[14]:= \!\( 8888 \/ 2222 \)

Out[14]=

Ways to enter a square root directly from the keyboard.

This enters a square root.

In[15]:= ControlKey LeftModified@RightModified x + y

Out[15]=

ControlKey KeyBar SpaceKey takes you out of the square root.

In[16]:= ControlKey LeftModified@RightModified x ControlKey LeftModified RightModified + y

Out[16]=

Here is a form without control characters.

In[17]:= \!\( \@ x + y \)

Out[17]=

And here is the usual one-dimensional Mathematica TE input that gives the same output expression.

In[18]:= Sqrt[x] + y

Out[18]=

Special input forms based on control characters. The second forms given should work on any keyboard.

This puts both a subscript and a superscript on x.

In[19]:= x ControlKey LeftModified^RightModified y ControlKey LeftModified%RightModified z

Out[19]=

Here is another way to enter the same expression.

In[20]:= x ControlKey LeftModified_RightModified z ControlKey LeftModified%RightModified y

Out[20]=

Special input forms that generate two-dimensional input with the Make 2D menu command.

You must preface the outermost \( with \!.

In[21]:= \!\(a \/ b + \@ c \) + d

Out[21]=

You can use \( and \) to indicate the grouping of elements in an expression without introducing explicit parentheses.

In[22]:= \!\(a \/ \( b + \@ c \) \) + d

Out[22]=

In addition to subscripts and superscripts, Mathematica TE also supports the notion of underscripts and overscripts--elements that go directly underneath or above. Among other things, you can use underscripts and overscripts to enter the limits of sums and products.

Creating underscripts and overscripts.