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:
, where
and
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
(i.e.,
), and we want to find the solution
. What does the equation tell us about tangent lines? If you think about it, the equation says that at any point
in the plane (where we have written
), we can compute the slope
of the tangent line through that point. That is, at each point
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
package:
>
with(DEtools):
K:=.0295:
dfieldplot(diff(P(t),t)= K*P(t),P(t),t=1790..1850,P=3.929..23.261);
Can you guess the shape of the solution curve? Try starting at the point where
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));
(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
command. Then, load the
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]);
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