Getting Started

Mathematica  is divided into two parts: a Front End that handles interaction with the user and a Kernel that does computations.

Documents in Mathematica  are called Notebooks. Many of the operations of the Mathematica  front end are concerned with the creation and manipulation of Notebooks.  The ultimate purpose of the front end, however, is to prepare input to and show output from the kernel.

The Kernel Help Notebooks give many examples of computations you can do with Mathematica , Version 2.  For a complete introduction to the Mathematica  kernel, see Mathematica : A System for Doing Mathematics by Computer, by Stephen Wolfram.

The next section gives a very brief introduction to Notebooks.  For a complete description of Notebooks and the front end, see your user's manual.

Mathematica  Notebooks

Mathematica  stores information in a kind of document called a Notebook.  The document you are now reading is itself a Mathematica  Notebook.

Mathematica  Notebooks are usually divided into sections.  When you first open a Notebook, you are usually shown only the headings for the sections.   You can "open up" the sections to see the material inside them.  To do this, simply double-click the angled bracket, as shown here:

The rest of this Notebook tells you about using Mathematica  and Kernel Help.  To read the other sections of this Notebook, open them by  double-clicking their brackets.  Sections in a notebook may contain several layers of subsections.  In every case, you can open the next level in the hierarchy by double-clicking the angled bracket.

Interacting with the Mathematica  Kernel

In the Kernel Help notebooks you will find many examples of computations you can do with Mathematica .  The basic procedure for doing computations  with  Mathematica  is to enter your input, feed it to the kernel for evaluation, and then get back the result.

Preparing Input

Before input to Mathematica  can be evaluated, it must be entered in a Mathematica  Notebook.  Mathematica  Notebooks are divided into units called cells.  The brackets on the right of the window show where different cells begin and end: --------------------------------------------------->

There are usually several different styles of cell in a Notebook.  The style of a cell corresponds to its pupose.  For example, there are text cells, input cells, output cells, and graphics cells.  To find out the type of a cell, first  select the cell by clicking its cell bracket.  If you go to the Cell Style submenu of the Style menu, you will find the cell type checked.

Any expression you want  Mathematica  to evaluate must be in an input cell. You can usually distinguish an input cell because the text is in boldface and the font looks like a "typewriter" font.  Here's an example of a typical input cell.

Plot[ Sin[x], {x, 0, Pi}]

To create a cell, position the pointer between any two cells to get the horizontal I-beam (you may have to move the mouse around a bit to find the right spot).  Once you get the horizontal I-beam, click once and an insertion bar will appear across the window.  Start typing and the new cell bracket will appear.   Any new cell you create in this way is automatically an input cell.

When Mathematica  starts up, it gives you a blank Notebook.  The insertion bar is already in place at the top of the Notebook.  When you begin typing,  you will create an input cell.

Evaluating Input

Once you have entered your input in an input cell, you need to tell the Mathematica  kernel to evaluate the cell. To evaluate a cell, click the boldface text anywhere and press either Enter-Return, Command-Return,
(-Return) or Shift-Return.  The first input you evaluate in your session may take a little longer to return its result.  This is because Mathematica  is getting started.  You can tell this is happening by the word Starting... at the top of the screen.

Here's an example to evaluate:

43 + 54

Notice the In[ ] : =  and the Out[ ] =  that have appeared.  These are called cell names.  This numbering system is Mathematica's way of cataloging inputs and outputs so that you can refer to them in subsequent calculations.

Kernel Help

What is Kernel Help?

The Kernel Help Notebooks are a collection of Notebooks that give examples of approximately 1,000 different things you can do with Mathematica .  Each Notebook contains examples from a certain area.  For example, the Notebook entitled "Linear Algebra" gives examples of matrix operations, solution of linear equations, matrix decompositions, etc.  The Notebook "System Operations" contains examples of special output forms, external file handling, date and time functions, and string manipulation.

Each Notebook is organized into sections and subsections.  The Calculus Notebook, for example, has sections on Integration, Differentiation, Limits, Series, etc.  Each of these sections begins with a subsection called "Syntax", which gives the basic format for using the appropriate Mathematica functions.  The page numbers at the beginning of each Syntax subsection tell you where to look in The Mathematica  Book for more information.

The Syntax subsection is followed by a sequence of examples that show various ways to use the functions.  Many sections also contain Notes that explain features of the Mathematica  functions and operations in greater depth.

