Math Core

Lesson 7.3 · Differential Equations

Slope fields

Many differential equations can't be solved with a formula, and even when they can, a picture often tells you more at a glance. A slope field shows the shape of every solution to dydx=f(x,y)\dfrac{dy}{dx} = f(x, y) at once, without solving anything.

The idea behind a slope field

A differential equation dydx=f(x,y)\dfrac{dy}{dx} = f(x, y) tells you the slope of the solution curve through any point (x,y)(x, y). You don't know the curve yet, but you do know its direction at that point.

Definition

Slope field

A slope field (or direction field) for dydx=f(x,y)\dfrac{dy}{dx} = f(x, y) is a grid of short line segments. At each grid point (x,y)(x, y), the segment is drawn with slope f(x,y)f(x, y).

To draw one by hand, make a table: pick grid points, compute f(x,y)f(x, y) at each, and draw a tiny segment with that slope. Zero slope means a horizontal segment, a slope of 1 means a segment at 45∘45^\circ rising to the right, and a large slope means a nearly vertical segment.

Worked example: Building part of a slope field

For dydx=x−y\dfrac{dy}{dx} = x - y, compute the slopes at the points (0,0)(0, 0), (1,0)(1, 0), (0,1)(0, 1), (2,1)(2, 1), (−1,1)(-1, 1) and (1,3)(1, 3).

Solution. Evaluate x−yx - y at each point.

Point (x,y)(x, y)(0,0)(0, 0)(1,0)(1, 0)(0,1)(0, 1)(2,1)(2, 1)(−1,1)(-1, 1)(1,3)(1, 3)
Slope x−yx - y0011−1-111−2-2−2-2

Notice a pattern: the slope is 0 everywhere on the line y=xy = x, and it is the same, 1, everywhere on the line y=x−1y = x - 1. In general, the slope is constant along each line x−y=cx - y = c. The full slope field on the grid −3≤x≤3-3 \le x \le 3, −3≤y≤3-3 \le y \le 3 is below.

Slope field for dy/dx = x − y. The dashed curves are the solutions through (0, 0) and (0, 2).Open in grapher →

Sketching solution curves

A solution curve must be tangent to the segment at every point it passes through. To sketch the solution through a given point, start at that point and "go with the flow": follow the segments to the right and to the left, bending smoothly so the curve always runs parallel to the nearby segments.

In the graph above, the two dashed curves are the solutions through (0,0)(0, 0) and (0,2)(0, 2). Both eventually bend and run alongside the line y=x−1y = x - 1. That line is itself a solution: along it the slope is x−(x−1)=1x - (x - 1) = 1, which matches the line's own slope.

Reading a slope field

  • Solution curves follow the segments; they are tangent to the field at every point.
  • If the slopes are the same along every vertical column, dydx\dfrac{dy}{dx} depends only on xx.
  • If the slopes are the same along every horizontal row, dydx\dfrac{dy}{dx} depends only on yy.
  • A horizontal line y=cy = c made entirely of horizontal segments is an equilibrium solution: y=cy = c satisfies the equation for all xx.

Matching a slope field to an equation

On the AP exam you are often shown a slope field and asked which equation produced it. Don't compute every slope. Instead, look for a few telling features and eliminate choices.

  1. Where are the slopes zero? Horizontal segments show where f(x,y)=0f(x, y) = 0.
  2. Where are the slopes positive, and where negative? Check one point in each region.
  3. Do the slopes depend only on xx, only on yy, or on both? Compare columns and rows.

Worked example: Which equation?

The slope field below was produced by one of these equations: dydx=x\dfrac{dy}{dx} = x, dydx=y\dfrac{dy}{dx} = y, dydx=x+y\dfrac{dy}{dx} = x + y. Which one?

A slope field for one of three differential equations.Open in grapher →

Solution. Look along any horizontal row: every segment in the row has the same slope. So dydx\dfrac{dy}{dx} depends only on yy, which rules out xx and x+yx + y. Confirm with details: the slopes are 0 along the xx-axis (y=0y = 0), positive above it, negative below it, and steeper farther from the axis. That is dydx=y\dfrac{dy}{dx} = y. The xx-axis is an equilibrium solution.

For contrast, here is the field for dydx=x\dfrac{dy}{dx} = x. Now each vertical column has a single slope, and the horizontal segments sit along the yy-axis. Its solution curves are the parabolas y=12x2+Cy = \tfrac12 x^2 + C.

Slope field for dy/dx = x: slopes depend only on x.Open in grapher →

Concavity from the differential equation

The slope field shows where solutions rise and fall. To find where they are concave up or down, differentiate the differential equation itself. Because yy is a function of xx, you need the chain rule (implicit differentiation) whenever yy appears.

Worked example: Increasing or decreasing, concave up or down

Let y=f(x)y = f(x) be the solution of dydx=x−y\dfrac{dy}{dx} = x - y passing through (1,3)(1, 3). At that point, is the graph of ff increasing or decreasing? Concave up or concave down?

Solution. At (1,3)(1, 3), dydx=1−3=−2<0\dfrac{dy}{dx} = 1 - 3 = -2 < 0, so ff is decreasing there.

Differentiate both sides of the differential equation with respect to xx:

d2ydx2=ddx(x−y)=1−dydx.\frac{d^2y}{dx^2} = \frac{d}{dx}(x - y) = 1 - \frac{dy}{dx}.

At (1,3)(1, 3), d2ydx2=1−(−2)=3>0\dfrac{d^2y}{dx^2} = 1 - (-2) = 3 > 0, so ff is concave up there. The solution is falling but leveling off, just as the slope field suggests near that point.

Common mistake

When you differentiate a differential equation to get d2ydx2\dfrac{d^2y}{dx^2}, treat yy as a function of xx. The derivative of y2y^2 is 2ydydx2y\dfrac{dy}{dx}, not 2y2y; the derivative of xyxy is y+xdydxy + x\dfrac{dy}{dx}. Then substitute the original expression for dydx\dfrac{dy}{dx} so the answer is in terms of xx and yy.

Tip

When sketching by hand on the AP exam, a slope field at 9 to 12 grid points is plenty. Draw segments short and centered on the dot, and let the table of values do the work.

Practice

Practice 1

For the differential equation dydx=x2−2y\dfrac{dy}{dx} = x^2 - 2y, what slope should the segment at the point (3,1)(3, 1) have?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

The slope field below is for which differential equation?

Slope field for the practice problem.Open in grapher →
Practice 3

In a certain slope field, all the segments along any horizontal line are parallel to each other, but the segments change from one horizontal line to another. Which could be the differential equation?

Practice 4

Find every equilibrium solution y=cy = c of dydx=(y−1)(y+4)\dfrac{dy}{dx} = (y - 1)(y + 4). Enter the values of cc.

Separate answers with commas, e.g. 2, -5

Practice 5

The slope field for dydx=2−y\dfrac{dy}{dx} = 2 - y is shown. Let y=f(x)y = f(x) be the solution with f(0)=4f(0) = 4. Find lim⁡x→∞f(x)\displaystyle\lim_{x \to \infty} f(x).

Slope field for dy/dx = 2 − y.Open in grapher →

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

For the differential equation dydx=x+y2\dfrac{dy}{dx} = x + y^2, find d2ydx2\dfrac{d^2y}{dx^2} in terms of xx and yy.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 7

Let y=f(x)y = f(x) be the solution of dydx=2x+y\dfrac{dy}{dx} = 2x + y through the point (−1,1)(-1, 1). Which statement is true about the graph of ff at x=−1x = -1?