1.  A Mathematica Tutorial

You can use Mathematica just like your calculator: type in questions, and it gives you answers.

1 + 1

Mathematica can do everything your calculator can do and more.  To input more complex expressions, you can either use palettes of buttons, keyboard shortcuts, or arcane Mathematica code.

Palettes are the easiest but also the slowest.  To open one of the standard Mathematica palettes, click on this button:

Basic Input Palette

A new window full of some standard mathematical symbols should appear.  Clicking on any of them inserts that symbol into the Mathematica notebook.

The standard Mathematica palettes are accessible on the File/Palettes menu.

Keyboard shortcuts can produce the same output as the palettes without a lot of clicking around.

The shortcuts are quick and easy once you learn them, but you have to learn them.  A good way to find any shortcut is to call up the palette and move your cursor on to the button you want (without clicking.)  If that particular template has a shortcut, it should appear at the bottom of the palette window.  If you don't see anything, there is no shortcut.  Not all palettes (including the basic input palette accessible on the File/Palettes menu) support this feature.  Palettes that do have a gray area below them in the same window.

The quickest (but ugliest) way to enter a Mathematica expression is in Mathematica code.  If you've done any computer programming, it is very similar.

(3/2)^10

((1/(2  π)) (10.2^(1/
                    3)/(13.6^(2/3))))^2

((((1/(2  π)) ((10.2^(1/3))/(13.6^(2/3)))))^2)

Hand-held calculators typically return a decimal number like 1.5 as opposed to a fraction like (3/2).  The N function converts the fractional representation to the decimal one.

N[(3/2)^10]

N[π, 20]

Chop[10.55000001]

(3/2)^100

N[%, 30]

1.5^100

Mathematica's largest improvement over hand-held calculators is the ability to do symbolic calculations.  An example of such a calculation is the following.

f[x_] := x + Cos[x]

f[1]

f[1. ]

When you're done with the function, you can use the Clear command to make Mathematica forget about your original definition.  For instance, say you define x=3 at some point in your work.  From then until you quit Mathematica, the computer program will remember to replace x with 3 whenever in sees x in an input cell.  But later on, you might want to use x as symbol when you tell Mathematica to solve the equation y = (x^3) + x for x in terms of y with the Solve[y == (x^3) + x, x]  command (as always, type ? Solve to learn about the Solve command.)  If you don't clear x first, Mathematica will see your input cell and think, Solve[y == (3^3) + 3, 3] , and give you an error saying you cannot solve for the number 3 in the equation.

Clear[f]

f =.

f

f[x_] := x+Cos[x]

Mathematica can also do graphics, including plots of functions.

Plot[f[x], {x, 0, 10}, AxesLabel -> {x, y}]

\(Plot[f[x], {x, 0, 10}, Frame -> True, 
      PlotLabel -> "function", 
	AxesLabel -> {x, y}]\)

Along with carrying out one-line calculations, Mathematica can handle your input cells as if they were computer programs.  You can define subroutines, store results in variables, and code various kinds of loops.

x[0] = 0     
Do[x[n + 1] = x[n] + 1, {n, 0, 10}]

? Do

Pl

x[1]

x[2]

storage = Table[x[n], {n, 0, 10}]

ListPlot[storage]

Other types of plots Mathematica can make include parametric plots.  Parametric plots are not the y=f[x] plots you've often made before (such plots are called monotonic.)  Instead, y=g[t] and x=h[t].  You can always make your usual y=f[x] plots into parametric plots (let f[t]=f[x], with y=f[t] and x=t) but you cannot always make a parametric plot into the plot of a function.

ParametricPlot[{Cos[5  t], Sin[3  t]}, {t, 0, 2  π}]

Table[ParametricPlot[{Cos[5  t], Sin[3  t]}, {t, 0, tu}, 
            PlotRange -> {{-1, 1}, {-1, 1}}];, {tu, π/8, 
          2  π, π/8}];

ParametricPlot[{Cos[5*t], Sin[3.354678*t]}, {t, 0, 
          20*Pi}];

Mathematica also handles a ton of special numbers and functions.

I^2

Re[1 + 𝒾]

Plot[Re[Zeta[1/2  + I*x]], {x, 0, 500}]

\(Plot[Re[Zeta[1/2\  + I*x]], 
	{x, 0, 500}, PlotPoints -> 2000, 
      PlotRange -> All]\)

\(Plot[Re[Zeta[1/2\  + I*x]], 
	{x, 0, 500}, 
      PlotPoints -> 2000]\)

That's it for the tutorial.  Of course, you'll need to use Mathematica for awhile before picking everything up—just remember how to use the online help system (the help menu, autocomplete, and the ? command) and it should be easy.