Skip to content
Family Table Math

Slope Fields

A differential equation like dydx=x−y\dfrac{dy}{dx} = x - y tells you the slope of a solution curve at every point, even if you can’t solve it. A slope field draws those slopes as tiny line segments, so you can see the shape of every solution at once. Slope fields show up on almost every AP Calculus exam, usually as “sketch the slope field” or “sketch the solution through this point”.

For a differential equation dydx=F(x,y)\dfrac{dy}{dx} = F(x, y), pick a grid of points. At each point (x,y)(x, y), work out the slope F(x,y)F(x, y) and draw a short segment with that slope, centred on the point.

  • Slope 00: a flat (horizontal) segment.
  • Positive slope: the segment rises from left to right. Bigger values are steeper.
  • Negative slope: the segment falls from left to right.
  • Undefined slope (for example, dividing by 00): a vertical segment, or leave the point empty.
  1. Make a table of slopes at the grid points you are asked about.
  2. Look for patterns before drawing everything:
    • If dydx\dfrac{dy}{dx} depends only on xx (like dydx=x\dfrac{dy}{dx} = x), every segment in the same vertical column is parallel.
    • If dydx\dfrac{dy}{dx} depends only on yy (like dydx=y\dfrac{dy}{dx} = y), every segment in the same horizontal row is parallel.
    • Set dydx=0\dfrac{dy}{dx} = 0 to find where the segments are flat.
  3. Draw each segment short, so neighbouring segments don’t touch.

A solution curve must be tangent to the segments everywhere it goes. To sketch the particular solution through a point:

  • Start at the given point and follow the direction of the nearby segments, both to the right and to the left.
  • Move smoothly between segments; don’t jump from one segment to the next in corners.
  • Solution curves of these equations never cross each other, so don’t let your curve cut across another solution.
  • The solution is increasing where the segments rise (dydx>0\dfrac{dy}{dx} \gt 0) and decreasing where they fall.
  • A horizontal segment means a possible maximum, minimum, or flat point.
  • If dydx=0\dfrac{dy}{dx} = 0 all along a horizontal line y=cy = c, then the constant function y=cy = c is itself a solution, called an equilibrium solution. For example, y=0y = 0 solves dydx=3y\dfrac{dy}{dx} = 3y.
  • Concavity comes from the second derivative. Differentiate the equation implicitly, remembering that yy depends on xx, then substitute dydx\dfrac{dy}{dx} back in.

For dydx=x−y\dfrac{dy}{dx} = x - y, find the slope at each point with xx and yy in {−1,0,1}\{-1, 0, 1\}, and describe the segments.

Solution. Compute x−yx - y at each point:

x=−1x = -1x=0x = 0x=1x = 1
y=1y = 1−2-2−1-100
y=0y = 0−1-10011
y=−1y = -1001122

The slope is 00 at (−1,−1)(-1, -1), (0,0)(0, 0), and (1,1)(1, 1): in fact, it is 00 everywhere on the line y=xy = x. Above that line (y>xy \gt x), the slopes are negative; below it, they are positive and get steeper as you move down and to the right. The full slope field is in the figure below.

Example 2: A solution curve through a point

Section titled “Example 2: A solution curve through a point”

Sketch the solution of dydx=x−y\dfrac{dy}{dx} = x - y that passes through (0,1)(0, 1), and describe its behaviour.

Slope field for dy/dx = x - y on a grid from -3 to 3. The solution curve through (0, 1) decreases at first, levels off at a low point on the line y = x near (0.69, 0.69), then rises and gets closer and closer to the dashed straight-line solution y = x - 1. −2 −1 1 2 −2 −1 1 2 (0, 1) y = x − 1
The slope field for dydx=x−y\frac{dy}{dx} = x - y, the solution through (0,1)(0, 1) (blue), and the straight-line solution y=x−1y = x - 1 (green, dashed).

Solution. At (0,1)(0, 1) the slope is 0−1=−10 - 1 = -1, so the curve heads down to the right. As it moves right it reaches the line y=xy = x, where the segments are flat, so it has a low point there. After that, it is below y=xy = x, where slopes are positive, so it rises.

Going right, the curve gets closer and closer to the line y=x−1y = x - 1. That line is a solution too: its slope is 11, and x−y=x−(x−1)=1x - y = x - (x - 1) = 1. ✓ Since solution curves don’t cross, the blue curve can approach this line but never meet it. Going left from (0,1)(0, 1), the slopes are more and more negative, so the curve climbs steeply as xx decreases.

Match each slope field A, B, and C to one of the equations dydx=x\dfrac{dy}{dx} = x, dydx=y\dfrac{dy}{dx} = y, and dydx=x+y\dfrac{dy}{dx} = x + y.

