(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. 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[ 29851, 949]*) (*NotebookOutlinePosition[ 30595, 975]*) (* CellTagsIndexPosition[ 30551, 971]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["First-Order Differential Equations and Slope Fields", "Title", PageWidth->PaperWidth], Cell[TextData[StyleBox["Chapter 6, Section 4 (Chapter 5, Section 4 in Early \ Transcendentals)", FontFamily->"Arial", FontSize->16, FontWeight->"Bold"]], "Text", PageWidth->PaperWidth], Cell[BoxData[{ \(\(Off[General::spell1]; \)\), \(\[IndentingNewLine]\), \(\(Off[General::spell]; \)\), \(\[IndentingNewLine]\), \(\(slopefield[f_, x_, y_, xmin_, xmax_, ymin_, ymax_, initcond_: Automatic] := Block[{xloc, yloc, floc, h, k, segs}, \[IndentingNewLine]If[initcond === Automatic, flag = 1, flag = 0]; \[IndentingNewLine]floc[xloc_, yloc_] = f /. {x \[Rule] xloc, y \[Rule] yloc}; \[IndentingNewLine]icloc = initcond /. y \[Rule] u; \[IndentingNewLine]h = \((xmax - xmin)\)/16; \[IndentingNewLine]k = \((ymax - ymin)\)/16; \[IndentingNewLine]segs = Table[Line[ If[\((Denominator[floc[xloc, yloc]] /. { xloc \[Rule] xmin + i*h, yloc \[Rule] ymin + j*k})\) \[NotEqual] 0, {{xmin + \((i - 3/ \((10*\@\(1 + floc[xmin + i*h, ymin + j*k]^2\)) \))\)*h, ymin + j*k - floc[xmin + i*h, ymin + j*k]*3 h/ \((10*\@\(1 + floc[xmin + i*h, ymin + j*k]^2\)) \)}, {xmin + \((i + 3/ \((10*\@\(1 + floc[xmin + i*h, ymin + j*k]^2\)) \))\)*h, ymin + j*k + floc[xmin + i*h, ymin + j*k]*3 h/ \((10*\@\(1 + floc[xmin + i*h, ymin + j*k]^2\)) \)}}, {{xmin + i*h, ymin + \((j - 3/10)\)*k}, { xmin + i*h, ymin + \((j + 3/10)\)*k}}]], {i, 0, 16}, {j, 1, 16}]; \[IndentingNewLine]If[flag \[NotEqual] 1, soln = Table[ \(NDSolve[{\(u'\)[xloc] \[Equal] floc[xloc, u[xloc]], icloc[\([i]\)]}, u[xloc], {xloc, xmin, xmax}]\)[ \([1, 1, 2]\)], {i, 1, Length[icloc]}]; \[IndentingNewLine]\(g2 = Plot[Evaluate[soln], {xloc, xmin, xmax}, PlotStyle \[Rule] {{Thickness[0.008], RGBColor[0.500008, \ 0, \ 0.500008]}}, DisplayFunction \[Rule] Identity]; \)]; \[IndentingNewLine]g1 = Graphics[{RGBColor[0, 0, 1], Thickness[0.005], segs}]; \[IndentingNewLine]If[flag \[NotEqual] 1, \(Show[{g1, g2}, PlotRange \[Rule] {{xmin, xmax}, {ymin, ymax}}, Axes \[Rule] True, AxesLabel \[Rule] {x, y}, ImageSize \[Rule] {72*7, 72*5}, AspectRatio \[Rule] 1, DisplayFunction \[Rule] $DisplayFunction]; \), \(Show[{g1}, PlotRange \[Rule] {{xmin, xmax}, {ymin, ymax}}, Axes \[Rule] True, AxesLabel \[Rule] {x, y}, ImageSize \[Rule] {72*7, 72*5}, AspectRatio \[Rule] 1, DisplayFunction \[Rule] $DisplayFunction]; \)]]; \)\)}], "Input", Editable->False, CellOpen->False, InitializationCell->True], Cell[CellGroupData[{ Cell["Introduction", "Section", PageWidth->PaperWidth], Cell["\<\ OBJECTIVE: Visualize the slope fields and solution curves for selected \ first-order differential equations.\ \>", "Text", PageWidth->PaperWidth], Cell["\<\ This module contains a special command that plots slope fields and selected \ solution curves for first-order differential equations. You can use it to \ obtain solutions for related problems in the text. In addition, you can use \ the slope field command to study a wide variety of first-order differential \ equations and to analyze the long-term behavior of solutions.\ \>", "Text", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell["Technology Guidelines", "Subsection", PageWidth->PaperWidth, CellDingbat->"\[LightBulb]"], Cell[TextData[{ StyleBox["NOTE: If you have just finished a module, restart ", CellFrame->True, Background->None], StyleBox["Mathematica", CellFrame->True, FontSlant->"Italic", Background->None], StyleBox[" before executing a new module.\nTO OPEN CELLS, put your cursor \ on the right cell bracket and double click.", CellFrame->True, Background->None], "\nINITIALIZATION CELLS\n\tWhen asked if you want to \". . . automatically \ evaluate all the initialization cells in the \tnotebook . . . ,\" respond by \ pressing the \"Yes\" button.\nTO STOP AN EXECUTION\n\tSelect the ", StyleBox["Kernel", FontSlant->"Italic"], " pull-down menu and click on ", StyleBox["Abort Evaluation.\n", FontSlant->"Italic"], "ORDER OF EXECUTION\n\tExecute cells in the order given. Do not skip any \ Input cells within a given notebook.\nSAVING NOTEBOOKS\n\tYou can save \ anytime to any directory you choose, and it is wise to save often.\n\t\ However, before you do your final save, delete all your output by selecting \ the \n\t ", StyleBox["Delete All Output", FontSlant->"Italic"], " selection under the ", StyleBox["Kernel", FontSlant->"Italic"], " pull-down menu.\nEXPERIENCING MAJOR PROBLEMS\n\tSave if appropriate, and \ then shut down ", StyleBox["Mathematica", FontSlant->"Italic"], " and start it up again." }], "Text", PageWidth->PaperWidth] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Part I - Drawing Slope Fields and Solution Curves", "Section", PageWidth->PaperWidth], Cell[TextData[{ "The ", StyleBox["slopefield[f_, x_, y_, xmin_, xmax_, ymin_, ymax_, \ initconditions_(optional)]", FontWeight->"Bold"], " command in the next cell generates a slope field and draws selected \ solution curves for first-order differential equations of the form ", Cell[BoxData[ FormBox[ StyleBox[\(dy\/dx = f(x, y)\), FontSlant->"Italic"], TraditionalForm]]], ". The arguments of the command are ", StyleBox["f ", FontWeight->"Bold"], "(the right-hand side function), ", Cell[BoxData[ \(TraditionalForm\`f(x, y)\)]], ", ", StyleBox["x", FontWeight->"Bold"], StyleBox[" ", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["(", FontWeight->"Bold"], "the independent variable), ", StyleBox["y", FontWeight->"Bold"], StyleBox[" ", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["(", FontWeight->"Bold"], "the unknown function), ", StyleBox["xmin", FontWeight->"Bold"], ", ", StyleBox["xmax", FontWeight->"Bold"], ", ", StyleBox["ymin", FontWeight->"Bold"], ", and ", StyleBox["ymax ", FontWeight->"Bold"], "(the bounds on the slope field), and ", StyleBox["initconditions", FontWeight->"Bold"], " (an optional list of initial conditions). If the list of conditions is \ not included, only the slope field is drawn. Here's how it works for the \ differential equation ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", \(\(\(x\)\(\ \)\)\/y\)}], TraditionalForm]]], ". First, we plot only the slope field." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ \(Clear[x, y, f]\), "\n", \(f = x\/y\), "\n", \(\(slopefield[f, x, y, \(-4\), 4, \(-4\), 4];\)\)}], "Input", PageWidth->PaperWidth], Cell["\<\ Now we include a list of initial conditions to obtain some solution curves. \ Each of the four initial conditions will usually give a different solution \ curve.\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ \(\(slopefield[f, x, y, \(-4\), 4, \(-4\), 4, {y[0] \[Equal] 2, y[1] \[Equal] 1, y[1] \[Equal] \(-1\), y[0] \[Equal] \(-2\)}];\)\)], "Input", PageWidth->PaperWidth], Cell[TextData[{ "There is a good likelihood that you will get error messages for some \ initial conditions. For example, the solution curve that passes through the \ point ", Cell[BoxData[ \(TraditionalForm\`\((1, 1/2)\)\)]], " cannot be expressed as a function when ", StyleBox["y ", FontSlant->"Italic"], "is a function of ", StyleBox["x", FontSlant->"Italic"], ". Here's what happens." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ \(\(slopefield[x/y, x, y, \(-4\), 4, \(-4\), 4, {y[1] \[Equal] 1/2}];\)\)], "Input", PageWidth->PaperWidth], Cell["\<\ When this happens, it is probably better to hand sketch some representative \ solution curves on the slope field.\ \>", "Text", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["You Try It: Part I", "Section", PageWidth->PaperWidth], Cell[TextData[{ "It's fun! Make up some of your own differential equations of the form ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", \(f(x, y)\)}], TraditionalForm]]], ", and see what kind of patterns you can generate. Can you form a \ differential equation that will give solution curves that are ellipses? \ hyperbolas? Just try it by changing the function of ", StyleBox["x", FontSlant->"Italic"], " and ", StyleBox["y", FontSlant->"Italic"], " in red." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{\(Clear[x, y, f]\), "\n", RowBox[{"f", "=", StyleBox[\(x\/y\), FontColor->RGBColor[1, 0, 0]]}], "\n", \(slopefield[f, x, y, \(-4\), 4, \(-4\), 4];\)}], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Part II: Antiderivatives", "Section", PageWidth->PaperWidth], Cell[TextData[{ "If we consider differential equations of the form ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", \(f(x)\)}], TraditionalForm]]], ", then the solutions for ", StyleBox["y", FontSlant->"Italic"], " as a function of ", StyleBox["x ", FontSlant->"Italic"], "are simply the antiderivatives of ", Cell[BoxData[ \(TraditionalForm\`f(x)\)]], "; that is, ", Cell[BoxData[ \(TraditionalForm\`y = \[Integral]\(f(x)\) \[DifferentialD]x\)]], ". Let's look at some slope fields and solution curves for differential \ equations of this kind." }], "Text", PageWidth->PaperWidth], Cell[BoxData[ FormBox[ RowBox[{"First", " ", "we", " ", "consider", " ", RowBox[{ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", "x"}], "TraditionalForm"], "."}]}], TextForm]], "Text", PageWidth->PaperWidth], Cell[BoxData[{ \(Clear[f, x, y]\), "\n", \(\(f = x;\)\), "\n", \(\(slopefield[f, x, y, \(-4\), 4, \(-4\), 4, {y[0] \[Equal] \(-2\), y[0] \[Equal] 0, y[0] \[Equal] 2}];\)\)}], "Input", PageWidth->PaperWidth], Cell[TextData[{ "Notice that the slopes in the field above are constant along any vertical \ line. This shows graphically that the derivative of ", StyleBox["y", FontSlant->"Italic"], " with respect to ", StyleBox["x", FontSlant->"Italic"], " is not a function of ", StyleBox["y", FontSlant->"Italic"], ", as reflected in the differential equation ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", "x"}], TraditionalForm]]], ". Along any horizontal line, however, the slopes vary with ", StyleBox["x", FontSlant->"Italic"], ", ", "and the pattern shown in the slope field above is consistent with the \ differential equation ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", "x"}], TraditionalForm]]], ". The slopes are negative when ", StyleBox["x", FontSlant->"Italic"], " is negative, positive when ", StyleBox["x", FontSlant->"Italic"], " is positive, and zero when ", StyleBox["x", FontSlant->"Italic"], " is zero.\n\nLet's try a periodic function, ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", \(cos\ x\)}], TraditionalForm]]], ". " }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ \(\(f = Cos[x];\)\), "\n", \(\(slopefield[f, x, y, \(-Pi\), Pi, \(-Pi\), Pi, {y[0] \[Equal] \(-2\), y[0] \[Equal] 0, y[0] \[Equal] 2}];\)\)}], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["You Try It: Part II", "Section", PageWidth->PaperWidth], Cell[TextData[{ "Use the slope field command to study some antiderivative problems of the \ form ", Cell[BoxData[ FormBox[ RowBox[{ StyleBox[\(dy\/dx\), FontSlant->"Italic"], StyleBox["=", FontSlant->"Plain"], StyleBox[\(f(x)\), FontSlant->"Italic"]}], TraditionalForm]]], " where you pick the function ", Cell[BoxData[ \(TraditionalForm\`f(x)\)]], " (in red) and the initial conditions (in red). Don't forget to use the \ double-equals (", Cell[BoxData[ \(TraditionalForm\` == \)]], ") if you add initial conditions." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{\(Clear[x, y, f]\), "\n", RowBox[{ RowBox[{"f", "=", StyleBox[\(Exp[x]\), FontColor->RGBColor[1, 0, 0]]}], ";", "\n", RowBox[{"slopefield", "[", RowBox[{ "f", ",", "x", ",", "y", ",", \(-4\), ",", "4", ",", \(-4\), ",", "4", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"y", "[", StyleBox["0", FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox[\(-3\), FontColor->RGBColor[1, 0, 0]]}], ",", RowBox[{ RowBox[{"y", "[", StyleBox["0", FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox["0", FontColor->RGBColor[1, 0, 0]]}], ",", RowBox[{ RowBox[{"y", "[", StyleBox["0", FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox["2", FontColor->RGBColor[1, 0, 0]]}]}], "}"}]}], "]"}], ";"}]}], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Part III: Autonomous Differential Equations", "Section", PageWidth->PaperWidth], Cell[TextData[{ "Differential equations of the form ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", " ", \(f(y)\)}], TraditionalForm]]], " are called autonomous differential equations. Let's look at the \ autonomous differential equation ", Cell[BoxData[ FormBox[ RowBox[{ StyleBox[\(dy\/dx\), FontSlant->"Italic"], StyleBox["=", FontSlant->"Plain"], StyleBox["y", FontSlant->"Italic"]}], TraditionalForm]]], ". Despite its simplicity, this is surely the most famous of all \ first-order, autonomous differential equations. Let's draw the slope field \ and some solution curves." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ \(Clear[f, x, y]\), "\n", \(\(f = y;\)\), "\n", \(\(slopefield[f, x, y, \(-3\), 3, \(-8\), 8, {y[0] \[Equal] \(-2\), y[0] \[Equal] 0, y[0] \[Equal] 2}];\)\)}], "Input", PageWidth->PaperWidth], Cell[TextData[{ "Note that in the slope fields for ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", "y"}], TraditionalForm]]], ", the slopes are constant along any horizontal line and vary linearly \ along any vertical line. This is the reverse of what we observed for the \ antiderivative problem of the form ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", "x"}], TraditionalForm]]], ".\n\nThe logistic equation is another interesting autonomous first-order \ differential equation. Let's draw a slope field and some solution curves for \ a specific one, say ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dP", FontSlant->"Italic"], StyleBox["dt", FontSlant->"Italic"]], "=", \(P(1 - P)\)}], TraditionalForm]]], ". The ", StyleBox["slopefield", FontWeight->"Bold"], " command will generate some error messages because two of the solution \ curves go off to infinity and have vertical asymptotes. However, the solution \ curves as drawn are okay." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ \(Clear[f, t, P]\), "\n", \(\(f = P\ \((1 - P)\);\)\), "\n", \(\(slopefield[f, t, P, \(-5\), 5, \(-1\), 2, {P[0] \[Equal] \(-0.005\), P[0] \[Equal] 0. , P[0] \[Equal] 0.25, P[0] \[Equal] 0.5, P[0] \[Equal] 0.75, P[0] \[Equal] 1.0, P[0] \[Equal] 1.005}];\)\)}], "Input", PageWidth->PaperWidth], Cell[TextData[{ "The long-term behavior of the solution to the logistic equation depends \ upon the initial condition. The slope field graph shown above suggests the \ following: ", Cell[BoxData[ \(TraditionalForm\`\(\(\(lim\)\(\ \)\)\+\(t \[Rule] \[Infinity]\)\) \(P( t)\) = \(-\[Infinity]\)\)]], " when ", Cell[BoxData[ \(TraditionalForm\`P(0) < 0\)]], "; ", Cell[BoxData[ \(TraditionalForm\`P(t) = 0\)]], " for all values of ", StyleBox["t ", FontSlant->"Italic"], "when ", Cell[BoxData[ \(TraditionalForm\`P(0) = 0\)]], "; and, ", Cell[BoxData[ \(TraditionalForm\`\(\(\ \)\(\(\(\(lim\)\(\ \)\)\+\(t \[Rule] \ \[Infinity]\)\) \(P(t)\) = 1\)\)\)]], " when ", Cell[BoxData[ \(TraditionalForm\`P(0) > 0\)]], "." }], "Text", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["You Try It: Part III", "Section", PageWidth->PaperWidth], Cell[TextData[{ "The logistic equation has another interesting autonomous form. Let's draw \ a slope field and some solution curves for \n\n", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dP", FontSlant->"Italic"], StyleBox["dt", FontSlant->"Italic"]], "=", \(\(-\(P(1 - P)\)\) \((2 - P)\)\)}], TraditionalForm]]], ". \n\nThe ", StyleBox["slopefield", FontWeight->"Bold"], " command will generate some error messages. See if you can determine why \ this is so after you see the plot. The solution curves are drawn okay." }], "Text", PageWidth->PaperWidth], Cell[BoxData[{ \(Clear[f, t, P]\), "\n", \(\(f = \(-P\)\ \((1 - P)\) \((2 - P)\);\)\), "\n", \(\(slopefield[f, t, P, \(-4\), 5, \(-2\), 5, {P[0] \[Equal] \(-0.005\), P[0] \[Equal] .3, P[0] \[Equal] 0. .7, P[0] \[Equal] 0.5, P[0] \[Equal] 1.3, P[0] \[Equal] 1.7, P[0] \[Equal] 2.3}];\)\)}], "Input", PageWidth->PaperWidth], Cell["\<\ Some solutions approach 2 and some approach 0. What is the dividing line \ between these sets of solutions? What has caused this to happen? Look up the concepts of a threshold population size and a carrying capacity. \ See how those concepts apply here.\ \>", "Text", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["You Try It: General", "Section", PageWidth->PaperWidth], Cell[TextData[{ "Consider some nonautonomous differential equations of the form ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", \(f(x, y)\)}], TraditionalForm]]], ". In this section we will start with the ", StyleBox["slopefield[ ] ", FontWeight->"Bold"], "command to plot the slope fields, and we will ask you to sketch some \ representative solution curves. Here are a few examples. See if you can \ predict what the solution curves will look like by looking at the direction \ fields. Describe the long-term behavior of the solutions for all possible \ initial values of ", Cell[BoxData[ \(TraditionalForm\`\(\(y(0)\)\(.\)\)\)]] }], "Text", PageWidth->PaperWidth], Cell[CellGroupData[{ Cell[TextData[{ "Solve ", Cell[BoxData[ FormBox[ StyleBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", \(-\(x\/y\)\)}], FontSize->16], TraditionalForm]]] }], "Subsection", PageWidth->PaperWidth], Cell[BoxData[{ \(\(f = \(-x\)/y;\)\), "\n", \(\(slopefield[f, x, y, \(-4\), 4, \(-4\), 4];\)\)}], "Input", PageWidth->PaperWidth], Cell["\<\ Change the terms in red to whatever you wish. Remember to use the \ double-equal sign if you add more initial states. You can expect to get error \ messages with this. Why might you predict that?\ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{ RowBox[{"slopefield", "[", RowBox[{ "f", ",", "x", ",", "y", ",", \(-4\), ",", "4", ",", \(-4\), ",", "4", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"y", "[", StyleBox["0", FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox[\(-1\), FontColor->RGBColor[1, 0, 0]]}], ",", RowBox[{ RowBox[{"y", "[", StyleBox["0", FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox["3", FontColor->RGBColor[1, 0, 0]]}]}], "}"}]}], "]"}], ";"}]], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Solve ", Cell[BoxData[ FormBox[ StyleBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", \(-\(y\/x\)\)}], FontSize->16], TraditionalForm]]] }], "Subsection", PageWidth->PaperWidth], Cell[BoxData[{ \(\(f = \(-y\)/x;\)\), "\n", \(\(slopefield[f, x, y, \(-4\), 4, \(-4\), 4];\)\)}], "Input", PageWidth->PaperWidth], Cell[TextData[{ "Change the terms in red to whatever you wish. Remember to use the \ double-equal sign if you add more initial states. You can expect to get error \ messages with this. Why might you predict that? Why would you avoid initial \ conditions at ", Cell[BoxData[ \(TraditionalForm\`x = 0\)]], "?" }], "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{ RowBox[{"slopefield", "[", RowBox[{ "f", ",", "x", ",", "y", ",", \(-4\), ",", "4", ",", \(-4\), ",", "4", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"y", "[", StyleBox["1", FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox[\(-1\), FontColor->RGBColor[1, 0, 0]]}], ",", RowBox[{ RowBox[{"y", "[", StyleBox[\(-1\), FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox["3", FontColor->RGBColor[1, 0, 0]]}]}], "}"}]}], "]"}], ";"}]], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Solve ", Cell[BoxData[ FormBox[ StyleBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", \(x\ y\)}], FontSize->16], TraditionalForm]]] }], "Subsection", PageWidth->PaperWidth], Cell[BoxData[{ \(\(f = x*y;\)\), "\n", \(\(slopefield[f, x, y, \(-4\), 4, \(-4\), 4];\)\)}], "Input", PageWidth->PaperWidth], Cell["\<\ Change the terms in red to whatever you wish. Remember to use the \ double-equal sign if you add more initial states. \ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{ RowBox[{"slopefield", "[", RowBox[{ "f", ",", "x", ",", "y", ",", \(-4\), ",", "4", ",", \(-4\), ",", "4", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"y", "[", StyleBox["0", FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox[\(-1\), FontColor->RGBColor[1, 0, 0]]}], ",", RowBox[{ RowBox[{"y", "[", StyleBox["0", FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox["3", FontColor->RGBColor[1, 0, 0]]}]}], "}"}]}], "]"}], ";"}]], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Solve ", Cell[BoxData[ FormBox[ StyleBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", \(y - x\)}], FontSize->16], TraditionalForm]]] }], "Subsection", PageWidth->PaperWidth], Cell[BoxData[{ \(\(f = y - x;\)\), "\n", \(\(slopefield[f, x, y, \(-4\), 4, \(-4\), 4];\)\)}], "Input", PageWidth->PaperWidth], Cell["\<\ Change the terms in red to whatever you wish. Remember to use the double \ equal sign if you add more initial states. \ \>", "Text", PageWidth->PaperWidth], Cell[BoxData[ RowBox[{ RowBox[{"slopefield", "[", RowBox[{ "f", ",", "x", ",", "y", ",", \(-4\), ",", "4", ",", \(-4\), ",", "4", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"y", "[", StyleBox["0", FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox[\(-1\), FontColor->RGBColor[1, 0, 0]]}], ",", RowBox[{ RowBox[{"y", "[", StyleBox["0", FontColor->RGBColor[1, 0, 0]], "]"}], "==", StyleBox["3", FontColor->RGBColor[1, 0, 0]]}]}], "}"}]}], "]"}], ";"}]], "Input", PageWidth->PaperWidth] }, Closed]], Cell[CellGroupData[{ Cell["Try More of Your Own", "Subsection", PageWidth->PaperWidth], Cell[TextData[{ "It's fun! Make up some of your own differential equations of the form ", Cell[BoxData[ FormBox[ RowBox[{ FractionBox[ StyleBox["dy", FontSlant->"Italic"], StyleBox["dx", FontSlant->"Italic"]], "=", \(f(x, y)\)}], TraditionalForm]]], ", and see what kind of patterns and solutions you can generate?" }], "Text", PageWidth->PaperWidth] }, Closed]] }, Closed]] }, Open ]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, AutoGeneratedPackage->None, WindowSize->{711, 521}, WindowMargins->{{-1, Automatic}, {Automatic, 8}}, PrintingCopies->1, PrintingPageRange->{Automatic, Automatic} ] (*********************************************************************** 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[1739, 51, 93, 1, 150, "Title"], Cell[1835, 54, 192, 5, 60, "Text"], Cell[2030, 61, 3037, 60, 19, "Input", CellOpen->False, InitializationCell->True], Cell[CellGroupData[{ Cell[5092, 125, 56, 1, 53, "Section"], Cell[5151, 128, 158, 4, 52, "Text"], Cell[5312, 134, 420, 7, 90, "Text"], Cell[CellGroupData[{ Cell[5757, 145, 99, 2, 47, "Subsection"], Cell[5859, 149, 1414, 36, 299, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[7322, 191, 93, 1, 33, "Section"], Cell[7418, 194, 1769, 62, 155, "Text"], Cell[9190, 258, 162, 4, 84, "Input"], Cell[9355, 264, 210, 5, 52, "Text"], Cell[9568, 271, 204, 4, 50, "Input"], Cell[9775, 277, 453, 14, 71, "Text"], Cell[10231, 293, 136, 3, 30, "Input"], Cell[10370, 298, 162, 4, 52, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[10569, 307, 62, 1, 33, "Section"], Cell[10634, 310, 674, 20, 74, "Text"], Cell[11311, 332, 228, 5, 84, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[11576, 342, 68, 1, 33, "Section"], Cell[11647, 345, 781, 25, 74, "Text"], Cell[12431, 372, 409, 12, 47, "Text"], Cell[12843, 386, 242, 6, 90, "Input"], Cell[13088, 394, 1616, 54, 156, "Text"], Cell[14707, 450, 220, 5, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[14964, 460, 63, 1, 33, "Section"], Cell[15030, 463, 663, 21, 74, "Text"], Cell[15696, 486, 1145, 30, 90, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[16878, 521, 87, 1, 33, "Section"], Cell[16968, 524, 874, 26, 96, "Text"], Cell[17845, 552, 242, 6, 90, "Input"], Cell[18090, 560, 1407, 39, 175, "Text"], Cell[19500, 601, 354, 7, 110, "Input"], Cell[19857, 610, 831, 28, 83, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[20725, 643, 64, 1, 33, "Section"], Cell[20792, 646, 667, 18, 150, "Text"], Cell[21462, 666, 371, 7, 110, "Input"], Cell[21836, 675, 303, 7, 109, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[22176, 687, 63, 1, 33, "Section"], Cell[22242, 690, 848, 21, 112, "Text"], Cell[CellGroupData[{ Cell[23115, 715, 366, 13, 56, "Subsection"], Cell[23484, 730, 140, 3, 50, "Input"], Cell[23627, 735, 244, 5, 52, "Text"], Cell[23874, 742, 766, 21, 30, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[24677, 768, 366, 13, 54, "Subsection"], Cell[25046, 783, 140, 3, 50, "Input"], Cell[25189, 788, 356, 9, 71, "Text"], Cell[25548, 799, 769, 21, 30, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[26354, 825, 361, 13, 54, "Subsection"], Cell[26718, 840, 135, 3, 50, "Input"], Cell[26856, 845, 167, 4, 52, "Text"], Cell[27026, 851, 766, 21, 30, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[27829, 877, 361, 13, 54, "Subsection"], Cell[28193, 892, 137, 3, 50, "Input"], Cell[28333, 897, 167, 4, 52, "Text"], Cell[28503, 903, 766, 21, 30, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[29306, 929, 67, 1, 47, "Subsection"], Cell[29376, 932, 435, 12, 55, "Text"] }, Closed]] }, Closed]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)