(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 31175, 1009]*) (*NotebookOutlinePosition[ 31857, 1032]*) (* CellTagsIndexPosition[ 31813, 1028]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Introduction to ", StyleBox["Mathematica", FontSlant->"Italic"] }], "Title"], Cell[CellGroupData[{ Cell[TextData[{ "The Anatomy of a ", StyleBox["Mathematica", FontSlant->"Italic"], " Notebook" }], "Subsection"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " documents, called notebooks, are composed of cells. The brackets along \ the right side of the window indicate the extent of the cells. Each cell is \ assigned a style. The cell that you are currently reading is a ", StyleBox["Text ", FontSlant->"Italic"], "cell. The cell above this one is a ", StyleBox["Title", FontSlant->"Italic"], " cell. Go to the ", StyleBox["Format", FontSlant->"Italic"], " menu at the top of this window and select ", StyleBox["Style", FontSlant->"Italic"], ". You will see a list of all of the cell styles that are available. In \ addition to cell styles, ", StyleBox["Mathematica", FontSlant->"Italic"], " has notebook styles, that determine how the various cell styles are to be \ displayed. You can go to the ", StyleBox["Format", FontSlant->"Italic"], " menu and select ", StyleBox["Style Sheet", FontSlant->"Italic"], " to change the style for this notebook." }], "Text"], Cell[TextData[{ StyleBox["Input", FontSlant->"Italic"], " cells contain ", StyleBox["Mathematica", FontSlant->"Italic"], " commands. When you evaluate an ", StyleBox["Input", FontSlant->"Italic"], " cell, ", StyleBox["Mathematica", FontSlant->"Italic"], " creates ", StyleBox["Output", FontSlant->"Italic"], " cells and possibly ", StyleBox["Graphics", FontSlant->"Italic"], " cells to hold the results. Click anywhere in the following ", StyleBox["Input", FontSlant->"Italic"], " cell or on the cell's bracket along the right side, and then press \ Shift-Enter to evaluate the cell. ", StyleBox["Mathematica", FontSlant->"Italic"], " will create a ", StyleBox["Graphics", FontSlant->"Italic"], " cell and an ", StyleBox["Output ", FontSlant->"Italic"], "cell." }], "Text"], Cell[BoxData[ \(Plot3D[ Cos[\(x\^2 + y\^2\)\/2], {x, \(-\[Pi]\), \ \[Pi]}, {y, \(-\[Pi]\), \ \ \[Pi]}]\)], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " actually consists of two programs \[LongDash] the front end and the \ kernel. The front end displays ", StyleBox["Mathematica", FontSlant->"Italic"], " notebooks and the kernel performs calculations. The kernel is launched \ when you evaluate the first ", StyleBox["Mathematica", FontSlant->"Italic"], " ", StyleBox["Input", FontSlant->"Italic"], " cell. The kernel maintains a history of the commands that you ask it to \ evaluate, independent of the order in which your ", StyleBox["Input", FontSlant->"Italic"], " cells appear in your notebooks. That is, you can jump around in the \ notebooks and the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel will keep track of the order in which you evaluated the ", StyleBox["Input", FontSlant->"Italic"], " cells. The front end will help you keep track of the order by displaying \ ", StyleBox["In[n]:=", FontSlant->"Italic"], " before each evaluated ", StyleBox["Input", FontSlant->"Italic"], " cell, where ", StyleBox["n", FontSlant->"Italic"], " is incremented each time you evaluate a cell. The values that you have \ assigned to your variables will be kept in the kernel until you ask the \ kernel to clear them or until you quit the ", StyleBox["Mathematica", FontSlant->"Italic"], " application. If you want to resume your work later, you will have to \ save your notebook and re-evaluate the ", StyleBox["Input", FontSlant->"Italic"], " cells when you re-launch ", StyleBox["Mathematica.", FontSlant->"Italic"] }], "Text"], Cell[TextData[{ "Cells are grouped, as indicated by the nested square brackets along the \ right side of any ", StyleBox["Mathematica", FontSlant->"Italic"], " notebook. Cell groups can either be open or closed. This group, under \ the heading ", StyleBox["The Anatomy of a ", FontWeight->"Bold"], StyleBox["Mathematica", FontWeight->"Bold", FontSlant->"Italic"], StyleBox[" Notebook", FontWeight->"Bold"], ", is open. The group just below this one, under the heading, ", StyleBox["Getting Help", FontWeight->"Bold"], ", is closed. This is indicated by the small triangle at the bottom of the \ cell bracket. You can open a closed group by double-clicking on the cell \ bracket or the triangle. You can close an open group by double-clicking on \ its cell bracket. As you finish each section of this notebook, double-click \ on the next closed section to progress to the next topic." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Getting Help", "Subsection"], Cell[TextData[{ "There are several places you can turn to for help when you are trying to \ get ", StyleBox["Mathematica", FontSlant->"Italic"], " to do what you want. Your first source for help is the ", ButtonBox["Help Browser", ButtonData:>{"Help", None}, ButtonStyle->"GettingStartedLink", ButtonNote->None], ", under the Help menu. The Help Browser has six sections:\n", ButtonBox["Getting Started/Demos", ButtonData:>{"Starting Mathematica", None}, ButtonStyle->"GettingStartedLink", ButtonNote->None], " \[LongDash] introduction to ", StyleBox["Mathematica", FontSlant->"Italic"], " with some inspiring demos,\n", ButtonBox["Built-in Functions", ButtonData:>{"Numerical Computation (Alphabetical Listing)", None}, ButtonStyle->"RefGuideLink", ButtonNote->None], " \[LongDash] syntax and examples for the thousands of functions that are \ built into ", StyleBox["Mathematica", FontSlant->"Italic"], ",\n", ButtonBox["Add-ons", ButtonData:>{"5.0.1", None}, ButtonStyle->"AddOnsLink", ButtonNote->None], " \[LongDash] syntax and examples for the many additional packages that \ extend ", StyleBox["Mathematica", FontSlant->"Italic"], "'s capabilties,\n", ButtonBox["The ", ButtonData:>{"C", None}, ButtonStyle->"MainBookLink", ButtonNote->None], StyleBox[ButtonBox["Mathematica", ButtonData:>{"C", None}, ButtonStyle->"MainBookLink", ButtonNote->None], FontSlant->"Italic"], ButtonBox[" Book", ButtonData:>{"C", None}, ButtonStyle->"MainBookLink", ButtonNote->None], " \[LongDash] in-depth description of how to use ", StyleBox["Mathematica", FontSlant->"Italic"], ", including many examples,\n", ButtonBox["Front End", ButtonData:>{"Menu Listing", None}, ButtonStyle->"OtherInformationLink", ButtonNote->None], " \[LongDash] documentation of front end options, menus, keyboard \ shortcuts, and other miscellany,\n", ButtonBox["Master Index \[LongDash]", ButtonData:>{"C", None}, ButtonStyle->"HelpLink", ButtonNote->None], " a complete index for the other five sections of the Help Browser" }], "Text"], Cell["\<\ Secondly, if you already know the name of the command that you want to use, \ you can get basic help on that command by putting a question mark before the \ command name. For example, click anywhere in the following cell and then \ press Shift-Enter. If you need more help than this, then go to the Built-In \ Functions section of the Help Browser.\ \>", "Text"], Cell[BoxData[ \(\(?ContourPlot\)\)], "Input"], Cell[TextData[{ "If you only know the beginning of a command's name you can use ", StyleBox["Input\[Rule]Complete Selection", FontFamily->"Courier"], " (or \[ControlKey]-k) to get ", StyleBox["Mathematica", FontSlant->"Italic"], " to display a list of commands that begin with those letters. Once you \ have selected a command from this list, you can use ", StyleBox["Input\[Rule]Make Template", FontFamily->"Courier"], " (or \[ShiftKey]-\[ControlKey]-k) to get ", StyleBox["Mathematica", FontSlant->"Italic"], " to display the arguments required for that command. Try this by typing \ Para in a new input cell and pressing \[ControlKey]-k. Select the ", StyleBox["ParametricPlot", FontFamily->"Courier"], " command and then press \[ShiftKey]-\[ControlKey]-k to see what arguments \ are required in ", StyleBox["ParametricPlot", FontFamily->"Courier"], "." }], "Text"], Cell[TextData[{ "Finally, check out Wolfram Research's extensive Web site for additional \ assistance, inspiration, and user-contributed ", StyleBox["Mathematica", FontSlant->"Italic"], " packages. See ", ButtonBox["http://www.wolfram.com/services/", ButtonData:>{ URL[ "http://www.wolfram.com/services/"], None}, ButtonStyle->"Hyperlink"], "." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "The Anatomy of a ", StyleBox["Mathematica", FontSlant->"Italic"], " Command" }], "Subsection"], Cell[TextData[{ "In ", StyleBox["Mathematica", FontSlant->"Italic"], ",the arguments of a function are enclosed in square brackets. Built-in \ functions start with capital letters and everything in ", StyleBox["Mathematica", FontSlant->"Italic"], " is case sensitive. Here is an example that uses the ", StyleBox["Factor", "MR"], " function. Evaluate this command by clicking anywhere in the following \ cell and pressing \[ShiftKey]-\[EnterKey] or by pressing the \[EnterKey] key \ on the numeric keypad. From now on, whenever you see an ", StyleBox["Input", FontSlant->"Italic"], " cell in this notebook, go ahead and evaluate it." }], "Text"], Cell[BoxData[ \(Factor[x\^99 - 1]\)], "Input"], Cell[TextData[{ "If a function has more than one argument, they are separated by commas. \ Here is the ", StyleBox["Solve", "MR"], " command with two arguments. Notice that equations have two equal signs. \ When you evaluate this command, ", StyleBox["Mathematica", FontSlant->"Italic"], " will give you a warning that it may not have found all of the solutions. \ In this case, however, it does find both solutions." }], "Text"], Cell[BoxData[ \(Solve[ 4 \[ExponentialE]\^\(k\ t\)\ - 7 \[ExponentialE]\^\(2 k\ t\) \[Equal] 1\/2, t]\)], "Input"], Cell[TextData[{ StyleBox["Exercise 1.1:", FontWeight->"Bold", FontColor->RGBColor[0, 0.500008, 0.250004]], " Solve the equation ", Cell[BoxData[ \(TraditionalForm\`\(sin\^2\)(4 x) + \(cos\^2\)(5 x) = 1\)]], "." }], "Text", Background->GrayLevel[0.750011]], Cell[TextData[{ StyleBox["Exercise 1.2:", FontWeight->"Bold", FontColor->RGBColor[0, 0.500008, 0.250004]], " Solve the equation ", Cell[BoxData[ \(TraditionalForm\`x\^4 - 3 x\^2 + 2 x - 5 = 0\)]], "." }], "Text", Background->GrayLevel[0.750011]], Cell["\<\ Notice that the solution to this second exercise includes some nasty \ expressions. If you want a decimal approximation to the solution, instead of \ the exact solution, then enclose the Solve equation inside of the N function. \ For example,\ \>", "Text"], Cell[BoxData[ \(N[Solve[x^3 + 1 \[Equal] 0, x]]\)], "Input"], Cell["\<\ You can assign a value to a variable by using a single equal sign.\ \>", "Text"], Cell[BoxData[{ \(k = 5\), "\[IndentingNewLine]", \(Plot[t\^2\ Sin[k\ t], {t, \(-\[Pi]\), \[Pi]}]\)}], "Input"], Cell[TextData[{ "Notice that ", StyleBox["Mathematica", FontSlant->"Italic"], " displayed the output of the \"k = 5\" command as well as the output of \ the ", StyleBox["Plot", FontFamily->"Courier"], " command. If you want to have ", StyleBox["Mathematica", FontSlant->"Italic"], " evaluate a command, but not display the output, then end the command with \ a semicolon. The output of the ", StyleBox["Plot", FontFamily->"Courier New"], " command is the word \"- Graphics -\". If you end a ", StyleBox["Plot", FontFamily->"Courier"], " command with a semicolon, it will not display the word \"- Graphics -\", \ but it will display the graph. The ", StyleBox["Input", FontSlant->"Italic"], " cell below has a semicolon after each command. Notice that it displays \ less output when you evaluate it. What should happen to the graph if you \ change the value of ", StyleBox["k", FontSlant->"Italic"], " in the following ", StyleBox["Input", FontSlant->"Italic"], " cell to a larger number? Try it and see if you get what you expected." }], "Text"], Cell[BoxData[{ \(\(k = 5;\)\), "\[IndentingNewLine]", \(\(Plot[t\^2\ Sin[k\ t], {t, \(-\[Pi]\), \[Pi]}];\)\)}], "Input"], Cell["\<\ You can temporarily substitute values for variables or for any pattern.\ \>", "Text"], Cell[BoxData[{ \(Clear[x, y, a]\), "\[IndentingNewLine]", \(\((x\^2 + 4 x\ y\^3)\) /. x \[Rule] a\^2\)}], "Input"], Cell[BoxData[{ \(Clear[x, y, a]\), "\[IndentingNewLine]", \(\((x\^2 + 4 x\ y\^3)\) /. {x \[Rule] a\^2, y \[Rule] a\^6}\)}], "Input"], Cell[TextData[{ "This does not permanently assign values to ", StyleBox["x", FontSlant->"Italic"], " or ", StyleBox["y", FontSlant->"Italic"], ". These values are only applied to the expressions above, not in future \ calculations involving ", StyleBox["x", FontSlant->"Italic"], " and ", StyleBox["y", FontSlant->"Italic"], ". The ", StyleBox["Solve", FontFamily->"Courier"], " command gives output in this format, so that you can substitute the \ solutions into other expressions." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Creating Your Own Functions", "Subsection"], Cell[TextData[{ "You can define your own functions in ", StyleBox["Mathematica", FontSlant->"Italic"], ". Here is an example showing the concentration of the product of a \ chemical reaction. If we start the function name with a lower case letter, \ it will not interfer with any of ", StyleBox["Mathematica", FontSlant->"Italic"], "'s built-in functions, which all start with capital letters." }], "Text"], Cell[BoxData[{ \(Clear[concentration, \ t]\), "\[IndentingNewLine]", \(concentration[ t_] = \(15 \((\ \[ExponentialE]\^\( .45\ t\) - 1)\)\)\/\(6\ \ \[ExponentialE]\^\( .45\ t\) - 5\)\)}], "Input"], Cell["\<\ The function's arguments on the left side of the assignment statement must be \ followed by an underscore. Those same variables on the right side should not \ be followed by underscores. You can evaluate the function at specific \ numerical values.\ \>", "Text"], Cell[BoxData[ \(concentration[ .5]\)], "Input"], Cell[TextData[{ "You can use the function in other ", StyleBox["Mathematica", FontSlant->"Italic"], " commands, such as" }], "Text"], Cell[BoxData[ \(Solve[concentration[t] \[Equal] 1, \ t]\)], "Input"], Cell["and here is its graph.", "Text"], Cell[BoxData[ \(\(Plot[concentration[t], {t, 0, 5}];\)\)], "Input"], Cell[TextData[{ "It looks like the concentration is approaching about 2.5. We can confirm \ this by taking the limit as ", StyleBox["t", FontSlant->"Italic"], " approaches \[Infinity]." }], "Text"], Cell[BoxData[ \(Limit[concentration[t], t \[Rule] \[Infinity]]\)], "Input"], Cell["The reaction rate is the derivative.", "Text"], Cell[BoxData[ \(\(concentration'\)[t]\)], "Input"], Cell["Initially, the reaction rate is", "Text"], Cell[BoxData[ \(\(concentration'\)[0]\)], "Input"], Cell[TextData[{ StyleBox["Exercise 1.3:", FontWeight->"Bold", FontColor->RGBColor[0, 0.500008, 0.250004]], " The height of a Haflinger horse is given by the logistic function, ", StyleBox["h", FontSlant->"Italic"], "(", StyleBox["t", FontSlant->"Italic"], ") = ", Cell[BoxData[ \(TraditionalForm\`59\/\(1 + .639\ \[ExponentialE]\^\(\(-1.248\)\ \ t\)\)\)]], ", ", StyleBox["t", FontSlant->"Italic"], " years after birth. Define this as a function in ", StyleBox["Mathematica", FontSlant->"Italic"], ". Find the height of this horse at birth. Find the adult height of the \ horse. Find the time at which the horse reaches half its adult height. At \ what time is the horse's growth rate at its maximum?" }], "Text", Background->GrayLevel[0.750011]], Cell[TextData[{ "The general logistic function is ", StyleBox["f", FontSlant->"Italic"], "(", StyleBox["t", FontSlant->"Italic"], ") = ", Cell[BoxData[ \(TraditionalForm\`a\/\(1 + \ b\ \[ExponentialE]\^\(\(-c\)\ t\)\)\)]], ". The height of a Burmese Mountain Dog at birth is 4 inches and its \ mature height is 24 inches. It reaches 95% of its mature height at one year \ old. Let's find a logistic function describing its height and then plot the \ function. We first define the general logistic function. " }], "Text"], Cell[BoxData[{ \(Clear[f, t, a, b, c]\), "\[IndentingNewLine]", \(f[t_] := a\/\(1 + b\ \[ExponentialE]\^\(\(-c\)\ t\)\)\)}], "Input"], Cell[TextData[{ "We have three data points, so we should be able to use Solve to find the \ values of ", StyleBox["a", FontSlant->"Italic"], ", ", StyleBox["b", FontSlant->"Italic"], ", and ", StyleBox["c", FontSlant->"Italic"], ". But first notice that the limiting value of f(t) is a, since ", Cell[BoxData[ \(TraditionalForm\`e\^\(\(-c\)\ t\)\)]], " approaches 0 as t approaches infinity. So, ", StyleBox["a", FontSlant->"Italic"], " must be 24 for our problem. We can either permanently assign ", StyleBox["a", FontSlant->"Italic"], " the value 24 with the command ", StyleBox["a", FontSlant->"Italic"], " = 24, or we can temporarily substitute 24 for ", StyleBox["a", FontSlant->"Italic"], " with f[t]/.a\[Rule]24. We will use the latter approach." }], "Text"], Cell[BoxData[ \(parameters = Solve[{a \[Equal] 24, f[0] \[Equal] 4, f[1] == .95*24}, \ {a, b, c}]\)], "Input"], Cell["\<\ and here is a graph with the parameters temporarily replaced by these values.\ \ \>", "Text"], Cell[BoxData[ \(\(Plot[f[t] /. parameters, {t, 0, 2}];\)\)], "Input"], Cell[TextData[{ "Notice the the original definition for ", StyleBox["f", FontSlant->"Italic"], " is unaltered, so that we can continue to work with the general logistic \ equation if we wish." }], "Text"], Cell[BoxData[ \(f[t]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Using Mathematical Notation in Your Input", "Subsection"], Cell[TextData[{ "You may have noticed that this ", StyleBox["Mathematica", FontSlant->"Italic"], " notebook uses some fancy mathematical notation. You can build up \ mathematical expressions using the palettes that are accessible under the \ File menu. Try going to File \[Rule] Palettes \[Rule] BasicInput. When \ you click on one of the buttons in the BasicInput palette, that item is \ inserted at the current location in your ", StyleBox["Mathematica", FontSlant->"Italic"], " notebook. " }], "Text"], Cell[TextData[{ StyleBox["Exercise 1.4:", FontWeight->"Bold", FontColor->RGBColor[0, 0.500008, 0.250004]], " ", "See if you can use the BasicInput palette to create the expression, ", Cell[BoxData[ \(TraditionalForm\`\[Integral]\(1\/\@\(x\^2 + 1\)\%4\) \ \[DifferentialD]x\)]], ", in a new Input cell. Then evaluate that cell to find the value of the \ integral. You will see that ", StyleBox["Mathematica", FontSlant->"Italic"], " can evaluate some pretty difficult integrals. If you are interested in \ learning more about hypergeometric functions, visit the MathWorld Web site at \ ", ButtonBox["http://mathworld.wolfram.com/GeneralizedHypergeometricFunction.\ html", ButtonData:>{ URL[ "http://mathworld.wolfram.com/GeneralizedHypergeometricFunction.html"], None}, ButtonStyle->"Hyperlink"], ", but be prepared for some heavy reading!" }], "Text", Background->GrayLevel[0.750011]], Cell["\<\ Explore the other palettes under the File menu to see the massive collection \ of symbols and mathematical forms that are available.\ \>", "Text"], Cell[TextData[{ "The BasicInput palette also shows some of the most commonly used \ mathematical symbols, such as \[Pi] and \[Infinity]. Many of these symbols \ can also be entered from the keyboard. For example, you can enter the \ infinity symbol by typing \[EscapeKey]-inf-\[EscapeKey]. The Greek letter, \ pi, is \[EscapeKey]-p-\[EscapeKey]. Most letters of the Greek alphabet are \ entered this way. For example, alpha is \[EscapeKey]-a-\[EscapeKey]. One of \ our most popular Greek letters in mathematics, theta, does not have a Roman \ equivalent. Fortunately, the Roman letter, q, does not have a Greek \ equivalent. So, ", StyleBox["Mathematica", FontSlant->"Italic"], " uses \[EscapeKey]-q-\[EscapeKey] for theta. The Symbol font also uses \ the q key for theta." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Exact and Approximate Arithmetic", "Subsection"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " uses exact arithmetic when your expressions involve only integers and \ special transcendental numbers, such as \[Pi] and e. ", StyleBox["Mathematica", FontSlant->"Italic"], " uses approximate arithmetic with floating point numbers when you include \ at least one decimal point in your expressions, or when you use the ", StyleBox["N[ ]", FontFamily->"Courier"], " command to get a numerical approximation. Notice the difference between" }], "Text"], Cell[BoxData[ \(Sin[\[Pi]\/12]\)], "Input"], Cell["and", "Text"], Cell[BoxData[ \(Sin[\[Pi]\/12. ]\)], "Input"], Cell[TextData[{ "You can also get a decimal approximation using the ", StyleBox["N[ ]", FontFamily->"Courier"], " command." }], "Text"], Cell[BoxData[ \(\@12\)], "Input"], Cell[BoxData[ \(N[\@12]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Extending ", StyleBox["Mathematica", FontSlant->"Italic"], "'s Capabilities with Packages" }], "Subsection"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " has built-in functions to deal with problems in calculus, linear algebra, \ differential equations, discrete mathematics, number theory, numerical \ analysis, statistics and other fields in the mathematical sciences. Wolfram \ Research and independent developers have created many hundreds of ", StyleBox["Mathematica", FontSlant->"Italic"], " packages to extend these built-in functions to cover a variety of \ specific applications. Some of these packages come with ", StyleBox["Mathematica", FontSlant->"Italic"], ". You can see these in the Help Browser under the ", ButtonBox["Add-ons", ButtonData:>{"Loading Packages", None}, ButtonStyle->"AddOnsLink", ButtonNote->None], " button. Additional packages are available on the Web at the ", Cell[BoxData[ FormBox[ ButtonBox[\(Mathematica\ Information\ Center\), ButtonData:>{ URL[ "http://library.wolfram.com/infocenter/MathSource/"], None}, ButtonStyle->"Hyperlink"], TraditionalForm]]], "." }], "Text"], Cell[TextData[{ "If you want to use a package, you must first load it into your ", StyleBox["Mathematica", FontSlant->"Italic"], " session. For example, suppose that you want to display a 3D graph and \ include a shadow of that graph on the ", StyleBox["xy", FontSlant->"Italic"], "-plane. ", StyleBox["Mathematica", FontSlant->"Italic"], " does not have a built-in function to draw the shadow. If you look in the \ Help Browser under Add-ons \[Rule] Standard Packages \[Rule] Graphics \[Rule] \ Graphics3D, you will see that there is a function called ShadowPlot3D. Here \ are the two commands that you need to load the package and evaluate the \ ShadowPlot3D command." }], "Text"], Cell[BoxData[{ \(Needs["\"]\), "\[IndentingNewLine]", \(\(ShadowPlot3D[ Cos[\@\(x\^2 + y\^2 + 1\)], \ {x, \(-4\) \[Pi], 4 \[Pi]}, {y, \(-4\) \[Pi], 4 \[Pi]}, PlotPoints \[Rule] 30];\)\)}], "Input"], Cell["\<\ Graphics`Colors` is a package that is commonly used with graphs. It allows \ you to specify colors using English language names instead of having to use \ numerical values for the red, green, and blue (RGB) components of the colors. \ For example, the RGB values for ForestGreen are\ \>", "Text"], Cell[BoxData[{ \(Needs["\"]\), "\[IndentingNewLine]", \(ForestGreen\)}], "Input"], Cell["\<\ and here are two ways to display a circle filled with ForestGreen.\ \>", "Text"], Cell[BoxData[{ \(\(Show[Graphics[{ForestGreen, Disk[{0, 0}, 2]}], AspectRatio \[Rule] Automatic];\)\), "\[IndentingNewLine]", \(\(Show[ Graphics[{RGBColor[0.133305, 0.545106, 0.133305], Disk[{0, 0}, 2]}], AspectRatio \[Rule] Automatic];\)\)}], "Input"], Cell[TextData[{ "Look in the Help browser to see the other colors that are available in \ Graphics`Colors`. You can also create your own colors using ", StyleBox["RGBColor", FontFamily->"Courier"], "[", StyleBox["r", FontSlant->"Italic"], ", ", StyleBox["g", FontSlant->"Italic"], ", ", StyleBox["b", FontSlant->"Italic"], "], where ", StyleBox["r", FontSlant->"Italic"], " is the amount of red between 0 to 1, ", StyleBox["g", FontSlant->"Italic"], " is the amount of green between 0 and 1, and ", StyleBox["b", FontSlant->"Italic"], " is the amount of blue between 0 and 1." }], "Text"], Cell[TextData[{ StyleBox["Exercise 1.5:", FontWeight->"Bold", FontColor->RGBColor[0, 0.500008, 0.250004]], " Use the Graphics`ImplicitPlot package to plot a graph of ", Cell[BoxData[ \(TraditionalForm\`x\^4 + y\^4 = x\^2 - y\^2\)]], " for -1 \[LessEqual] ", StyleBox["x", FontSlant->"Italic"], " \[LessEqual] 1. You will need to look in the Help Browser to determine \ how to use the ImplicitPlot function." }], "Text", Background->GrayLevel[0.750011]], Cell[TextData[{ StyleBox["Exercise 1.6:", FontWeight->"Bold", FontColor->RGBColor[0, 0.500008, 0.250004]], " Use the Graphics`Polyhedra package to display a stellated icosahedron." }], "Text", Background->GrayLevel[0.750011]], Cell[TextData[{ StyleBox["Exercise 1.7:", FontWeight->"Bold", FontColor->RGBColor[0, 0.500008, 0.250004]], " Find a package related to your interests. Peruse the packages bundled \ with ", StyleBox["Mathematica", FontSlant->"Italic"], " in the Add-ons section of the Help Browser, and the user-contributed \ packages at ", StyleBox["MathSource. ", FontSlant->"Italic"], "Describe some of this package's capabilities that seem interesting to \ you." }], "Text", Background->GrayLevel[0.750011]] }, Closed]], Cell[CellGroupData[{ Cell["Managing Variables", "Subsection"], Cell["When you assign a value to a variable, such as", "Text"], Cell[BoxData[ \(x = 2.7\)], "Input"], Cell[TextData[{ "the variable will retain that value until you (1) assign a new value to ", StyleBox["x", FontSlant->"Italic"], ", (2) quit the Kernel, or (3) clear the value of the variable using the ", StyleBox["Clear[ ]", FontFamily->"Courier"], " command. Now that ", StyleBox["x", FontSlant->"Italic"], " has the value 2.7, we cannot solve for ", StyleBox["x", FontSlant->"Italic"], " in an equation" }], "Text"], Cell[BoxData[ \(Solve[x\^4 - x \[Equal] 5, x]\)], "Input"], Cell[TextData[{ "We have a similar problem if we use ", StyleBox["x", FontSlant->"Italic"], " as an independent variable in a function definition." }], "Text"], Cell[BoxData[ \(f[x_] = ArcTan[x]\)], "Input"], Cell[TextData[{ "Here is the value of ", StyleBox["f", FontSlant->"Italic"], " at ", StyleBox["x", FontSlant->"Italic"], " = -2, -1.8, -1.6, -1.4, ..., 1.6, 1.8, 2." }], "Text"], Cell[BoxData[ \(Table[f[x], {x, \(-2.0\), 2.0, 0.2}]\)], "Input"], Cell["Hmmm, that was not what we intended.", "Text"], Cell[TextData[{ "But if we clear the value of ", StyleBox["x", FontSlant->"Italic"], " first, then we can solve for ", StyleBox["x", FontSlant->"Italic"], "." }], "Text"], Cell[BoxData[{ \(Clear[x]\), "\[IndentingNewLine]", \(Solve[x\^4 - x \[Equal] 5, x]\)}], "Input"], Cell[TextData[{ "and now if we define our function, it will act as we expected. We are \ going to clear the value of ", StyleBox["f", FontSlant->"Italic"], ", too, so that we will be certain to wipe out the previous definition." }], "Text"], Cell[BoxData[{ \(Clear[x, f]\), "\[IndentingNewLine]", \(f[x_] = ArcTan[x]\)}], "Input"], Cell[BoxData[ \(Table[f[x], {x, \(-2.0\), 2.0, 0.2}]\)], "Input"], Cell["\<\ That's better! When in doubt, clear the variable that you will be \ using. If you create a real mess, you can always quit the kernel under the \ Kernel menu and start all over gain. If you quit the kernel, you will also \ lose the values of all of the other variables that you defined and the \ history of your command input and output.\ \>", "Text"] }, Closed]] }, Open ]] }, FrontEndVersion->"5.2 for Microsoft Windows", ScreenRectangle->{{0, 1280}, {0, 951}}, WindowSize->{1074, 924}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, StyleDefinitions -> "PastelColor.nb" ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 101, 4, 98, "Title"], Cell[CellGroupData[{ Cell[1902, 61, 122, 5, 39, "Subsection"], Cell[2027, 68, 1041, 29, 92, "Text"], Cell[3071, 99, 857, 32, 50, "Text"], Cell[3931, 133, 125, 3, 53, "Input"], Cell[4059, 138, 1660, 47, 113, "Text"], Cell[5722, 187, 944, 22, 92, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6703, 214, 34, 0, 39, "Subsection"], Cell[6740, 216, 2195, 65, 176, "Text"], Cell[8938, 283, 374, 6, 50, "Text"], Cell[9315, 291, 49, 1, 38, "Input"], Cell[9367, 294, 922, 23, 71, "Text"], Cell[10292, 319, 385, 11, 29, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[10714, 335, 121, 5, 25, "Subsection"], Cell[10838, 342, 678, 16, 71, "Text"], Cell[11519, 360, 50, 1, 39, "Input"], Cell[11572, 363, 448, 10, 50, "Text"], Cell[12023, 375, 139, 3, 50, "Input"], Cell[12165, 380, 281, 9, 35, "Text"], Cell[12449, 391, 271, 9, 35, "Text"], Cell[12723, 402, 268, 5, 50, "Text"], Cell[12994, 409, 64, 1, 38, "Input"], Cell[13061, 412, 90, 2, 29, "Text"], Cell[13154, 416, 119, 2, 59, "Input"], Cell[13276, 420, 1118, 31, 92, "Text"], Cell[14397, 453, 129, 2, 59, "Input"], Cell[14529, 457, 95, 2, 29, "Text"], Cell[14627, 461, 124, 2, 59, "Input"], Cell[14754, 465, 142, 2, 59, "Input"], Cell[14899, 469, 539, 19, 50, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[15475, 493, 49, 0, 25, "Subsection"], Cell[15527, 495, 426, 10, 50, "Text"], Cell[15956, 507, 213, 4, 75, "Input"], Cell[16172, 513, 274, 5, 50, "Text"], Cell[16449, 520, 51, 1, 38, "Input"], Cell[16503, 523, 142, 5, 29, "Text"], Cell[16648, 530, 72, 1, 38, "Input"], Cell[16723, 533, 38, 0, 29, "Text"], Cell[16764, 535, 71, 1, 38, "Input"], Cell[16838, 538, 208, 6, 29, "Text"], Cell[17049, 546, 79, 1, 38, "Input"], Cell[17131, 549, 52, 0, 29, "Text"], Cell[17186, 551, 54, 1, 38, "Input"], Cell[17243, 554, 47, 0, 29, "Text"], Cell[17293, 556, 54, 1, 38, "Input"], Cell[17350, 559, 808, 24, 59, "Text"], Cell[18161, 585, 553, 14, 53, "Text"], Cell[18717, 601, 142, 2, 70, "Input"], Cell[18862, 605, 837, 27, 50, "Text"], Cell[19702, 634, 133, 3, 38, "Input"], Cell[19838, 639, 103, 3, 29, "Text"], Cell[19944, 644, 73, 1, 38, "Input"], Cell[20020, 647, 214, 6, 29, "Text"], Cell[20237, 655, 37, 1, 38, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[20311, 661, 63, 0, 25, "Subsection"], Cell[20377, 663, 528, 12, 50, "Text"], Cell[20908, 677, 953, 25, 88, "Text"], Cell[21864, 704, 156, 3, 29, "Text"], Cell[22023, 709, 804, 14, 92, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[22864, 728, 54, 0, 25, "Subsection"], Cell[22921, 730, 539, 12, 50, "Text"], Cell[23463, 744, 47, 1, 48, "Input"], Cell[23513, 747, 19, 0, 29, "Text"], Cell[23535, 749, 49, 1, 48, "Input"], Cell[23587, 752, 146, 5, 29, "Text"], Cell[23736, 759, 37, 1, 40, "Input"], Cell[23776, 762, 40, 1, 41, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[23853, 768, 135, 5, 25, "Subsection"], Cell[23991, 775, 1114, 26, 71, "Text"], Cell[25108, 803, 712, 16, 71, "Text"], Cell[25823, 821, 259, 5, 62, "Input"], Cell[26085, 828, 308, 5, 50, "Text"], Cell[26396, 835, 109, 2, 58, "Input"], Cell[26508, 839, 90, 2, 29, "Text"], Cell[26601, 843, 287, 5, 58, "Input"], Cell[26891, 850, 648, 24, 50, "Text"], Cell[27542, 876, 486, 13, 35, "Text"], Cell[28031, 891, 240, 6, 35, "Text"], Cell[28274, 899, 526, 15, 56, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[28837, 919, 40, 0, 25, "Subsection"], Cell[28880, 921, 62, 0, 29, "Text"], Cell[28945, 923, 40, 1, 38, "Input"], Cell[28988, 926, 452, 14, 50, "Text"], Cell[29443, 942, 62, 1, 39, "Input"], Cell[29508, 945, 169, 5, 29, "Text"], Cell[29680, 952, 50, 1, 38, "Input"], Cell[29733, 955, 195, 8, 29, "Text"], Cell[29931, 965, 69, 1, 38, "Input"], Cell[30003, 968, 52, 0, 29, "Text"], Cell[30058, 970, 188, 8, 29, "Text"], Cell[30249, 980, 106, 2, 59, "Input"], Cell[30358, 984, 251, 6, 29, "Text"], Cell[30612, 992, 97, 2, 58, "Input"], Cell[30712, 996, 69, 1, 38, "Input"], Cell[30784, 999, 363, 6, 50, "Text"] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)