This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / The Mathematica Book / Practical Introduction / Input and Output in Notebooks  /

1.10.4 Entering Formulas

Special forms for some common symbols. stands for the key .

  • This is equivalent to Sin[60Degree].
  • In[1]:= Sin[60°]


  • Here is the long form of the input.
  • In[2]:= Sin[60 \[Degree]]


  • You can enter the same input like this.
  • In[3]:= Sin[60 deg]


  • Here the angle is in radians.
  • In[4]:=


    Special forms for a few operators. Section A.2.7 gives a complete list.

  • Here the replacement rule is entered using two ordinary characters, as ->.
  • In[5]:= x/(x+1) /. x -> 3 + y


  • This means exactly the same.
  • In[6]:= x/(x+1) /. x \[Rule] 3 + y


  • As does this.
  • In[7]:= x/(x+1) /. x 3 + y


  • Or this.
  • In[8]:= x/(x+1) /. x -> 3 + y


  • The special arrow form

    is by default also used for output.
  • In[9]:= Solve[x^2 == 1, x]


    Some operators with special forms used for input but not output.

  • Mathematica understands

    , but does not use it by default for output.
  • In[10]:= x y


    The forms of input discussed so far in this section use special characters, but otherwise just consist of ordinary one-dimensional lines of text. Mathematica notebooks, however, also make it possible to use two-dimensional forms of input.

    Some two-dimensional forms that can be used in Mathematica notebooks.

    You can enter two-dimensional forms using any of the mechanisms discussed in Section 1.10.2. Note that upper and lower limits for sums and products must be entered as overscripts and underscriptsnot superscripts and subscripts.

  • This enters an indefinite integral. Note the use of dd to enter the "differential d".
  • In[11]:= int f[x] dd x


  • Here is an indefinite integral that can be explicitly evaluated.
  • In[12]:=


  • Here is the usual Mathematica input for this integral.
  • In[13]:= Integrate[Exp[-x^2], x]


  • This enters exactly the same integral.
  • In[14]:= \!\( \[Integral] Exp[-x\^2] \[DifferentialD]x \)


    Some special characters used in entering formulas. Section 3.10 gives a complete list.

    You should realize that even though a summation sign can look almost identical to a capital sigma it is treated in a very different way by Mathematica. The point is that a sigma is just a letter; but a summation sign is an operator which tells Mathematica to perform a Sum operation.

  • Capital sigma is just a letter.
  • In[15]:= a + \[CapitalSigma]^2


  • A summation sign, on the other hand, is an operator.
  • In[16]:= sum + n=0 % m 1/f[n]


  • Here is another way to enter the same input.
  • In[17]:= \!\( \[Sum] \+ \( n = 0 \) \%% m 1 \/ f[n] \)


    Much as Mathematica distinguishes between a summation sign and a capital sigma, it also distinguishes between an ordinary d and the special "differential d" that is used in the standard notation for integrals. It is crucial that you use this differential entered as ddwhen you type in an integral. If you try to use an ordinary d, Mathematica will just interpret this as a symbol called dit will not understand that you are entering the second part of an integration operator.

  • This computes the derivative of

  • In[18]:=


  • Here is the same derivative specified in ordinary one-dimensional form.
  • In[19]:= D[x^n, x]


  • This computes the third derivative.
  • In[20]:=


  • Here is the equivalent one-dimensional input form.
  • In[21]:= D[x^n, x, x, x]