Part 1. The Mathematica Notebook
Section 1. Cell structure: Input/Output
When Mathematica is started up it launches to an empty window. This document is referred to as a Mathematica notebook. Pull down the Format menu and choose Show Ruler and Show Toolbar to obtain a window that appears like the one shown below.
The default paragraph style is called Input. Mathematica is waiting for you, the user, to type some mathematics for processing. The next picture shows the appearance of the notebook immediately after the entry 1 + 2 was made and [shift]-[return] was pressed ([shift]-[Enter] on a PC).
1 + 2 is referred to as the input and 3 is the output. The labels were created by Mathematica. At the same time, a new input cell was created, ready and waiting directly below the output
Look carefully at the second picture and you can see that Mathematica has also created right brackets to enclose the input and the output as well as a larger bracket enclosing the input/output pair. Each bracket marks the limiting boundaries of what Mathematica refers to as a cell. These cells are the building blocks of the notebook. A typical Mathematica notebook consists of cells containing input, output, text, and graphics. At this moment your eyes are in a text cell.
The user makes a mathematical entry in an input cell by clicking in the cell if necessary and typing. Press the [return] key to make a new input line. Pressing the [shift]-[return] key (the [shift]-[Enter] key on a PC) is the signal to Mathematica to process the entries in the input cell and place the output directly below the input in an output cell. As soon as the output appears a new input cell is generated separated from by a horizontal line.
Note. By default, cell brackets are not printed. However, this notebook has been set to show cell brackets (Preferences... selection on the Mathematica menu). The other notebooks in this manual will use the default settings for cell brackets.
The next input/output pair shows the computation of an antiderivative for the trigonometric expression . The Mathematica syntax for indefinite integration of f(x) with respect to the x variable is
Integrate[ f[x], x] .
In[10]:=
Integrate[ Tan[x]/Sin[x]^4, x]
Out[10]=
So, as a notebook is created input and output is grouped together in separate cells and text entries, like this one, are enclosed in their own cell brackets.
The pull down menus
There is a grand total of 10 pull down menus at the top of the screen when Mathematica is the active application on a Macintosh. They are labeled, in order from left to right, as follows:
Mathematica File Edit Cell Format Input Kernel Find Window Help
A brief description of some of the items on the menus is given below.
Mathematica
The two most important menu choices are Preferences... and Quit Mathematica. Upon choosing Preferences... a dialogue opens that allows the user to adjust the settings for various notebook properties. For example, settings for margin width, hyphenation, and ruler units can b e changed. Cell brackets can be toggled on and off, and font options can be selected.
File
Use this menu to open, close, save, and print files. Note that the keyboard equivalent for Save is Command-S (hold down the Command key...next to the space bar...and press S...no shift). Use it early and use it often. The Save As Special... item can be used to save the worksheet in HTML format. Use the Palettes selection to display various palettes for mathematics entry as input and as marked up mathematics in a text entry.
Edit
Copy and Paste commands are found here along with Undo (Command-Z). Use the Expression Input selection to enter mathematical expressions in a text cell. The palettes can also be used (File menu). Mathematica has a spell checker that can be accessed here. Use it.
Cell
This menu has selections that control cell properties. Here, for example, is a selection for dividing a cell in two. Cells can be grouped together and then collapsed for outlining purposes.
Format
The format menu contains selections for changing the style of notebook cells as well as text fonts and styles. Display magnification can be set here, as well as on a pop up menu at the bottom of the notebook window.
Input
Use this menu to insert a matrix or a table in a notebook. Buttons and hyperlinks can be created. Mathematics input and output can be copied.
Kernel
Action of the Mathematica kernel (the mathematics engine) can be controlled with menu selections. Cells can be evaluated or evaluation can be aborted. Output can be deleted, In/Out labels can be suppressed if desired.
Find
Selections for Find/Replace are found here. Cells can be tagged for indexing.
Window
Use this menu to control the positioning of multiple Mathematica windows.
Help
This menu provides access to the extensive help facilities available in Mathematica, including the Help Browser and The Mathematica Book.. One of the items is called Tutorial... . Select it to open an interactive tutorial notebook for new users. The item called Find Selected Function... can be used to get help on a word or phrase that has been selected in the notebook. Useful information can also be obtained by typing ?Word or Phrase in an input cell as shown below.
In[1]:=
?Integrate
Click on More... to go to the corresponding Help Browser page.
Go to the next section
Created by Mathematica (September 10, 2004)