Differential Equations - Creating Slope Fields

A Theoretical Introduction to Slope Fields

Long ago, in a class room not so very far away, you learned about a mathematical idea called ³Ù³ó±ðÌýderivative. Now assuming that you passed the course you were taking back then, you should have learned a very important property of the derivative:

³Ù³ó±ðÌýderivativeÌýof a function gives itsÌýslope

When we work withÌýdifferential equations, we are dealing with expressions in which the derivative appears as a variable. For example, we might be asked to analyze the differential equation:

dy/dxÌý=Ìýx2

If we simply replace the variableÌýdy/dxÌýin the above equation by what we learned it means from our calculus course, we get the following statement:

slopeÌý=Ìýx2

So what? Well, let's remind ourselves of our usualÌýgoalÌýwhen we are given a differential equation:

find the function whose derivative appears in the equation

In our example this means that our goal is to findÌýy.

Now you may be one of those clever students who's always one step ahead of the instructor. If so you're probably already having thoughts about how you could easily solve the current example (i.e. findÌýy) using integration. Hold that thought! Unfortunately integration isn't something we will always be able to use. Many (most?) differential equationsÌýcan'tÌýbe integrated directly. What we're leading into here is a method that can help us on far more differential equations than can be solved using integration.

Anyway, let's get back to our analysis of slope. We've established that our goal is to find the function which satisfies:

slopeÌý=Ìýx2

In other words, we're seeking a function whose slope at any point in the (x,y)-plane is equal to the value ofÌýx2Ìýat that point. Let's amplify that by examining a few selected points.

  • At the point (1,2) the slope would be 12Ìý= 1.
  • At the point (5,3) the slope would be 52Ìý= 25.
  • At the point (-3,11) the slope would be (-3)2Ìý= 9.

(Notice that ³Ù³ó±ðÌýy-value of these points doesn't influence the slope in this particular example. This will not always be the case.)

Hmmm...maybe we could use these slopes to get a picture of what the function we seek—the function which has these slopes—looks like? Well, for starters we'd need to be a bit more systematic about how we choose our points. (The choices I made above were somewhat random.)

We could divide the entire plane into a grid, kind of like the squares on a piece of graph paper, and at each grid intersection we could make a slope calculation like we were doing above. Obviously doing this for the entire plane is actually impossible, since it's infinite, so we'll have to be satisfied with some "reasonable" subset of the plane.

This is starting to sound like a lot of work. We may be talking about slope calculations at literally thousands of points, here. Sounds like a job for someone who doesn't mind doing myriads of mind-numbingly repetitive tasks. Someone who can maintain accuracy despite the mountain of (admittedly trivial) calculations involved. Well, you knew you were sitting at a computer for a reason, didn't you?

OK, so we'll have the computer do the calculations, but there's still something we haven't decided on yet! What do we do with all those thousands of slopes once we've found them? We mentioned earlier that we'd use the slopes to get a picture of what the functionÌýyÌýlooks like. One way of doing this would be to graphically represent each of the slopes that we find at points all over the plane by a short line segment that is actually as steep as the slope says it should be at that point. We can think of these little line segments as tangent lines to the functionÌýyÌýthat we've been looking for all this time. We will, of course, have the computer also carry out the job of drawing all the little tangent lines for us. We call the resulting picture aÌýslope field, orÌýdirection field.

The picture produced by a computer program may look a little like this:

Slope Field
A sample slope field made with Mathematica

If you feel that you followed the above description of how a slope field is formed then carry on down the page. If you're still a little lost you can either read aÌýsummaryÌýof the procedure, or you can even return to ³Ù³ó±ðÌýbeginningÌýof this Introduction and read it through again.

Making Slope Fields with the Computer

Let's continue to use the example of finding a slope field for the differential equation:

dy/dxÌý=Ìýx2

As I mentioned above, it would be impossible to produce a slope field covering the entire, infinite, Cartesian plane. Instead, for our example, let's restrict the section of the plane we consider to:

-2 ≤ÌýxÌý≤ 2, and -2 ≤ÌýyÌý≤ 2

To see how we would create a slope field for this example withÌýMathematica, go to ³Ù³ó±ðÌýnext page...

Interactive NotebookÌý


Compass If you're lost, impatient, want an overview of this laboratory assignment, or maybe even all three, you can click on the compass button on the left to go to the table of contents for this laboratory assignment.