Welcome to Mathematica!
an introduction to version 4

Tutorial 1:  Getting Started

by Ruth Dover, Illinois Mathematics and Science Academy

You have just opened a Mathematica "notebook."  This one is designed to give an introduction to some of the many features of Mathematica 4 - the mathematics as well as the workings of the program.  Many of these will be seen again in more detail in later notebooks.
	What you see now is similar to an outline form, with section headings shown.  Below this paragraph, find the line with "Numbers" in bold print.  ("Numbers" is a "section" heading.)  Move the cursor to the far right of that line to the vertical bar with the little triangle at the bottom.    The cursor will change to a vertical segment with an arrow. Double click on this bar with the triangle to open the section.  Try opening and closing the section a couple of times.  Then follow the directions.

Numbers

Find the line below with the "(Sqrt[20])" in bold print.  Move the cursor to this "input line" so that it appears as a vertical I-bar and click.  Then press "Shift-Return" or simply "Enter" - a key on the far right of most keyboards - to "execute" this command line.  (A simple "Return" only moves the cursor to the next line, just as it does in a word processor.)

(Sqrt[20])

OK, so Mathematica can simplify.  Also, if that took a while, that's because another program called the "Mathematica kernel" has to be loaded the first time.  Let's try another one.  (Again, press "Shift-Return" or "Enter" to execute the command.)

(Sqrt[10])

Well...that was exciting.  The number is exact, so Mathematica left it alone.  Let's make a slight change.  Again, put the cursor in the line below and execute the "input cell".  (A "cell" may be just about anything - a command, text, or a section header such as "Numbers" above.  "Input cells" are recognizable by the bold text and may be "executed."  Each cell is shown individually and in groups by the brackets to the far right.)

N[(Sqrt[10])]

At least it did something.  How about a few more decimal places?  Edit the line above so it reads:  N[(Sqrt[10]), 50]  by typing ", 50" after the square root but before the closing bracket.  (Don't type the quotation marks!)  Execute the cell.  What happened?  Then execute the cell below.  Note the different expression for the square root.

Sqrt[48]

Again, at least it simplifies, but we'll ask for a numerical approximation.  We could do this by editing the line above, but we'll learn another method.  Create a new cell by moving the cursor below this paragraph so that the cursor changes to a horizontal I-bar.  Click.  A horizontal line should appear.  Then start typing "N[%]" (without the quotation marks) and Mathematica will make room for you.  Note that the " % " refers to the last output.  (Using "In's" and "Out's" which are created by Mathematica allows one to refer to previous work as well.)

Let's try a couple of other things.  Sine and tangent are built-in functions. As such, they must be capitalized, and their arguments are in square brackets.  Execute each of the two cells below.  Find numerical approximations.  Or edit the expressions.  (Create your own if you wish, but we'll come back to that later.)

Sin[(π/3)] +  Tan[((5  π)/6)]

(∑_(k = 1)^100) (1/(k^2))

Symbolics

Execute each of the following cells below (separately) to see a bit of simplification.

3  (x^4) - 6  (x^(2 )) +  5  +  4  (x^2) -  3

Simplify[(4  (x^3) + 5  (x^2) + 3)  -  
        3 (2  (x^2) - 6  x  +  1)]

(((3  x  +  2  y))^8)

That last one may not have been what you expected - or desired.  Mathematica simplifies automatically, but it won't expand, since that form won't usually be considered simplified.  We'll tell it to expand.

Expand[(((3  x  +  2  y))^8)]

Create a new cell below this one to "Factor" the last result.  (Remember that the command must be capitalized and square brackets are necessary.  Use "%" to refer to the last output, the expanded form.)

Let's see a few more commands.  Consider the fraction  ((2  (x^2) -  3)/((x^2) - 3  x  +  2)).  First, enter it by executing the cell, so that it is in the computer's memory.

((2  (x^2) - 3)/((x^2) - 3  x + 2))

Now create new cells and ask Mathematica to perform each of the following commands, one by one, on the previous result:  Apart, Together, Expand, ExpandAll, and Simplify.  (Use the capitalized command with the square brackets, and use "%" to refer to the last output.  Note that "ExpandAll" is written with a capital "A" but no space between the words.  It is one Mathematica command.)

Plots

The graphics capabilities in Mathematica are spectacular. Here's the simplest of beginnings.

Plot[(x^3) -  5  x  +  2,  {x,  -4,  4}]

Plot[(x^2  -  3  x) Sin[x],  {x,  -3,  4}]

The syntax should be clear. Edit the line above to change the domain and explore more of the graph.  Then create a couple more graphs.