Once you have access to an installation of Mathematica, you need to know how to
use it.
Opening the Program
- In an on-campus PC lab, go to Start Menu, then Programs, then Wolfram Mathematica. Click
on the icon for Mathematica, Spikey.
- Up will pop two windows, the smaller colored Welcome Screen and an empty white Mathematica notebook. The
notebook is where all your interactions with the program will take place. Once you are familiar with
Mathematica, you'll likely dismiss the Welcome Screen right away.
First steps with Mathematica
- For now, let's investigate this Welcome Screen. You have two options. To get an overview of what Mathematica
can do, click on "Get a quick overview". Otherwise, go directly to "Learn with guided examples" for a crash
course in how to do evaluations using Mathematica. Follow this tutorial and discuss the most interesting aspects
with your neighbors.
- One of the most important things to do is explore. If you are having trouble with a certain function, use the
? command to ask for help. Enter ? Table and the output will be a yellow box
with a quick synopsis of the command. For more detailed information, click the blue >> at the bottom
right of this yellow box. This will open the Documentation Center which gives examples of using the
command in action, available options for this command, and anything else you might want to know about the command.
Other Items of Note!
- In Mathematica, it is important to distinguish between parentheses (), brackets [], and braces {}:
- Parentheses (): Used to group mathematical expressions, such as (3+4)/(5+7).
- Brackets []: Used when calling functions, such as N[Pi].
- Braces {}: Used when making lists, such as {i,1,20}.
If you use the wrong symbols in the wrong places or if you do not have a closing symbol for every opening symbol, Mathematica will
give you an error.
- Mathematica is Case-SenSitive (AA is not the same as aA), so
be careful about what you type.
Many of your initial errors will come about because of one of these two problems.
- In Mathematica, there are four types of equals: =, :=, ==, and
===.
- To define a variable to store it in memory, use =. For example, to define z to be 3, write
z=3.
- You use == to check for equality. For example, 1-1==0 will
evaluate to True and 1==0 will evaluate to False.
- You use := to define your own command. (This is advanced.)
- You will likely not use === in this class.
Algebra and Calculus
Mathematica will do everything your calculator can and more.
- Use ^ to put something to a power.
- pi is Pi, e is E and sqrt(-1) is I.
- If you want to see the numerical approximation to a fraction or irrational number, use the function N. For example, to find the decimal represenation of pi, write N[Pi].
- Use E^x or Exp[x] to represent the function ex.
- To take the derivative of a function, use D and specify the derivative with respect to which
variable. For instance D[x^2 + 3x, x].
- To take the integral of a function, use Integrate and specify the integral with respect to
which variable. For instance Integrate[x^2 + 3x, x].
- To solve for the roots of ax2+bx+c=0 symbolically, use Solve[a x^2 + b x + c == 0, x].
Notice the double equals sign. (Mathematica is searching for when the expression is True.)
- Coefficient[(1 + x)^10, x^3] gives the coefficient of x3 in the expansion
of (1 + x)10.
Back to the Mathematical Models Home Page.
Christopher Hanusa –
Queens College –
Mathematics Department.
|