Mathematica Basics - Arithmetic
Introduction
MathematicaÌýhas been described by some asÌýthe world's most expensive calculator. While this description doesn't pay such a powerful program the tribute it deserves, it can certainly be treated as an on-line calculator, and that's basically what we're going to be doing in this laboratory.
The Arithmetic Commands
Now let's quickly go over the symbols used when doing basic arithmetic withÌýMathematica:
- +Ìýsimply means plus, as you'd expect.
- -Ìýmeans minus.
- *Ìýmeans times.
- /Ìýmeans divide.
- ^Ìýmeans raise to the power of. On the keyboard it is SHIFT-6.
- !Ìýmeans factorial, as you'd expect.
- %, the percent sign, refers to theÌýprevious result. On the keyboard it is SHIFT-5.
- N[...]Ìýis a function which takes theÌýdecimal valueÌýof whatever is placed inside the brackets in place of the dots.
- PiÌýmeans the Greek letter Ï€, and has its usual mathematical meaning inÌýMathematicaÌýof approximately 3.14159, or the circle’s circumference/diameter ratio.ÌýMathematicaÌý¾±²õÌýcase-sensitive, so make sure you capitalize the "P". (Alternatively, on the Macintosh keyboard, you may use the option-p key combination to produce the Ï€ symbol, instead of typing out its name, or even choose the character from the appropriate pallette.)
- EÌýmeans the base of the natural logarithm, calledÌýeÌýin most written mathematics, and approximately 2.71828.
Note: All ofÌýMathematica's built in functions start with a capital letter. Get used to it.
Evaluating Commands
There's one last thing you should be aware of before we dive into a real notebook. In order to tellÌýMathematicaÌýthat you want it to actually evaluate what you have typed, hit the ENTER key over on the extreme right side of your keyboard on the numeric keypad.
Do not confuse this with the RETURN key, which merely starts a new line of text. (MathematicaÌýcommands can span many lines if you want them to.) It should be noted, however, that SHIFT-RETURNÌýwillÌýwork the same as the ENTER key
You're about to do the easiest laboratory exercise of the course, so don't panic too much.
You can now switch to an actualÌýMathematicaÌýpractice notebook by clicking on the icon on the left. It may take a while to start up! Don't forget to come back here when you're done! (You can also return here just to reread the instructions.) See you in a few minutes.
Welcome back! You may be wondering how well you did. Click on the icon on the left to see the answers you should have gotten. (Only the answers are given, so if you don't match our results you need to figure out what you did wrong.)
You've now finished learning the Basics of Arithmetic inÌýMathematica. You may next go to theÌýTable of Contents for theÌýMathematicaÌýBasics Labs, or go to theÌýTable of Contents for all of the Differential Equations Labs, or simply quit.