11.4 Entering Formulas
Special forms for some common symbols. stands for the key .
This is equivalent to Sin[60 Degree].
In[1]:= Sin[60°]
Out[1]=
Here is the long form of the input.
In[2]:= Sin[60 \[Degree]]
Out[2]=
You can enter the same input like this.
In[3]:= Sin[60 deg]
Out[3]=
Here the angle is in radians.
In[4]:=
Out[4]=
Special forms for a few operators.
Here the replacement rule is entered using two ordinary characters, as ->.
In[5]:= x/(x+1) /. x -> 3 + y
Out[5]=
This means exactly the same.
In[6]:= x/(x+1) /. x \[Rule] 3 + y
Out[6]=
As does this.
In[7]:= x/(x+1) /. x 3 + y
Out[7]=
Or this.
In[8]:= x/(x+1) /. x -> 3 + y
Out[8]=
The special arrow form is by default also used for output.
In[9]:= Solve[x^2 == 1, x]
Out[9]=
Some operators with special forms used for input but not output.
Mathematica TE understands , but does not use it by default for output.
In[10]:= x ÷ y
Out[10]=
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 TE 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 11.2. Note that upper and lower limits for sums and products must be entered as overscripts and underscripts--not 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
Out[11]=
Here is an indefinite integral that can be explicitly evaluated.
In[12]:=
Out[12]=
Here is the usual Mathematica TE input for this integral.
In[13]:= Integrate[Exp[-x^2], x]
Out[13]=
This enters exactly the same integral.
In[14]:= \!\( \[Integral] Exp[-x\^2] \[DifferentialD]x \)
Out[14]=
Some special characters used in entering formulas.
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 TE. The point is that a sigma is just a letter; but a summation sign is an operator that tells Mathematica TE to perform a Sum operation.
Capital sigma is just a letter.
In[15]:= a + \[CapitalSigma]^2
Out[15]=
A summation sign, on the other hand, is an operator.
In[16]:= sum
+ n=0
% m
1/f[n]
Out[16]=
Here is another way to enter the same input.
In[17]:= \!\( \[Sum] \+ \( n = 0 \) \%% m 1 \/ f[n] \)
Out[17]=
Much as Mathematica TE 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 dd--when you type in an integral. If you try to use an ordinary d, Mathematica TE will just interpret this as a symbol called d--it will not understand that you are entering the second part of an integration operator.
This computes the derivative of .
In[18]:=
Out[18]=
Here is the same derivative specified in ordinary one-dimensional form.
In[19]:= D[x^n, x]
Out[19]=
This computes the third derivative.
In[20]:=
Out[20]=
Here is the equivalent one-dimensional input form.
In[21]:= D[x^n, x, x, x]
Out[21]=