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]:=

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]}];

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]}];

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

In[47]:=

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]}];

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];

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];

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]:=

In[67]:=

In[69]:=

Created by Mathematica  (April 25, 2004)