To do basic arithmetic in Mathematica, type expressions much like you would into an ordinary calculator. Just remember to press the Shift and Enter keys together to evaluate your input, and note that “*” is multiplication, and “^” exponentiation.

6 + 2

6 - 2

6 * 2

6 / 2

6 ^ 2

Mathematica does exponentiation before multiplication or division, and multiplication and division before addition or subtraction. But you can use parentheses to change the order.

6 + 2 * 3

(6+2)*3

Just about every common mathematical function is built in to Mathematica. Here are examples of the square root, sine, and cosine functions. Also notice the built-in constant “Pi”. And beware what happens if you forget to capitalize a function name; Mathematica doesn’t make it at all obvious what the problem is.

Sqrt[ 36 ]

sqrt[ 36 ]

Sin[ Pi / 2 ]

Cos[ Pi/ 2 ]

Mathematica shows numeric values as integers if it can, fractions if integers don’t work, and simplified expressions involving irrationals if even a fraction isn’t possible. The “N” function forces a result to be printed as a decimal number, and you can also force that by simply having some number with  decimal point in it somewhere in your expression.

6 / 4

Sqrt[ 10 ]

Sqrt[ 18 ]

N[3 (Sqrt[2])]

N[ Sqrt[48 ] ]

Use Mathematica to find the distance between points (1,1,2) and (10,2,-5). Use Mathematica as a calculator to evaluate the distance formula, or, in that spirit of “if it’s a common function, Mathematica probably has it,” use Google to look up the distance formula in Mathematica and discover the “EuclideanDistance” function.

N[ Sqrt[ ((10-1)^2)+ ((3-1)^2) + ((-5-2)^2) ] ]

EuclideanDistance[ {1.,1,2}, {10,3,-5} ]

The main tool for plotting implicit surfaces in Mathematica is “ContourPlot3D.” But beware that the equality symbol in a Mathematica equation is two equal signs, not one.

ContourPlot3D[ x^2 + y^2 + z^2 == 4 , {x,-3,3}, {y,-3,3},{z,-3,3} ]

ContourPlot3D[ x == 4, {x,2,6},{y,-1,1}, {z,-1,1}]

ContourPlot3D[ (x-1)(x-3)==0, {x,-10,10},{y,-10,10},{z,-10,10} ]