1.1.1 ArithmeticYou can do arithmetic with Mathematica just as you would on an electronic calculator. | This is the sum of two numbers. | |
Out[1]=
|
|
| Here the / stands for division, and the ^ stands for power. | |
Out[2]=
|
|
| Spaces denote multiplication in Mathematica. You can use a * for multiplication if you want to. | |
Out[3]=
|
|
| You can type arithmetic expressions with parentheses. | |
In[4]:=
(3 + 4) ^ 2 - 2 (3 + 1)
|
Out[4]=
|
|
| Spaces are not needed, though they often make your input easier to read. | |
Out[5]=
|
|
| x^y | power | | -x | minus | | x/y | divide | | x y z or x*y*z | multiply | | x+y+z | add |
Arithmetic operations in Mathematica. Arithmetic operations in Mathematica are grouped according to the standard mathematical conventions. As usual, 2 ^ 3 + 4, for example, means (2 ^ 3) + 4, and not 2 ^ (3 + 4). You can always control grouping by explicitly using parentheses. | This result is given in scientific notation. | |
Out[6]=
|
|
| You can enter numbers in scientific notation like this. | |
Out[7]=
|
|
| Or like this. | |
Out[8]=
|
|
|