math_tutorial - math_tutorial.nb H* This is how you make a...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
In[2]:= H * This is how you make a comment in Mathematica * L In[3]:= H * In mathematica, you type a formula, then hit @ shift D + @ enter D to have mathematica evaluate the expression * L In[4]:= 2 + 2 H * @ shift D + @ enter D * L Out[4]= 4 In[5]:= H * you can enter several expressions, and then evaluate them all at once * L H * use @ return D to start a new line for each command * L a = 3 b = 7 c = a + b Out[5]= 210 In[6]:= H * mathematica will evaluate an expression quietly if you put a semicolon at the end * L a = 4; b = 9; c = a + b Out[8]= 13 In[9]:= H * to unset the value of a variable use "Clear" * L In[10]:= a Out[10]= 4 In[11]:= Clear @ a D In[12]:= a Out[12]= a In[13]:= b c Out[13]= 9 Out[14]= 13 In[15]:= Clear @ b, c D In[16]:= b c Out[16]= b Out[17]= c math_tutorial.nb 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
In[18]:= H * Built - in functions start with a capital letter. Square brackets enclose the arguments passed to a function * L Sin @ 2.0 D Exp @ 8.1 D Out[18]= 0.909297 Out[19]= 3294.47 In[20]:= H * Defining a function * L f @ x_ D : = Exp @ - x^2 D g @ x_, y_ D : = Sin @ Sqrt @ x^2 + y^2 DD In[22]:= f @ x D g @ a, b D Out[22]= - x 2 Out[23]= Sin A è!!!!!!!!!!!!!! a 2 + b 2 E In[24]:= f @ 2 D g @ 3, z D Out[24]= 1 ÅÅÅÅÅÅ 4 Out[25]= Sin A è!!!!!!!!!!!! 9 + z 2 E In[26]:= H * Use a decimal point on at least one argument to get a numerical output * L f @ 2. D g @ 3., 2 D Out[26]= 0.0183156 Out[27]= - 0.447492 In[28]:= H * Some characters have special meanings * L Log @ E D I^2 Sin @ p D Out[28]= 1 Out[29]= - 1 Out[30]= 0 In[31]:= H * Mathematica is case - sensitive * L Log @ e D i^2 Sin @ P D Out[31]= Log @ e D Out[32]= i 2 Out[33]= Sin @ P D math_tutorial.nb 2
Background image of page 2
In[34]:= H * For powers use @ ^ D * L 3^2 3.^ - 1 Out[34]= 9 Out[35]= 0.333333 In[36]:= H * For multiplication use @ * D or a space * L 2 * 3 2 3 Out[36]= 6 Out[37]= 6 In[38]:= H * For division use @êD or @ ctrl D + @êD *
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

math_tutorial - math_tutorial.nb H* This is how you make a...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online