The Kernel Help Notebooks can serve several purposes.  By looking at the entries in the Syntax section you can learn how to use various Mathematica  functions and operations.  The examples can be copied and pasted into your own Notebook, altered, and then evaluated using Mathematica .  You can also learn about the different capabilities of Mathematica  by browsing through the Notebooks.

The main purpose of these Notebooks, however, is to provide examples that show how to use specific Mathematica  functions and operations.  They do not provide a comprehensive view of Mathematica .  One of the most powerful features of Mathematica  is that it lets you easily combine operations and build up complicated calculations.  You can do this either through interactive sessions or by writing programs.  The book Mathematica : A System for Doing Mathematics by Computer, by Stephen Wolfram, will provide you with a comprehensive introduction to all aspects of Mathematica . The page numbers given at various places throughout the Kernel Help Notebooks refer to the second edition of this book.

How to Use Kernel Help

As an example, let us say you want to find out how to plot several functions on the same axis.  The first step is to open the appropriate Notebook, in this case, 2-D Graphics.  After you open the Notebook there are two basic ways  to search for what you want.  These are explained in the next two sections.

Searching by Topic

The first method of search is to use the headings of the sections and subsections in the Notebook to search by topic.  If you look at the section headings in the 2-D Graphics Notebook, you find one called "Combining Plots".  This section can be opened by double-clicking the angled bracket to the right of the heading.  After the group of cells is open, you will see the Syntax subsection.  A portion of this subsection is reproduced below.

Syntax (see pages 143 and 423)

Plot

Plot[{f1, f2, ...}, {x, xmin, xmax }] plots several functions together.

You can use this information to type in the appropriate input in your own Notebook.  Alternatively, you can copy and paste the Syntax entry into your own Notebook and insert your own values for the various arguments. (There is an alternative method for getting "templates" for functions using the Make Template command from the Prepare Input submenu of the Action Menu.  See your user's manual for more information.)

If you want to see an example of how a function is used, you can scroll down in the notebook to look at the examples that follow the Syntax subsection. In the 2-D Graphics Notebook you would find an example with the title "Plotting Several Functions".  The example is shown below.

Plotting Several Functions

Plot[{Sin[x], Sin[2x], Sin[3x]}, {x, 0, 2Pi}];

You can copy and paste this example into your Notebook and change the arguments into the functions you want to plot.  If you are interested in other ways of displaying your functions, there are many other examples following this example in the 2-D Graphics Notebook.  These examples show how to put the plots into an array, use different line styles for each function, etc.  Other sections explain how to use various options that adjust such things as the frame, labels, and axes.

Searching by Keywords

The first section in each Notebook is the Index.  The Index gives a list of keywords that are associated with various cells in the Notebooks.  If you Command-Double-click (-Double-click) a keyword, Mathematica  will find the cell associated with that keyword, select it, and display it in the center of your window.

Let's use the same example we used in the last section.  Say you are trying to learn how to plot several functions on the same axis.  You have opened the 2-D Graphics Notebook.  At the top of the Notebook in the Index section you will see a list of keywords.  Here's a piece of it.

ParametricPlot`basic  
ParametricPlot`options
Plot`basic 
Plot`combining 
Plot`options  
ListPlot`basic  
ListPlot`options

If you Command-Double-click the word "Plot`combining", Mathematica  will move you to the Syntax example given in the last section.

As an alternative to using Command-Double-click (-Double-click), you can use the Keywords submenu of the Find menu to search for cells associated with keywords.

Typographic Conventions in the Kernel Help Notebooks

There are specific conventions used for choosing the fonts and typeface in the Kernel Help Notebooks.  Understanding these conventions will make it easier to understand the Syntax sections and the examples.

These conventions are:

text in this style  --- literal Mathematica  input that you type in as printed (e.g., function names)

text in this style --- expressions that you fill in (e.g., function arguments)

object1, object2, ...  --- a sequence of any number of expressions

How to Get More Information

These Notebooks give examples of the most commonly used functions in Mathematica .  However, Kernel Help does not document all the features of Mathematica .  There are functions and operations that do not appear at all. Functions that do appear may have options and capabilities that are not explained.

In every case, to get more information on a Mathematica  function or operation you should refer to Mathematica : A System for Doing Mathematics by Computer, by Stephen Wolfram.  At the beginning of each Syntax section in a Kernel Help Notebook, page references are provided to the second edition of this book.  For more detailed information on specific functions or operations you can refer to the alphabetical listings in the Reference Guide in the appendix of this book.