Three slope fields labelled A, B and C, each on a grid from -2 to 2. In A, the segments are horizontal along the line y = -x and get steeper moving up and to the right. In B, every vertical column has parallel segments, horizontal along the y-axis, rising for x greater than 0 and falling for x less than 0. In C, every horizontal row has parallel segments, horizontal along the x-axis, rising above it and falling below it. Slope field A Slope field B Slope field C
Three slope fields, each drawn for −2≤x≤2-2 \le x \le 2 and −2≤y≤2-2 \le y \le 2.

Solution. Look for patterns first.

  • In B, every vertical column has parallel segments, so the slope depends only on xx. The segments are flat along the yy-axis (x=0x = 0), rise to the right of it, and fall to the left. That is dydx=x\dfrac{dy}{dx} = x.
  • In C, every horizontal row has parallel segments, so the slope depends only on yy. It is flat along the xx-axis and positive above it. That is dydx=y\dfrac{dy}{dx} = y.
  • In A, the slopes change in both directions. They are flat along the line y=−xy = -x, which is exactly where x+y=0x + y = 0. So A is dydx=x+y\dfrac{dy}{dx} = x + y.

A solution of dydx=x−y\dfrac{dy}{dx} = x - y passes through (0,1)(0, 1). Is it increasing or decreasing there? Is it concave up or concave down there?

Solution. The slope at (0,1)(0, 1) is 0−1=−1<00 - 1 = -1 \lt 0, so the solution is decreasing.

For concavity, differentiate both sides with respect to xx. Since yy is a function of xx, the derivative of yy is dydx\dfrac{dy}{dx}:

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

At (0,1)(0, 1): d2ydx2=1−0+1=2>0\dfrac{d^2y}{dx^2} = 1 - 0 + 1 = 2 \gt 0, so the solution is concave up there. This matches the figure: the blue curve is falling but bending upward at (0,1)(0, 1).

Making segments too long. Long segments cross each other and make the field unreadable. Keep them short and centred on each grid point.

Plugging the point in backwards. At (1,2)(1, 2), x=1x = 1 and y=2y = 2. For dydx=x−y\dfrac{dy}{dx} = x - y the slope is 1−2=−11 - 2 = -1, not 2−1=12 - 1 = 1.

Drawing the solution curve through only one side. When asked for the solution through a point, sketch it both to the left and to the right of the point (within the region shown), not just in one direction.

Letting the curve cut across segments. The curve should run along the segments, tangent to them, never at an angle across them. It also should not cross another solution, such as an equilibrium line.

Forgetting the chain rule in the second derivative. When you differentiate x−yx - y with respect to xx, the derivative of yy is dydx\dfrac{dy}{dx}, not 11 and not 00. Then substitute the original equation for dydx\dfrac{dy}{dx}.

Mixing up “depends only on xx” with rows. If the slope depends only on xx, the segments match down each column (same xx). If it depends only on yy, they match across each row (same yy).

1. (Warm-up) For dydx=xy\dfrac{dy}{dx} = xy, find the slope of the segment at each point: (1,2)(1, 2), (−1,3)(-1, 3), (0,5)(0, 5), and (2,−1)(2, -1).

Solution
  • (1,2)(1, 2): 1⋅2=21 \cdot 2 = 2
  • (−1,3)(-1, 3): (−1)(3)=−3(-1)(3) = -3
  • (0,5)(0, 5): 0⋅5=00 \cdot 5 = 0 (flat)
  • (2,−1)(2, -1): 2(−1)=−22(-1) = -2

2. (Warm-up) For dydx=y−2\dfrac{dy}{dx} = y - 2, where are the segments horizontal? Where do they have positive slope?

Solution

The slope is 00 when y−2=0y - 2 = 0, so the segments are horizontal all along the line y=2y = 2. (That line is an equilibrium solution.)

The slope is positive when y−2>0y - 2 \gt 0, that is, at every point above the line y=2y = 2.

3. (Core) In a slope field, all the segments in each horizontal row are parallel. The segments are flat along y=1y = 1 and y=−1y = -1, and they have positive slope between those lines. Which equation could it be?

  • (a) dydx=1−x2\dfrac{dy}{dx} = 1 - x^2
  • (b) dydx=1−y2\dfrac{dy}{dx} = 1 - y^2
  • (c) dydx=y2−1\dfrac{dy}{dx} = y^2 - 1
Solution

Parallel segments across each row means the slope depends only on yy, which rules out (a).

