7.2 Slope Fields

Mathematica script by Chris Parrish,
   cparrish@sewanee.edu

Sources and references for some of these problems include
    James Stewart, "Calculus: Concepts and Contexts," Second Edition, Brooks/Cole, 2001
    Deborah Hughes-Hallett, Andrew M. Gleason, et. al., "Calculus," Second Edition, John Wiley & Sons, 1998
    Robert Fraga, ed., "Calculus Problems for a New Century," The Mathematical Association of America, 1993

Slope Field for dy/dx = x + y

Hughes-Hallett, Gleason, et al, First Edition, Exercise 9.2.1, page 487

In[38]:=

<<Graphics`PlotField`

In[39]:=

Clear[f,x,y];

f[x_,y_] := x + y;

pts = {{0,0},{-3,0},{-1,0}};

field = PlotVectorField[{1,f[x,y]},
                        {x,-4,4},{y,-4,4},
                        PlotLabel -> "dy/dt = x + y",
                        Axes -> True,
                        AxesLabel -> {"x","y"},
                        PlotPoints -> 20,
                        Prolog -> ManganeseBlue,
                        Epilog -> {Red,PointSize[0.02],
                                   Map[Point,pts]}];

[Graphics:HTMLFiles/7.2_slopeFields_2.gif]

Slope Field for dy/dx = Sin[x] Sin[y]

Hughes-Hallett, Gleason, et al, First Edition, Exercise 9.2.2, page 487

In[43]:=

Clear[f,x,y];

f[x_,y_] := Sin[x] Sin[y];

pts = {{-2,-2},{0,Pi}};

field = PlotVectorField[{1,f[x,y]},
                        {x,-6,6},{y,-6,6},
                        PlotLabel -> "dy/dt = Sin[x] Sin[y]",
                        Axes -> True,
                        AxesLabel -> {"x","y"},
                        PlotPoints -> 20,
                        Prolog -> ManganeseBlue,
                        Epilog -> {Red,PointSize[0.02],
                                   Map[Point,pts]}];

[Graphics:HTMLFiles/7.2_slopeFields_3.gif]

Slope Field for dy/dx = x^2 - y^2

Hughes-Hallett, Gleason, et al, First Edition, Exercise 9.2.4, page 488

In[47]:=

Clear[f, x, y] ; <br /> f[x_, y_] := x^2 - y^2 ;  pts = {{0, 1}, {1, 0}} ;     ... ox[{{, RowBox[{Red, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Map[Point, pts]}], }}]}]}], ]}]}], ;}]

[Graphics:HTMLFiles/7.2_slopeFields_6.gif]

Slope Field for dy/dx = 0.5 (1 + y) (2 - y)

Hughes-Hallett, Gleason, et al, First Edition, Exercise 9.2.6, page 488

In[51]:=

Clear[f,x,y];

f[x_,y_] := 0.5 (1 + y) (2 - y);

pts = {{0,0},{0,1},{1,0},{0,-1},{0,-5/2},{0,5/2}};

field = PlotVectorField[{1,f[x,y]},
                        {x,-2,2},{y,-3,3},
                        PlotLabel -> "dy/dt = 0.5 (1 + y) (2 - y)",
                        Axes -> True,
                        AxesLabel -> {"x","y"},
                        PlotPoints -> 20,
                        Prolog -> ManganeseBlue,
                        Epilog -> {Red,PointSize[0.02],
                                   Map[Point,pts]}];

[Graphics:HTMLFiles/7.2_slopeFields_7.gif]

Gompertz Equation

Hughes-Hallett, Gleason, et al, First Edition, Exercise 9.2.7, page 489

In[55]:=

Clear[f,x,y];

a = 1;
b = 2;

f[x_,y_] := a y Log[y/b];

field = PlotVectorField[{1,f[x,y]},
                        {x,0,4},{y,0.1,4},
                        PlotLabel -> "dy/dt = a y Log[y/b]",
                        Axes -> True,
                        AxesLabel -> {"x","y"},
                        PlotPoints -> 20,
                        Prolog -> ManganeseBlue];

[Graphics:HTMLFiles/7.2_slopeFields_8.gif]

In[60]:=

Clear[f,x,y];

f[x_,y_] := y (2 - y);

field = PlotVectorField[{1,f[x,y]},
                        {x,0,4},{y,0.1,4},
                        PlotLabel -> "dy/dt = y (2 - y)",
                        Axes -> True,
                        AxesLabel -> {"x","y"},
                        PlotPoints -> 20,
                        Prolog -> ManganeseBlue];

[Graphics:HTMLFiles/7.2_slopeFields_9.gif]

Slope Field for dy/dx = y/(3y^2 - x)

Hughes-Hallett, Gleason, et al, First Edition, Exercise 9.2.15, page 489

A solution curve for this vector field is plotted on page 231 of Hughes-Hallett, et al.
The picture that you find there will help you to interpret the pictures you see here.

In[63]:=

Clear[f, x, y] ; <br /> f[x_, y_] := y/(3y^2 - x) ;  pts = {{7, 2}} ;          ... ox[{{, RowBox[{Red, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Map[Point, pts]}], }}]}]}], ]}]}], ;}]

[Graphics:HTMLFiles/7.2_slopeFields_12.gif]

In[67]:=

pts = {{7, 1}} ; <br />                                                                        ... ox[{{, RowBox[{Red, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Map[Point, pts]}], }}]}]}], ]}]}], ;}]

[Graphics:HTMLFiles/7.2_slopeFields_14.gif]

In[69]:=

pts = {{7, -3}} ; <br />                                                                       ... ox[{{, RowBox[{Red, ,, RowBox[{PointSize, [, 0.02, ]}], ,, Map[Point, pts]}], }}]}]}], ]}]}], ;}]

[Graphics:HTMLFiles/7.2_slopeFields_16.gif]


Created by Mathematica  (April 25, 2004)