Differential Equations for EngineersXYZ Homework Edition

⇩ Download ▾

1.2 Slope fields

The general first order equation we are studying looks like

y = f ( x , y ) y' = f(x,y) \nonumber

In general, we cannot simply solve these kinds of equations explicitly. It would be nice if we could at least figure out the shape and behavior of the solutions, or if we could find approximate solutions. At this point it may be good to first try the Lab I and/or Project I from the IODE website.

Slope fields

The equation y=f(x,y)y' = f(x,y) gives you a slope at each point in the (x,y)(x,y)-plane. And this is the slope a solution y(x)y(x) would have at xx if its value was yy. In other words, f(x,y)f(x,y) is the slope of a solution whose graph runs through the point (x,y)(x,y). At a point (x,y)(x,y), we plot a short line with the slope f(x,y)f(x,y). For example, if f(x,y)=xyf(x,y) = xy, then at point (2,1.5)(2,1.5) we draw a short line of slope xy=2×1.5=3xy = 2 \times 1.5 = 3. So, if y(x)y(x) is a solution and y(2)=1.5y(2) = 1.5, then the equation mandates that y(2)=3y'(2) = 3. See Figure 1\PageIndex{1}.

Diagram of an empty grid from -3 to 3 in both directions with one short blue segment at x = 2, y = 1.5, tilted steeply up to the right to mark the slope at that single point.
Figure 1\PageIndex{1}: The slope y=xyy'=xy at (2,1.5)(2,1.5).

To get an idea of how solutions behave, we draw such lines at lots of points in the plane, not just the point (2,1.5)(2,1.5). We would ideally want to see the slope at every point, but that is just not possible. Usually we pick a grid of points fine enough so that it shows the behavior, but not too fine so that we can still recognize the individual lines. We call this picture the slope field of the equation. See Example 2 for the slope field of the equation y=xyy' = xy. Usually in practice, one does not do this by hand, but has a computer do the drawing.

Interactive figureSlope field for y' = xy with solution curvesDrag inside the figure to pan; scroll to zoom.
Short slopes tile the frame, lying flat along both axes and standing ever steeper toward the corners — tilting up to the right in the upper-right and lower-left regions, down to the right in the other two. Four solution curves follow them: the two above the horizontal axis flatten to their lowest point on the vertical axis and sweep symmetrically upward at both edges, and the two below mirror them exactly, cresting at the axis and plunging away on either side. Viewing window: x from -4.87 to 4.87, y from -3.01 to 3.01.
XYZ Graph · viewer build 5edf91b
The slope field of y′ = xy, the equation this section works through. Explore it to drag the viewing window, or open it in XYZ Graph to add your own initial conditions and watch the solution curve follow the slopes.

Suppose we are given a specific initial condition y(x0)=y0y(x_0) = y_0. A solution, that is, the graph of the solution, would be a curve that follows the slopes we drew. For a few sample solutions, see Figure 3\PageIndex{3}. It is easy to roughly sketch (or at least imagine) possible solutions in the slope field, just from looking at the slope field itself. You simply sketch a line that roughly fits the little line segments and goes through your initial condition.

Slope field over x and y from -3 to 3, symmetric about the origin: the dashes lie flat along both axes and steepen with distance from them, standing nearly vertical at the corners.
Figure 3\PageIndex{3}: Slope field of y=xyy'=xy.
Slope field over x and y from -3 to 3 with three red solutions: the line y = 0 and two curves mirroring it, with turning points at 0.2 and -0.2, that bend sharply away near x = 2.35.
Figure 3\PageIndex{3}: Slope field of y=xyy' = xy with a graph of solutions satisfying y(0)=0.2y(0) = 0.2, y(0)=0y(0) = 0, and y(0)=0.2y(0) = -0.2.

By looking at the slope field we get a lot of information about the behavior of solutions without having to solve the equation. For example, in Figure 3\PageIndex{3} we see what the solutions do when the initial conditions are y(0)>0y(0) > 0, y(0)=0y(0) = 0 and y(0)<0y(0) < 0. A small change in the initial condition causes quite different behavior. We see this behavior just from the slope field and imagining what solutions ought to do.

We see a different behavior for the equation y=yy' = -y. The slope field and a few solutions is in see Figure 4\PageIndex{4}. If we think of moving from left to right (perhaps xx is time and time is usually increasing), then we see that no matter what y(0)y(0) is, all solutions tend to zero as xx tends to infinity. Again that behavior is clear from simply looking at the slope field itself.

Slope field over x and y from -3 to 3 whose dashes all lean back toward y = 0. Three red solutions entering at y = 3, 1 and -2 merge with the line y = 0 by about x = 1.
Figure 4\PageIndex{4}: Slope field of y=yy' = -y with a graph of a few solutions.

Existence and uniqueness

We wish to ask two fundamental questions about the problem

y = f ( x , y ) , y ( x 0 ) = y 0 y' = f(x,y),\quad y(x_0) = y_0 \nonumber

  1. Does a solution exist?
  2. Is the solution unique (if it exists)?

What do you think is the answer? The answer seems to be yes to both does it not? Well, pretty much. But there are cases when the answer to either question can be no.

Since generally the equations we encounter in applications come from real life situations, it seems logical that a solution always exists. It also has to be unique if we believe our universe is deterministic. If the solution does not exist, or if it is not unique, we have probably not devised the correct model. Hence, it is good to know when things go wrong and why.

It is hard to tell by staring at the slope field that the solution is not unique. Is there any hope? Of course there is. We have the following theorem, known as Picard’s theorem.1

Note that the problems y=1xy' = \dfrac{1}{x}, y(0)=0y(0) = 0 and y=2|y|y' = 2 \sqrt {\left \vert y \right \vert}, y(0)=0y(0) = 0 do not satisfy the hypothesis of the theorem. Even if we can use the theorem, we ought to be careful about this existence business. It is quite possible that the solution only exists for a short while.

For example, when A=1A = 1 the solution “blows up” at x=1x = 1. Hence, the solution does not exist for all xx even if the equation is nice everywhere. The equation y=y2y' = y^2 certainly looks nice.

Interactive figureBlow-up of y′ = y² at x = 1/A, with A on a sliderDrag the Initial value y(0) = A slider from 0.25 to 2.
Short slopes tile the frame, lying flat along the bottom and tipping up ever more steeply the higher you look, and a solution curve threads them from the left, rising gently at first and then turning almost vertical as it runs into an invisible wall and leaves the top of the frame. Raising the starting height brings that wall in toward the left; lowering it pushes the wall out to the right, so where the solution ends depends entirely on where it began. Adjustable parameter: Initial value y(0) = A (a) = 1. Viewing window: x from -1.32 to 4.52, y from -0.16 to 3.46.
XYZ Graph · viewer build 5edf91b
The solution of y′ = y², y(0) = A is y = 1/(1/A − x), so it runs into a wall at x = 1/A: how long a solution exists depends on where you start, not on how nice the equation looks. At A = 1 the wall sits at x = 1 — the case worked above. Drag A down to 0.25 and the wall retreats to x = 4; drag it up to 2 and the wall marches in to x = 0.5. The slope field behind the curve shows the mechanism: slopes steepen like y², so the higher the solution climbs the faster it runs away.

For most of this course we will be interested in equations where existence and uniqueness holds, and in fact holds “globally” unlike for the equation y=y2y' = y^2.

Footnotes

[1] Named after the French mathematician Charles Émile Picard (1856 – 1941)

Adapted from Differential Equations for Engineers by Jiří Lebl (https://www.jirka.org/diffyqs/), © Jiří Lebl, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.