Session 1 (Week 1a)
Introduction
August 15, 2007
7:00 am


I am going to try again to create a set of Mathematica notebook files that will parallel my efforts to learn calculus.

There are three different dimensions to such an activity:
     1. Learning the technical steps to using Mathematica through the Parallels interface on a Mac computer,
     2. Learning the notational conventions of Mathematica and
     3. Learning how to use Mathematica to enrich my understanding of calculus.
     
Although I have used Mathematica in the past, I have never actually tried to systmatically make notes about this activity.

The first step is to gain control of the Mathematica interface.

The Format menu has a Style option that lists a number of different styles for typing. These provide for 6 levels of heading as well as a style for typing text and a style for indicating that one is typing an expression that should then be interpreted and evaluated by the Mathematica software. The commands for selecting any of these options are the alt-1 through alt-6 commands for the headings, alt-7 for typing text, and alt-9 for typing Mathematica commands.

There are square brackets on the right-hand side of the screen that define what Mathematica calls a "cell". A cell is a distinct component that usually consists of a series of text statements (such as one sees at the moment) or a Mathematica command or the result returned by Mathematica to such a command.

For example, one might begin a session by typing 1 + 2 and verifying that the Mathematica system is operational. I will do that by clicking below this text to initiate a new cell, typing 1+2 which is automatically assumed to be an input statement, and then typing shift-enter to indicate that I am finished typing my input. Here is the result:

1 + 2

3

The Format menu also has an option called Style Sheet that provides 17 different formatting styles for the entire session. It is worth trying most of these to see the result of the different options and to pick one that appeals to one's individual preference. I am currently using one called "Report".

Before proceding with anything useful, one must also know how to save one's work. There are two different options. As with any software, there is the standard "Save" command under the File menu. This will save the entire session in a special format that can only be read by Mathematica. There is another option that allows one to save the entire session in a complete set of files that will create a web site. Such an option allows the session to be read by anyone with a Web browser (i.e. almost everyone who has a computer). I will save this session using both options.

I think this covers the basic technical commands for getting started with Mathematica.

Now to begin looking at the notational conventions for typing mathematical expressions. These are often quite different than the notation that one sees in most textbooks which are intended for someone who is using a pen and paper to carry out the mathematics. The reason for the difference is that anything intended for processing by a computer needs a higher level of syntactic precision than that normally required when one is working by hand.

Let's begin by doing a few basic computations involving addition, subtraction, multiplication, division and exponentiation.

1 + 3

4

1 - 3

-2

1 * 3

3

1/3

1/3

1^3

1

Note that the symbol for multiplication is the asterisk, the symbol for division is the slash, and the symbol for exponentiation is the carat. Also note that the answer for 1 divided by 3 is expresses as a fraction.

One can force a decimal result by using a decimal value in the initial command.

1./3

0.333333

1/3.

0.333333

1./3.

0.333333

There is an additional way to indicate that you want the answer to be expressed in decimal form. Type N and then enclose the expression between square brackets.

N[1/3]

0.333333

One can specify the number of significant digits in an answer by adding a comma and a number indicating the number of digits in the answer.

N[1/3, 10]

0.3333333333

Mathematica maintains a very high degree of precision while carrying out computations.

12345^99

11418743895652888753828718646665895120711202570897222904161101739247885689567662283253033790 ... 364717740842626743151155851003427027265339545886919958052330148490227657021023333072662353515625

One creates a variable by setting a name equal to a value.

a = 34

34

Typing the name of the value returns the value of the variable.

a

34

a + 3

37

3 a

102

3 (a)

102

Note that in the last two examples I tried two alternative ways of expressing multiplication. Two variables separated by a space is the same as implied multiplication. Without the space the two names are treated as one new name, which would be undefined.

a3

a3

Typing Clear followed by the name of the variable removes the value and leaves the variable undefined.
Note: Clear (beginning with an uppercase letter) is a Mathematica command. All Mathematica commands are followed by square brackets that enclose the arguments for that command.

Clear [a]

a

a

y = 3x^2 + 2x - 7

-7 + 2 x + 3 x^2

Mathematica has a plot command that will display the graph that corresponds to a mathematical expression. As always, the arguments are enclosed in square brackets. The first argument is the mathematical expression, the second argument gives the domain of the plot (i.e. x varies between -10 and 10) and this may be followed by a series of additional parameters that affect the appearance of the display. One of these indicates the color of the plotted graph.

Plot[y, {x, -10, 10}]

[Graphics:HTMLFiles/index_43.gif]

⁃Graphics⁃

Plot [y, {x, -5, 5}, PlotStyleRed]

[Graphics:HTMLFiles/index_46.gif]

⁃Graphics⁃

Now I would like to try a few of the problems from the Kelley book.

1.1  Solve the equation 3x - (x - 7) = 4x - 5

Solve[3x - (x - 7) == 4x - 5]

{{x6}}

Note that Mathematica requires 2 equal signs to express a relationship. One equal sign is used to indicate that a particular variable is assigned a value. "Solve" is another Mathematica command.

1.2  Calculate the slope of the line 4x - 3y = 9.

Plot[y = (4/3) x - 3, {x, -5, 5}, PlotStyleRed]

[Graphics:HTMLFiles/index_51.gif]

⁃Graphics⁃

Mathematica does not have a command for automatically finding the slope of a line when the equation is in an implicit form.


Created by Mathematica  (August 17, 2007) Valid XHTML 1.1!