PHYSICS
math_tutorial

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

• Notes
• 6

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

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

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

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
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 23 Out[36]= 6 Out[37]=

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

This is the end of the preview. Sign up to access the rest of the document.
• Fall '09
• M.Moore
• mechanics, Eigenvalue, eigenvector and eigenspace, H*, ÅÅÅÅ H5

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern