SUNY Geneseo Department of Mathematics

Mathematica

Monday, January 30

Math 223
Spring 2023
Prof. Doug Baldwin

Return to Course Outline

Previous Lecture

Anything You Want to Talk About?

(No.)

An Introduction to Mathematica

Mathematica is…

We’ll look at the first 2 of these uses, and mostly the second, in this course.

Mathematica as a Calculator

Mathematica knows the basic arithmetic operations, i.e., +, -, * (multiplication), /, and ^ (exponentiation).

Order of operations is standard “PEMDAS”, i.e.,…

  1. Parenthesized parts before anything else, then
  2. Exponentiation, then
  3. Multiplication and Division, then
  4. Addition and Subtraction

To evaluate an expression (or any command to Mathematica), type it and press Shift-Enter, i.e., the “Shift” and “Enter” keys together.

Mathematica also understands most standard mathematical functions (e.g., trigonometric and inverse trigonometric, logarithms and exponentials, roots, etc.)

Built-in functions always have names that start with a capital letter, and arguments are always enclosed in square brackets, i.e., [ and ].

You can download a notebook that demonstrates many basic arithmetic features of Mathematica.

Try it: use Mathematica to calculate the distance from point (1, 1, 2) to (10, 3, -5). See the notebook for solutions and comments on them.

Plotting with Mathematica

The surfaces we talked about Friday are “implicit” surfaces, i.e., sets of points (x,y,z) defined by equations they solve.

Plot implicit surfaces with the ContourPlot3D function, which looks like

ContourPlot3D[ eqn, {x,lowX,highX}, {y,lowY,highY}, {z,lowZ,highZ} ]

(Italics are placeholders you can replace with your own values, non-italics are things you type exactly as shown.)

Beware that the equality symbol in Mathematica equations is 2 equal signs, ==.

See the end of today’s notebook for some examples.

The last example was the surface defined by the equation (x-1)(x-3) = 0. Surprisingly, at least at first, this equation defines a pair of planes. The reason is that (x-1)(x-3) will be 0 exactly when x-1 is, or when x-3 is, i.e., when x = 1 or x = 3. The equations x = 1 and x = 3 both define planes, so (x-1)(x-3) = 0, which is true when either of the simpler equations holds, defines a pair of planes.

Next

A larger family of implicit (and occasionally explicit) surfaces in 3D: quadrics and cylinders.

Please read section 1.6 in the textbook.

Next Lecture