- If not at the top of a "clean"
notebook window, move the cursor slowly down the window until the cursor
becomes a horizontal I-beam.

- Click the mouse; a grey line will appear across the window.

You can now enter new text in the notebook window. The first example defines y, as a function of x. Type the following exactly as it is written:

y = x^3 - x^2 - 9 x + 9

The line
you've just typed is called a command, or "input". When you "enter" such an
input, **Mathematica** processes it and returns "output" (or a result).
To obtain the result you must first "execute" the command by following
these steps:

- If not already there, move the
cursor to the end of the command; in this case, after the second 9.
(Alternatively, put the cursor on the ] to the far right of the command),

- Click the mouse to select the command,

- Hit the Enter key, located on the extreme lower right of the keyboard. (Note: this is NOT the same as the (carriage) Return key that you have been using.)

Once the command is completed, you will see an input line labeled In[1] that contains the original command, and an output line labeled Out[1]. Notice that the result in the output line is written differently than the way we typed it;

- "x cube"and "x square" are typed using the
carat (^ ) .

- The product "9 x" does not need a multiplication symbol. The two possible forms for writing a product are "9 x" (employing a space as above) and "9*x" (employing an asterisk).

Plot[y, {x,-7,7}, PlotRange -> All]

There are some items to note in this plot command that are
peculiar to **Mathematica**:

- Notice the square brackets, [
and ], around the arguments of the Plot command. Also note {x,-7,7}
specifies a domain interval for x. It is important to remember when to use
the different types of brackets.
**Mathematica**is very sensitive to different bracket styles.

- "PlotRange -> All" is a plotting option,
telling
**Mathematica**that---"yes, we do want to see the entire graph". (Other plotting options will be introduced as we need them.) The arrow (->) is created with the "hyphen" followed by the "greater than" keys on the keyboard.

- Notice the upper case letters in Plot and
PlotRange. This is typical of all
**Mathematica**commands and options, so you will need to get used to this! In contrast, if YOU define a new function, like y above, you are free in the use of upper and lower case letters.

Execute the plot command below to see what the graph of y looks like. (Select the command by locating the cursor after it, and hit Enter). You can see that the graph depicts the essential character of function y.

Follow these steps to change the domain interval for x in the plot command below:

- Carefully place the cursor in front of
the -7;

- Press and drag the mouse across the -7,7 (it will be
shaded grey);

- Type -4,4 (the -7,7 will be replaced).

Now execute the modified plot command. (If the command does not execute, it's always a good idea to check for typographical errors. If there are no errors and the graph still does not plot, ask for help.)

You will now see a more detailed graph of y near a point where it crosses the x-axis.

- Locating roots is an important problem that we will pursue from
several directions this semester. But in this case, the question is easily
answered because
**Mathematica**is good at factoring polynomials.

To see this, open a new command line and execute the following command.

Factor[y]

It is now clear that y = 0 precisely at x=-3, x=1, and x=3.

Again, execute:

Plot[y, {x,-4,4}, PlotRange -> All]

A recurring theme in calculus can be paraphrased: most functions are "almost linear" if you look closely enough. To illustrate this point, you can "zoom in" on the graph at x near 2:

- Modify
the plot command below so that the domain interval is 1.9 to 2.1. (If
necessary, you may scroll back to review the directions
**Modifying a command**.)

- Execute the plot command.

Is there anything special about the point (2, -5)? No. You may want to experiment on your own by modifying the command with any value for the domain of x that you choose, and "zoom in" as we have done. Remember the fundamental point being made:

**most functions are "almost linear" if you look closely
enough.**

We will revisit this fundamental notion often in Calculus.

http://math.colgate.edu/mathlab/basicelts.html

Revised: March 1, 1996.

Questions to: valente@colgate.edu

Copyright 1996 © Colgate University. All rights reserved.