Layout of Mathematica
This file is a Mathematica notebook, which is a text file with the extension ".nb". Usually you will save your Mathematica session as a notebook. If you modify, run, save, then reopen this notebook the changes you see on the screen will be preserved. However, no variables and function definitions are loaded into memory when you open a notebook. The notebook or parts of it must be re-run to load things into memory.
Mathematica has a "front end" and a "kernel". When you start Mathematica or open a notebook you are starting the front end, which acts as an GUI interface to the kernel. The kernel isn't loaded until you perform your first command, and it is the kernel that actually stores all data and performs all of the calculations. Naturally, the front end and kernel must communicate; you give a command to the front end, this is passed as input to the kernel, then the output of the kernel is sent back to the front end and the front end displays it.
The practical implications of this setup are as follows. Mathematica can appear to hang if the kernel is doing a very intensive calculation, or if the front end is given an extremely long and complicated output to display. In the former case, you can interrupt or abort the calculation without losing your front end session, notebook changes, or data in memory. You can even kill the kernel and save the front end session and notebook changes, but your data in memory will be lost (see the commands under the Kernel menu). On the other hand if the front end hangs, you either must wait or end your session and you will lose everything.
Usually only one kernel is running at a time. Since the kernel stores all data, variables and function definitions are global across all notebooks.
The menus at the top allow you to access all features of the front end. Besides the expected commands, we will focus on just a few items:
Under File: Palettes (symbols and 2D expression templates)
Under Edit: Copy As (use to export output or images)
Under Format: Style (use "Text" to make a commenting cell like this one)
Under Kernel: Evaluation|Evaluate Notebook (does what it says), Abort Evaluation (does what it says), Quit Kernel (does what it says)
Under Help: Help Browser (extremely useful documentation found here)
Mathematica notebooks are organized into cells. The blue brackets on the right hand margin indicates the arrangment of cells. This (text) cell is denoted by the bracket that extends for exactly the length of this cell. Cells can be grouped heirarchically (see Format|Style), and this is denoted with brackets to the right that cover multiple cells. You can double-click on such brackets to collapse or expand groups of cells. Cell grouping is a feature that you will probably not use when you first learn to use Mathematica, but you need to understand cell grouping in order to navigate this notebook.
Let's get started. Collapse this section and open the section titled "Using Mathematica as a calculator"
Created by Mathematica (September 8, 2003)