7 : 30 am

This is a Mathemtica notebook that I have created while reading "Mathematica Demystified" .

Chapter 1 Getting Started

1.2 Entering Expressions

One must press Shift + Return in order for Mathematica to evaluate an expression .

In[1]:=

1 + 1

Out[1]=

2

1.4 Basic Arithmetic

Mathematica can do all the basic arithmetic operations .

2 * 3 + 4^2

Out[2]=

22

The above expression is equivalent to :

In[3]:=

(2 * 3) + (4^2)

Out[3]=

22

where

2 * 3 indicates multiplication

Out[4]=

6

and

4^2 indicates exponentiation

Out[5]=

16

In[6]:=

5 * 6

2 (3 + 4)

(2 - 3 + 1) (1 + 2/3) - 5^(-1)

6 !

Out[6]=

30

Out[7]=

14

Out[8]=

-1/5

Out[9]=

720

1.6 Exact versus Approximate

Mathematica always views decimal representations as approzimations . If we ever do a calculation that involves approximate numbers Mathematica will give an approximate number .

In[10]:=

3/4

3./4.

12^(1/2)

12^.5

Out[10]=

3/4

Out[11]=

0.75

Out[12]=

2 3^(1/2)

Out[13]=

3.4641

1.7 Using Functions

Mathematica has thousands of functions .

In[42]:=

Sqrt[27]

N[Sqrt[27]]

Out[42]=

3 3^(1/2)

Out[43]=

5.19615

In[46]:=

N[Pi, 100]

N[Pi/10, 30]

N[Pi/10, 3]

Out[46]=

3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068

Out[47]=

0.314159265358979323846264338328

Out[48]=

0.314

In[55]:=

Sqrt[-16]

N[E, 10]

E^(I Pi)

Out[55]=

4 

Out[56]=

2.718281828

Out[57]=

-1

The above calculations involve the three special numbers e, i and pi .

Notation : All built in functions begin with a capital letter . Square brackets are always u ... e input to the function . Parentheses ( and ) are used to group terms in algebraic expressions .

I have just completed section 1.7 on page 9.

8 : 30 am


Created by Mathematica  (May 1, 2009) Valid XHTML 1.1!