(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-5, 12, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L-5, 12, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B65535, L-5, 12, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier"; fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = leftheader, inactive, L2, 12, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, "Times"; fontset = leftfooter, inactive, L2, 12, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; paletteColors = 128; showRuler; automaticGrouping; currentKernel; ] :[font = title; inactive; preserveAspect; rightWrapOffset = 459; startGroup] A Short Mathematica Primer ;[s] 2:0,1;21,0;28,-1; 2:1,25,18,Times,0,24,0,0,0;1,25,18,Times,3,24,0,0,0; :[font = subsubtitle; inactive; preserveAspect] Copyright 1994 A. D. Andrew T. D. Morley :[font = section; inactive; preserveAspect; rightWrapOffset = 459; startGroup] Introduction :[font = text; inactive; preserveAspect; leftWrapOffset = 18; leftNameWrapOffset = 54; rightWrapOffset = 459; endGroup] Mathematica is a powerful system for doing mathematics by computer. This tutorial is designed to give you a brief introduction to the system, and can be used anytime as a refresher. While the syntax may seem unforgiving at first, Mathematica is amazingly consistent, and this consistency makes Mathematica easy to use. To see some of this consistency, notice the similarities in formats for the commands you use in this tutorial. After a short while you'll be able to "guess" the form of a new command. A word about the organization of this primer is in order. Below you'll see various cells, such as the one labeled "Try this first." This is a closed cell. To open it, double-click on the black triangle at the right. To close a cell which is open, double-click on the cell-bracket to it's right. Practice this now by closing and opening this Introduction cell. Some things to keep in mind are 1. Mathematica is case sensitive and ALL Mathematica FUNCTIONS BEGIN WITH A CAPITAL LETTER. IF THE FUNCTION NAME IS TWO WORDS, THEY ARE BOTH CAPITALIZED. 2. Parentheses ( ), braces { }, and brackets [ ] all have special uses. Pay attention to them. 3. Multiplication is denoted by juxtaposition (writing things next to eachother), but xy will be interpreted as a single variable and not a product. You need a space between x and y (x y) to multiply x times y. ;[s] 24:0,1;13,0;234,1;246,0;299,1;311,0;628,5;642,0;858,5;870,0;911,2;915,3;927,2;950,4;954,6;965,4;1068,2;1255,4;1257,2;1354,4;1357,2;1361,4;1362,2;1381,0;1383,-1; 7:6,13,9,Times,0,12,0,0,0;3,13,9,Times,2,12,0,0,0;6,13,9,Times,0,12,65535,0,0;1,13,9,Times,2,12,65535,0,0;5,13,9,Times,1,12,65535,0,0;2,13,9,Times,1,12,0,0,0;1,13,9,Times,3,12,65535,0,0; :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Try this first :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Notice how similar these commands look. This similarity is what makes Mathematica easy to use. Read the command, move the cursor into the line on which the command appears, mash the ENTER key, and notice what happens. ;[s] 5:0,0;71,1;83,0;185,2;190,0;221,-1; 3:3,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0;1,13,9,Times,0,12,65535,0,0; :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To plot the graph of a function :[font = input; preserveAspect; rightWrapOffset = 459] Plot[x^2 + 3 x, {x,-2,2}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To find the definite integral of a function :[font = input; preserveAspect; rightWrapOffset = 459] Integrate[x^2 + 3 x,{x,-2,2}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To approximate the definite integral using a numerical method :[font = input; preserveAspect; rightWrapOffset = 459] NIntegrate[x^2 + 3 x,{x,-2,2}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To generate a list ;[s] 2:0,0;14,1;19,-1; 2:1,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] listOfSquares = Table[j^2,{j,1,10}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To plot the list :[font = input; preserveAspect; rightWrapOffset = 459] ListPlot[listOfSquares] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To plot the surface defined by a function of two variables :[font = input; preserveAspect; rightWrapOffset = 459] Plot3D[(1/3) x^3 - x y^2, {x,-1,1},{y,-1,1}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To make a contour map of the surface defined by a function of two variables :[font = input; preserveAspect; rightWrapOffset = 459] ContourPlot[(1/3) x^3 - x y^2, {x,-1,1},{y,-1,1}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Notice the capitalization in the next one. What do you think Sin and Pi are? ;[s] 5:0,0;62,1;65,0;70,1;72,0;78,-1; 2:3,13,9,Times,0,12,0,0,0;2,13,9,Times,1,12,0,0,0; :[font = input; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Play[Sin[440 2 Pi t],{t,0,2}] :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; rightWrapOffset = 459; pictureLeft = 34; pictureWidth = 282; pictureHeight = 174; pictureID = 10769; soundID = 4723] :[font = output; output; inactive; preserveAspect; rightWrapOffset = 459; endGroup] Sound["<<>>"] ;[o] -Sound- :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To plot several functions on the same set of axes. :[font = input; preserveAspect; rightWrapOffset = 459] Plot[{Sqrt[13 x], E^x, x^2 - x},{x,0,2}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459; endGroup] Notice that 1. Parentheses ( ) are used to group terms for algebraic operations like (1/3) x^3 2. Braces { } group lists like {x,-1,1} 3. Brackets [ ] surround the arguments of a function like Plot[ ... ] or Sin[ .. ]. ;[s] 14:0,1;97,2;106,1;138,2;143,1;149,2;157,1;213,2;221,1;227,2;238,1;242,2;251,1;252,0;253,-1; 3:1,13,9,Times,0,12,0,0,0;7,13,9,Times,0,12,65535,0,0;6,13,9,Times,1,12,65535,0,0; :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Some Basic Operations and Functions :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Algebraic and Trigonometric Operations :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Here are illustrations of basic algebraic and trigonometric manipulations. Please try them out and see what they do. :[font = input; preserveAspect; rightWrapOffset = 459] 7 + 5 6 /3^4 :[font = input; preserveAspect; rightWrapOffset = 459] (7 + 5 6 /3^4)//N :[font = input; preserveAspect; rightWrapOffset = 459] N[7 + 5 6 /3^4,25] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Try these symbolic operations. Notice the effect of parentheses. Multiplication and division have equal priority, but like many computer languages, Mathematica reads left to right. ;[s] 3:0,0;150,1;162,0;184,-1; 2:2,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] a / b c :[font = text; inactive; preserveAspect; rightWrapOffset = 459; fontColorRed = 65535] The division (on the left) was done before the multiplication (on the right). :[font = input; preserveAspect; rightWrapOffset = 459] a / (b c) :[font = text; inactive; preserveAspect; rightWrapOffset = 459] The parentheses instructed Mathematica to do the multiplication before the division. ;[s] 3:0,0;27,1;39,0;86,-1; 2:2,13,9,Times,0,12,65535,0,0;1,13,9,Times,2,12,65535,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] a / bc :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Mathematica interpreted bc as a single variable. It can't read your mind. ;[s] 4:0,1;12,0;25,2;27,0;76,-1; 3:2,13,9,Times,0,12,65535,0,0;1,13,9,Times,2,12,65535,0,0;1,13,9,Times,1,12,65535,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] FactorInteger[4557141] :[font = input; preserveAspect; rightWrapOffset = 459] 3^4 127^1 443^1 :[font = text; inactive; preserveAspect; rightWrapOffset = 459] For a good time, call 455-7141 in Atlanta. :[font = input; preserveAspect; rightWrapOffset = 459] Factor[x^2 + 3 x + 2] :[font = input; preserveAspect; rightWrapOffset = 459] Expand[(1+x) (2 + x)] :[font = input; preserveAspect; rightWrapOffset = 459] 1/(x + 3) + 2/(x + 2) :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To put an expression over a common denominator :[font = input; preserveAspect; rightWrapOffset = 459] Together[1/(x + 3) + 2/(x + 2)] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To expand an expression into partial fractions (break up that common denominator) :[font = input; preserveAspect; rightWrapOffset = 459] Apart[(8 + 3 x)/((2 + x)(3 + x))] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To simplify an expression :[font = input; preserveAspect; rightWrapOffset = 459] (1+x) (2 + x) + (1 + x) (3 + x) :[font = input; preserveAspect; rightWrapOffset = 459] Simplify[(1+x) (2 + x) + (1 + x) (3 + x)] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Some built-in functions :[font = input; preserveAspect; rightWrapOffset = 459] Sin[Pi/3] :[font = input; preserveAspect; rightWrapOffset = 459] Cos[Pi/3] :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] ArcSin[.45] :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Calculus :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Defining Functions :[font = text; inactive; preserveAspect; rightWrapOffset = 459] There are two ways to define a function. The delayed assignment operator is := and the immediate assignment operator is =. Don't forget the underscore. It tells Mathematica what's a variable. ;[s] 9:0,1;77,2;79,1;121,2;122,1;142,2;152,1;164,0;176,1;196,-1; 3:1,13,9,Times,2,12,65535,0,0;5,13,9,Times,0,12,65535,0,0;3,13,9,Times,1,12,65535,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] f[x_] := x Sin[x^2] :[font = input; preserveAspect; rightWrapOffset = 459] g[x_] = x^2 Sin[1/x] :[font = input; preserveAspect; rightWrapOffset = 459] h[x_] = x^3 + 2 x^2 + 1 :[font = input; preserveAspect; rightWrapOffset = 459] f[2] :[font = input; preserveAspect; rightWrapOffset = 459] g[5] :[font = input; preserveAspect; rightWrapOffset = 459] g[5.] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] "Slash dot" (/.) means "evaluate at." ;[s] 4:0,1;14,2;16,1;38,0;39,-1; 3:1,13,9,Times,0,12,0,0,0;2,13,9,Times,0,12,65535,0,0;1,13,9,Times,1,12,65535,0,0; :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] g[x]/.{x->5} :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Derivatives :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Try these and see what you get. Remember that f, g, and h are defined above. Here are some first derivatives :[font = input; preserveAspect; rightWrapOffset = 459] f'[x] :[font = input; preserveAspect; rightWrapOffset = 459] D[h[x],x] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Now some higher order derivatives :[font = input; preserveAspect; rightWrapOffset = 459] D[h[x],{x,2}] :[font = input; preserveAspect; rightWrapOffset = 459] D[g[x],{x,4}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] The next example shows some of the differences between immediate assignment ( = ) and delayed assignment ( := ). In the second example, you're trying to differentiate g[3] with respect to 3. ;[s] 5:0,0;78,1;79,0;107,1;109,0;192,-1; 2:3,13,9,Times,0,12,0,0,0;2,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] fp[x_] = D[f[x],x] :[font = input; preserveAspect; rightWrapOffset = 459] fp[3] :[font = input; preserveAspect; rightWrapOffset = 459] gp[x_] := D[g[x],x] :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] gp[3] :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Partial Derivatives :[font = text; inactive; preserveAspect; rightWrapOffset = 459] It's wise to Clear function names from Mathematica 's memory before using them. ;[s] 5:0,0;13,1;18,0;39,2;51,0;81,-1; 3:3,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0;1,13,9,Times,2,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] Clear[f,g,h] :[font = input; preserveAspect; rightWrapOffset = 459] f[x_,y_,z_] = x^3 y^4 z^5 :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To differentiate f[x,y,z] with respect to x (holding y and z constant) :[font = input; preserveAspect; rightWrapOffset = 459] D[f[x,y,z],x] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Here's a mixed partial derivative -- diferentiate with repect to x twice, y four times, and z once. :[font = input; preserveAspect; rightWrapOffset = 459; endGroup; endGroup] D[f[x,y,z],{x,2},{y,4},{z,1}] :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Solving Equations :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Solving a single equation :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Note the use of the double equals sign == ;[s] 3:0,2;39,3;41,1;42,-1; 4:0,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0;1,13,9,Times,0,12,65535,0,0;1,13,9,Times,1,12,65535,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] Solve[3 x + 5 == 2,x] :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] Solve[x^2 + 3 x + 2 == 0,x] :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Solving a system of equations :[font = input; preserveAspect; rightWrapOffset = 459] Solve[{3 x + 2 y == 5, 2 x - 5 y == 4},{x,y}] :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] Solve[{x^2 + y^2 == 1, y == 9 x^2 - 5}, {x,y}] :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] When "Solve" doesn't apply :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Solve is going to have trouble with inverse trig functions. ;[s] 2:0,1;5,0;60,-1; 2:1,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] Solve[ Sin[x] - 1/x == 0,x] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] The Mathematica function FindRoot is basically Newton's Method. You must start it out with an estimate of where the root is located. Try to make it a good guess for the root you seek. Plotting the function first can help you here. ;[s] 5:0,0;4,1;16,0;26,2;35,0;235,-1; 3:3,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect] Plot[Sin[x] - 1/x,{x,.5,9}] :[font = input; preserveAspect; rightWrapOffset = 459] FindRoot[Sin[x] - 1/x, {x,6}] :[font = text; inactive; preserveAspect] FindRoot works on systems of equations as well. Give estimates for all variables. ;[s] 2:0,1;8,0;83,-1; 2:1,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect] FindRoot[{x^2 + y^2 == 1, y == 9 x^2 - 5}, {x,.8},{y,.6}] :[font = input; preserveAspect; endGroup] FindRoot[{x^2 + y^2 == 1, y == 9 x^2 - 5}, {x,.4},{y,-.6}] :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Evaluating a function at the roots of an equation :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Unless you really like typing (and making mistakes), this is worth learning. ;[s] 2:0,1;76,0;77,-1; 2:1,13,9,Times,0,12,0,0,0;1,13,9,Times,0,12,65535,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] Clear[f] :[font = input; preserveAspect; rightWrapOffset = 459] f[x_] = 4 x^2 + 3 x :[font = input; preserveAspect; rightWrapOffset = 459] roots = Solve[x^2 + 3 x + 2 == 0,x] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Notice that roots is the name assigned to this list of numbers. ;[s] 3:0,0;12,1;17,0;64,-1; 2:2,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] roots :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To evaluate f at the first root. :[font = input; preserveAspect; rightWrapOffset = 459] f[x]/.roots[[1]] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To evaluate f at the second root :[font = input; preserveAspect; rightWrapOffset = 459] f[x]/.roots[[2]] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To get them both at once :[font = input; preserveAspect; rightWrapOffset = 459; endGroup; endGroup] f[x]/.roots :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Vectors :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Vectors are just lists, enclosed by braces { } ;[s] 4:0,0;17,1;22,0;36,1;47,-1; 2:2,13,9,Times,0,12,0,0,0;2,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] v = {1,2,3} :[font = input; preserveAspect; rightWrapOffset = 459] w = {5,1,3} :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Addition of vectors :[font = input; preserveAspect; rightWrapOffset = 459] v + w :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Multiplication of a vector by a scalar is done by juxtaposition. :[font = input; preserveAspect; rightWrapOffset = 459] 3 w :[font = text; inactive; preserveAspect; rightWrapOffset = 459] The dot product of vectors is not just juxtaposition. The space dot space is necessary. ;[s] 5:0,0;4,1;15,0;59,1;74,0;89,-1; 2:3,13,9,Times,0,12,0,0,0;2,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459; endGroup; endGroup] v . w :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Getting Help :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Type ? or ?? :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To learn a little bit about a Mathematica function, type ?FunctionName. To learn more, type ??FunctionName. For example ;[s] 7:0,0;30,1;42,0;58,2;71,0;94,2;108,0;123,-1; 3:4,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0;2,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] ?ParametricPlot3D :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] ??ParametricPlot3D :[font = subsection; inactive; preserveAspect; rightWrapOffset = 459; startGroup] The Function Browser :[font = text; inactive; preserveAspect; rightWrapOffset = 459; endGroup; endGroup] Mathematica 2.2 has a built-in feature called the Function Browser. Select the Help pull-down menu and select Open Function Browser. Try it. Select "Algebraic Computations" from the left menu, then "Calculus" from the middle menu, and finally "D" from the right-hand menu. Try the "Paste Template" button, and then try the "Evaluate Template" button. To learn more about solving equations (there are other functions than Solve), look in the Function Browser under "Algebraic Computations/Equation Solving." Now try browse on your own. ;[s] 10:0,1;17,0;52,2;68,0;82,2;86,0;113,2;134,0;430,2;435,0;545,-1; 3:5,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0;4,13,9,Times,1,12,0,0,0; :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Word Processing :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Mathematica allows you to mix text, graphics, live computer code in a single document called a "Notebook." You're reading a Notebook right now. You can organize the Notebook, just like this one, to contain cells which are "Titles," cells which are "Sections," "Subsections," "text," and so on. There's a Title cell at the very beginning of this Notebook. The cell above which says "Word Processing" is a Section cell. Here are two more examples. ;[s] 2:0,1;12,0;452,-1; 2:1,13,9,Times,0,12,0,0,0;1,12,9,Times,2,12,0,0,0; :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] This Cell is a Subsection Cell :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] And this is a subsubsection cell :[font = text; inactive; preserveAspect; rightWrapOffset = 459; endGroup; endGroup; endGroup] Make some examples of your own. Use the mouse to move the cursor just below this cell. The cursor should then look like a horizontal "I-beam" (sort of like this >--< ). Click the mouse to begin a new cell, then use the mouse to select the Style menu, the Cell Style submenu, and finally the typle of cell you wish. Then start typing. The default cell style is input, and if you want text, you're always better off making a text cell before you start typing. ;[s] 5:0,0;243,1;248,0;259,1;269,0;466,-1; 2:3,13,9,Times,0,12,0,0,0;2,13,9,Times,1,12,0,0,0; :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] More Advanced Operations and Functions :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] The use of Options :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Most Mathematica functions accept options in addition to their basic arguments. To learn what options are available for a given function, type ??FunctionName. For example ;[s] 7:0,0;5,1;17,0;35,2;42,0;145,2;159,0;174,-1; 3:4,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0;2,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] ??Plot :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Here are some examples. The arrow you see (->) is made using the "minus sign" and "greater than" keys. To guarantee equal scales on the axes ;[s] 3:0,0;44,1;46,0;143,-1; 2:2,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] Plot[Sin[x^2],{x,-3,3}, AspectRatio->Automatic] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To specify the range on the vertical axis :[font = input; preserveAspect; rightWrapOffset = 459] Plot[1/(x (x-2)),{x,-3,3}, PlotRange->{-4,4}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To see the whole picture :[font = input; preserveAspect; rightWrapOffset = 459] Plot[E^x,{x,-3,3}, PlotRange->All] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To label axes (are you surprised that the option is called AxesLabel?) ;[s] 3:0,0;59,1;68,0;71,-1; 2:2,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] Plot[x^2 + Sin[14 x],{x,-3,3}, AxesLabel->{yankees, dodgers}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To color graphs so as to distinguish them from eachother :[font = input; preserveAspect; rightWrapOffset = 459] Plot[{Sin[x],Cos[2 x]},{x,-2,4}, PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,1]}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To vary the thickness of graphs :[font = input; preserveAspect; rightWrapOffset = 459] Plot[{Sin[x],Cos[2 x]},{x,-2,4}, PlotStyle->{Thickness[.01],Thickness[.02]}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] And on and on. Try some of the other options yourself. To obtain an unshaded ContourPlot ;[s] 2:0,0;79,1;91,-1; 2:1,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] ContourPlot[x y , {x,-2,2},{y,-2,2}, ContourShading->False] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To plot a single contour (at height .5) :[font = input; preserveAspect; rightWrapOffset = 459] ContourPlot[x y , {x,-2,2},{y,-2,2}, Contours->{.5}, ContourShading->False] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To display a 3-dimensional plot in a cube :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] Plot3D[(1/3) x^3 - x y^2, {x,-1,1},{y,-1,1}, BoxRatios->{1,1,1}] :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] More on Graphing :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Combining several graphs :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Plots can be named, and combined using the function Show. ;[s] 3:0,0;52,1;56,0;58,-1; 2:2,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] picture1 = Plot[x Sin[x^2],{x,0,3}] :[font = input; preserveAspect; rightWrapOffset = 459] picture2 = Plot[(1/x) Sin[x],{x,0,3}] :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] Show[picture1,picture2] :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Plotting a Parametric Curve in the Plane :[font = text; inactive; preserveAspect; rightWrapOffset = 459] The name of the command is ParametricPlot ;[s] 2:0,0;27,1;42,-1; 2:1,13,9,Times,0,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] ParametricPlot[{Sin[3 t],Sin[2 t]}, {t,0, 2 Pi}, AspectRatio->Automatic] :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Plotting a Parametric Curve in 3-Space :[font = text; inactive; preserveAspect; rightWrapOffset = 459] Can you guess the name of the Mathematica function to use? That's right, it's ParametricPlot3D. ;[s] 5:0,0;30,1;42,0;80,2;96,0;98,-1; 3:3,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] ParametricPlot3D[{Cos[t],Sin[t],t}, {t,0,4 Pi}, BoxRatios->{1,1,2}, Boxed->False, Axes->None] :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Plotting a Parametric Surface in 3-Space :[font = text; inactive; preserveAspect; rightWrapOffset = 459] The Mathematica function is still ParametricPlot3D. ;[s] 5:0,0;4,1;16,0;35,2;51,0;53,-1; 3:3,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459; endGroup] ParametricPlot3D[{2 Cos[theta] Sin[phi], 3 Sin[theta] Sin[phi], 5 Cos[phi]}, {theta,0,2 Pi}, {phi,0,2 Pi}] :[font = subsubsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 459; startGroup] Plotting a Curve in Polar Coordinates :[font = text; inactive; preserveAspect; rightWrapOffset = 459] The Mathematica function is PolarPlot, but to make it available, you must load in a graphics package. To load the graphics package ;[s] 5:0,0;4,1;16,0;29,2;38,0;133,-1; 3:3,13,9,Times,0,12,0,0,0;1,13,9,Times,2,12,0,0,0;1,13,9,Times,1,12,0,0,0; :[font = input; preserveAspect; rightWrapOffset = 459] <<:Graphics:Graphics.m :[font = input; preserveAspect; rightWrapOffset = 459] ?PolarPlot :[font = input; preserveAspect; rightWrapOffset = 459] PolarPlot[1 + Cos[t],{t,0,2 Pi}] :[font = text; inactive; preserveAspect; rightWrapOffset = 459] To plot two curves on the same axes :[font = input; preserveAspect; rightWrapOffset = 459; endGroup; endGroup; endGroup; endGroup] PolarPlot[{1 + Cos[t],Sin[2 t]},{t,0,2 Pi}] ^*)