Slope Fields

Recall that in Chapter 2 we found that the first differential equation above serves as a good model of USA population growth for the period 1790-1850:

[Maple Math] , where [Maple Math] and [Maple Math] million people.

We all know the solution to this equation, but suppose we did not. That is, suppose we start with the differential equation and the initial value for [Maple Math] (i.e., [Maple Math] ), and we want to find the solution [Maple Math] . What does the equation tell us about tangent lines? If you think about it, the equation says that at any point [Maple Math] in the plane (where we have written [Maple Math] ), we can compute the slope [Maple Math] of the tangent line through that point. That is, at each point [Maple Math] in the plane, we can draw a short straight line whose slope comes from the differential equation. The resulting two-dimensional plot of tangent lines is called the slope field or direction field of the differential equation. We can sometimes guess the shape of the solution curve by sketching a curve that satisfies the given initial condition and follows the slopes of the slope field. Let's try it for the equation at hand.

It is easy to plot slope fields in Maple. We begin by loading the [Maple Math] package:

> with(DEtools):
K:=.0295:
dfieldplot(diff(P(t),t)= K*P(t),P(t),t=1790..1850,P=3.929..23.261);

[Maple Plot]

Can you guess the shape of the solution curve? Try starting at the point where [Maple Math] million and sketching in a curve that follows the slopes. Does the curve look familiar?

Maple can also solve the differential equation for us, and we can plot its graph on the slope field. Here is how.

First, the solution:

> K:=.0295:
sol:=dsolve({diff(P(t),t)= K*P(t),P(1790)=3.929},P(t));

[Maple Math]

(No surprises here!)

Next, name the plots; be sure to end each line with a colon instead of a semicolon to suppress showing the data that will be used by the [Maple Math] command. Then, load the [Maple Math] package to display the direction field and the solution curve:

> K:=.0295:
solPlot:=plot(rhs(sol),t=1790..1850):
fld:=dfieldplot(diff(P(t),t)= K*P(t),P(t),t=1790..1850,P=3.929..23.261):

with(plots):
display([fld,solPlot]);

[Maple Plot]

Observe that, as expected, the tangent lines of the slope field follow the shape of the solution curve where it passes through the field.

Go back