Both (b) and (c) are 00 at y=±1y = \pm 1. Test a point between the lines, say y=0y = 0: (b) gives 1−0=1>01 - 0 = 1 \gt 0 and (c) gives 0−1=−1<00 - 1 = -1 \lt 0. So the answer is (b).

4. (Core) A solution of dydx=2x−y\dfrac{dy}{dx} = 2x - y passes through (1,3)(1, 3). Is it increasing or decreasing at that point? Is it concave up or concave down?

Solution

Slope: 2(1)−3=−1<02(1) - 3 = -1 \lt 0, so it is decreasing.

Second derivative:

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

At (1,3)(1, 3): 2−2+3=3>02 - 2 + 3 = 3 \gt 0, so it is concave up.

5. (Core) Consider dydx=(y−1)(y−3)\dfrac{dy}{dx} = (y - 1)(y - 3).

  • (a) Find the equilibrium solutions.
  • (b) A solution passes through (0,2)(0, 2). Is it increasing or decreasing there?
  • (c) Describe what happens to that solution as xx increases.
Solution

(a) The slope is 00 for every xx when y=1y = 1 or y=3y = 3, so the equilibrium solutions are y=1y = 1 and y=3y = 3.

(b) At y=2y = 2: (2−1)(2−3)=−1<0(2 - 1)(2 - 3) = -1 \lt 0, so it is decreasing.

(c) For every yy between 11 and 33, the slope is negative, so the solution keeps decreasing. It can’t cross the equilibrium solution y=1y = 1, so it levels off and gets closer and closer to y=1y = 1 as xx increases.

6. (Core) Write a differential equation whose slope field has these features: the slope depends only on xx, the segments are flat along the line x=2x = 2, and they have negative slope to the left of x=2x = 2 and positive slope to the right.

Solution

One answer is

dydx=x−2\frac{dy}{dx} = x - 2

It depends only on xx, is 00 at x=2x = 2, is negative for x<2x \lt 2, and is positive for x>2x \gt 2. (Other answers work too, such as dydx=3(x−2)\dfrac{dy}{dx} = 3(x - 2) or dydx=(x−2)3\dfrac{dy}{dx} = (x - 2)^3.)

7. (Core) For dydx=x−y\dfrac{dy}{dx} = x - y, show that the line y=x−1y = x - 1 is a solution. Then explain why the solution through (0,1)(0, 1) stays above this line for every xx.

Solution

For y=x−1y = x - 1: the left side is dydx=1\dfrac{dy}{dx} = 1, and the right side is x−(x−1)=1x - (x - 1) = 1. They match, so it is a solution.

At x=0x = 0, the solution through (0,1)(0, 1) is above the line, which passes through (0,−1)(0, -1). Solution curves of this equation never cross, so the curve through (0,1)(0, 1) can never reach the line. It stays above it for every xx (it just gets closer and closer as xx increases).

8. (Challenge) For dydx=x−y\dfrac{dy}{dx} = x - y, show that wherever a solution curve meets the line y=xy = x, it has a relative minimum.

Solution

On the line y=xy = x, the slope is x−y=0x - y = 0, so any solution that meets the line has a horizontal tangent there.

From Example 4, d2ydx2=1−dydx\dfrac{d^2y}{dx^2} = 1 - \dfrac{dy}{dx}. At a point where dydx=0\dfrac{dy}{dx} = 0, this gives d2ydx2=1>0\dfrac{d^2y}{dx^2} = 1 \gt 0.

The first derivative is 00 and the second derivative is positive, so by the second derivative test the solution has a relative minimum at that point.

9. (Challenge) Let y=f(x)y = f(x) be the solution of dydx=x2+y\dfrac{dy}{dx} = x^2 + y with f(0)=1f(0) = 1.

  • (a) Write the equation of the tangent line to the graph of ff at x=0x = 0, and use it to approximate f(0.2)f(0.2).
  • (b) Is your approximation an overestimate or an underestimate? Justify your answer.
Solution

(a) f′(0)=02+1=1f'(0) = 0^2 + 1 = 1, so the tangent line is y=1+1(x−0)=1+xy = 1 + 1(x - 0) = 1 + x. Then f(0.2)≈1+0.2=1.2f(0.2) \approx 1 + 0.2 = 1.2.

(b) Differentiate the equation:

d2ydx2=2x+dydx=2x+x2+y\frac{d^2y}{dx^2} = 2x + \frac{dy}{dx} = 2x + x^2 + y

At (0,1)(0, 1): d2ydx2=0+0+1=1>0\dfrac{d^2y}{dx^2} = 0 + 0 + 1 = 1 \gt 0. The graph of ff is concave up near x=0x = 0, so it lies above its tangent line there. The tangent-line value 1.21.2 is an underestimate.