(************** 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[ 4958, 167]*) (*NotebookOutlinePosition[ 5650, 191]*) (* CellTagsIndexPosition[ 5606, 187]*) (*WindowFrame->Normal*) Notebook[{ Cell["Programming Hints #1", "Title"], Cell[TextData[StyleBox["Below are some simple programming hints that will be \ of great help to you throughout this class. \n", FontVariations->{"CompatibilityType"->0}]], "Subsubtitle"], Cell[CellGroupData[{ Cell["Functions vs. Expressions", "Section", FontColor->GrayLevel[0]], Cell[TextData[{ "Functions are names; expressions are values.\n1. ", StyleBox["Sin", FontSlant->"Italic"], " is a function; ", StyleBox["Sin(x)", FontSlant->"Italic"], " is an expression.\n2. ", Cell[BoxData[ \(TraditionalForm\`x\^2\)]], " is an expression, not a function.\n3. ", StyleBox[" f(x) = ", FontSlant->"Italic"], Cell[BoxData[ \(TraditionalForm\`x\^2\)], FontSlant->"Italic"], " -- ", StyleBox["f", FontSlant->"Italic"], " ", "is a function", "\nBe sure that you understand the difference between a function and an \ expression. ", StyleBox["Mathematica", FontSlant->"Italic"], " is very picky about this distinction." }], "Subsubsection"] }, Open ]], Cell[CellGroupData[{ Cell["Dummy Variables and Plot", "Section", FontColor->GrayLevel[0]], Cell[BoxData[ \(Plot[ f[x], {x, a, b}]\ \ works\ by\ substituting\ constant\ values\ between\ a\ and\ \ b\ for\ \(\(x\)\(.\)\)\)], "Input"], Cell[BoxData[ \(Plot[ D[f[x], x], {x, a, b}]\ \ will\ fail\ \(\(because\)\(:\)\)\)], "Input"], Cell[TextData[{ "\ta. ", StyleBox["Plot", FontSlant->"Italic"], " substitutes constant values for ", StyleBox["x", FontSlant->"Italic"], " BEFORE computing the derivative of ", StyleBox["f", FontSlant->"Italic"], ".\n\tb. ", StyleBox["D", FontSlant->"Italic"], " cannot compute the derivative with respect to a constant.\n\tc. The \ solution is to use a dummy variable in place of ", StyleBox["x ", FontSlant->"Italic"], "in order to compute the derivative before substitutiing values for", StyleBox[" x", FontSlant->"Italic"] }], "Text"], Cell[BoxData[ RowBox[{\(Plot[D[f[t], t] /. t \[Rule] x, {x, a, b}]\ \ --\), " ", "here", " ", StyleBox["t", FontSlant->"Italic"], " ", "is", " ", "a", " ", "dummy", " ", \(\(variable\)\(.\)\)}]], "Input"], Cell["\<\ \td. Dummy variable appear elsewhere in mathematics -- for example in \ integration.\ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{\(\[Integral]\_0\%1\( x\^2\) \[DifferentialD]x\), "\[Equal]", RowBox[{\(1/\(3\ --\)\), " ", "here", " ", StyleBox["x", FontSlant->"Italic"], " ", "is", " ", "a", " ", "dummy", " ", "variable"}]}], ",", \(just\ a\ placeholder\ not\ appearing\ in\ the\ final\ \(\(result\ \)\(.\)\)\)}]], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Clear Function Names in the Same Cell BEFORE the Definition of Each \ Function\ \>", "Section", FontColor->GrayLevel[0]], Cell["\<\ Altering the definition of a function does NOT erase the old definition. 1. To avoid confusion, clear the function name in the same cell as the \ function definition, just before the definition. 2. PROGRAM DEFENSIVELY.\ \>", "Subsubsection"] }, Open ]] }, FrontEndVersion->"5.2 for Macintosh", ScreenRectangle->{{0, 1024}, {0, 742}}, WindowSize->{1267, 795}, WindowMargins->{{6, Automatic}, {Automatic, 0}}, Magnification->1.5, StyleDefinitions -> "Classroom.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[1754, 51, 37, 0, 93, "Title"], Cell[1794, 53, 188, 2, 106, "Subsubtitle"], Cell[CellGroupData[{ Cell[2007, 59, 71, 1, 93, "Section"], Cell[2081, 62, 724, 26, 200, "Subsubsection"] }, Open ]], Cell[CellGroupData[{ Cell[2842, 93, 70, 1, 93, "Section"], Cell[2915, 96, 162, 4, 69, "Input"], Cell[3080, 102, 105, 2, 69, "Input"], Cell[3188, 106, 590, 20, 117, "Text"], Cell[3781, 128, 237, 5, 69, "Input"], Cell[4021, 135, 109, 3, 41, "Text"], Cell[4133, 140, 385, 8, 118, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[4555, 153, 132, 4, 93, "Section"], Cell[4690, 159, 252, 5, 132, "Subsubsection"] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)