Differential EquationsSolving First-Order Equations3 of 7
Solving First-Order Equations · 3

Slope Fields

Most differential equations are difficult or impossible to solve with an algebra formula, so we need a way to see what the solutions look like directly from the equation itself.

1

What a Slope Field Is

A slope field is a grid of short dashes across the coordinate plane, where each dash shows the exact slope dydx\slope{\frac{dy}{dx}} that a solution curve must have if it passes through that point.

What a Slope Field Is
dydx=x2−y2\htmlClass{lc-pink}{\dfrac{dy}{dx}} = x^2 - y^2
y= ?y = \,?
−2\htmlClass{lc-mute}{-2}
−1\htmlClass{lc-mute}{-1}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
−2\htmlClass{lc-mute}{-2}
−1\htmlClass{lc-mute}{-1}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
Text solution
Slope at (1,1)(1, 1)Plug x=1x = 1 and y=1y = 1 into dydx=x+y\slope{\frac{dy}{dx}} = x + y to find the slope of the dash at that point.
dydx\displaystyle \slope{\frac{dy}{dx}} =1+1\displaystyle = 1 + 1 =2\displaystyle = \slope{2}
Slope at (0,1)(0, 1)Plug in x=0x = 0 and y=1y = 1 to get a gentler upward dash.
dydx\displaystyle \slope{\frac{dy}{dx}} =0+1\displaystyle = 0 + 1 =1\displaystyle = \slope{1}
Slope at (−1,1)(-1, 1)Plug in x=−1x = -1 and y=1y = 1 to find where the dash is completely flat.
dydx\displaystyle \slope{\frac{dy}{dx}} =−1+1\displaystyle = -1 + 1 =0\displaystyle = \slope{0}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
(1,1)(1, 1)
slope 2\htmlClass{lc-pink}{\text{slope } 2}
(0,1)(0, 1)
slope 1\htmlClass{lc-pink}{\text{slope } 1}
(−1,1)(-1, 1)
slope 0\htmlClass{lc-pink}{\text{slope } 0}

So even without a formula for y\soln{y}, following the dashes across the grid shows the paths the solution curves must take.

2

Slope Fields That Depend Only on xx

Plotting points one by one takes a long time, so we look for shortcuts in the equation. First, let's sketch the field and see the family of solution curves when the right-hand side has only xx:

dydx\displaystyle \slope{\frac{dy}{dx}} =x\displaystyle = x
Slope Fields That Depend Only on x
dydx=x\htmlClass{lc-pink}{\dfrac{dy}{dx}} = x
slope=x-coordinate\htmlClass{lc-pink}{\text{slope}} = x\text{-coordinate}
−2\htmlClass{lc-mute}{-2}
−1\htmlClass{lc-mute}{-1}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
−2\htmlClass{lc-mute}{-2}
2\htmlClass{lc-mute}{2}
4\htmlClass{lc-mute}{4}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
Text solution
Fill each vertical columnBecause yy does not appear in dydx=x\slope{\frac{dy}{dx}} = x, every point in a vertical column has the exact same slope all the way up and down.
At x=0: dydx=0At x=1: dydx=1At x=2: dydx=2\displaystyle \begin{aligned} \text{At } x = 0: \ \slope{\frac{dy}{dx}} &= \slope{0} \\ \text{At } x = 1: \ \slope{\frac{dy}{dx}} &= \slope{1} \\ \text{At } x = 2: \ \slope{\frac{dy}{dx}} &= \slope{2} \end{aligned}
Connect the dashes into the family of curvesFollowing the dashes from left to right traces a vertical stack of parabolas, and starting at (0,1)(0, 1) picks out the single parabola passing through that point.
dydx\displaystyle \slope{\frac{dy}{dx}} =x  ⟹  y=12x2+C⏟vertical shift\displaystyle = x \implies \soln{y = \frac{1}{2}x^2} + \underbrace{C}_{\text{vertical shift}}
3

Drawing Slope Fields with Isoclines

Now let's bring yy into the equation alongside xx:

dydx\displaystyle \slope{\frac{dy}{dx}} =x−y\displaystyle = x - y

Here, neither the vertical columns nor the horizontal rows have matching slopes. To draw this field quickly, we find the isoclines, the curves where every dash has the exact same slope.

Drawing Slope Fields with Isoclines
dydx=x−y\htmlClass{lc-pink}{\dfrac{dy}{dx}} = x - y
−1\htmlClass{lc-mute}{-1}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
−1\htmlClass{lc-mute}{-1}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
Text solution
Where the slope is 0\slope{0}Set dydx=0\slope{\frac{dy}{dx}} = \slope{0} to find the line where every dash is completely flat.
x−y\displaystyle x - y =0  ⟹  y=x⏟isocline for slope 0\displaystyle = \slope{0} \implies \underbrace{y = x}_{\text{isocline for slope } \slope{0}}
Where the slope is 1\slope{1}Set dydx=1\slope{\frac{dy}{dx}} = \slope{1} to find the line where every dash tilts up at slope 1\slope{1}, pointing right along the line itself.
x−y\displaystyle x - y =1  ⟹  y=x−1⏟isocline for slope 1\displaystyle = \slope{1} \implies \underbrace{y = x - 1}_{\text{isocline for slope } \slope{1}}
Where the slope is −1\slope{-1}Set dydx=−1\slope{\frac{dy}{dx}} = \slope{-1} to find the line where every dash tilts down at slope −1\slope{-1}.
x−y\displaystyle x - y =−1  ⟹  y=x+1⏟isocline for slope −1\displaystyle = \slope{-1} \implies \underbrace{y = x + 1}_{\text{isocline for slope } \slope{-1}}

For dydx=x−y\slope{\frac{dy}{dx}} = x - y, every point on the diagonal line y=x−my = x - \slope{m} has the exact same dash slope m\slope{m}. The dashes are completely flat along y=xy = x and point right along the line itself at y=x−1y = x - 1.

Every point on a diagonal line shares the same slope, and on just one diagonal the dashes point right along the line itself.
4

Tracing Solution Curves and Asymptotes

Once we have the slope field for dydx=x−y\slope{\frac{dy}{dx}} = x - y, we can trace the solution curve from any starting point (x0,y0)(x_0, y_0) and see where the dashes guide it as xx grows.

Tracing Solution Curves and Asymptotes
dydx=x−y\htmlClass{lc-pink}{\dfrac{dy}{dx}} = x - y
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
y=xy = x
y=x+1y = x + 1
y=x−1y = x - 1
Text solution
Straight-line solutionBecause the isocline y=x−1y = x - 1 is a line of slope 11 whose dashes also have slope 1\slope{1}, starting on this line guides the curve straight along it forever.
dydx\displaystyle \slope{\frac{dy}{dx}} =x−(x−1)\displaystyle = x - \soln{(x - 1)} =1\displaystyle = \slope{1}
Local minimum along y=xy = xStarting at (−1,2)(-1, 2) above y=xy = x, the curve falls while x−y<0x - y < 0, flattens out at a local minimum right where it crosses the zero-slope line y=xy = x, and then rises once x−y>0x - y > 0.
Along y\displaystyle \text{Along } y =x:dydx\displaystyle = x: \quad \slope{\frac{dy}{dx}} =x−x\displaystyle = x - x =0\displaystyle = \slope{0}
Diagonal asymptote along y=x−1\soln{y = x - 1}As xx increases, curves starting either above or below y=x−1\soln{y = x - 1} bend toward slope 1\slope{1} and get pulled closer and closer to y=x−1\soln{y = x - 1} without ever touching it.
y=x−1+Ce−x⏟→0 as x→∞\displaystyle \soln{y = x - 1} + \underbrace{\gapterm{Ce^{-x}}}_{\to 0 \text{ as } x \to \infty}

Curves starting above y=xy = x flatten out at a local minimum right as they cross y=xy = x, and all curves bend toward the straight-line solution y=x−1\soln{y = x - 1} as xx grows. A curve that starts off y=x−1\soln{y = x - 1} never touches or crosses it, because for C≠0C \neq 0 the gap Ce−x\gapterm{Ce^{-x}} between the curve and the line is never zero.

Every curve above the straight-line solution hits a flat minimum right where it crosses the upper diagonal line, and every curve gets closer and closer to that straight-line solution as you move right.
5

Equilibrium Solutions and Stability

Now consider an equation that depends only on yy, with no xx at all:

dydx\displaystyle \slope{\frac{dy}{dx}} =y(2−y)\displaystyle = y(2 - y)

Here we want to find the equilibrium solutions, which are the flat horizontal lines that are constant solutions to the equation, and see whether nearby curves get pulled into them or pushed away.

Equilibrium Solutions and Stability
dydx=y(2−y)\htmlClass{lc-pink}{\dfrac{dy}{dx}} = y(2 - y)
−2\htmlClass{lc-mute}{-2}
−1\htmlClass{lc-mute}{-1}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
−1\htmlClass{lc-mute}{-1}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
Text solution
Find the equilibrium solutionsSet dydx=0\slope{\frac{dy}{dx}} = \slope{0} to find the horizontal rows where every dash is flat all the way across.
y(2−y)\displaystyle y(2 - y) =0  ⟹  y=0 and y=2⏟equilibrium solutions\displaystyle = \slope{0} \implies \underbrace{\soln{y = 0} \text{ and } \soln{y = 2}}_{\text{equilibrium solutions}}
Test the sign in each horizontal bandPick one test value of yy in each band to see whether the dashes tilt up or down.
At y=−1: dydx=−3<0At y=1: dydx=+1>0At y=3: dydx=−3<0\displaystyle \begin{aligned} \text{At } y = -1: \ \slope{\frac{dy}{dx}} &= \slope{-3} < 0 \\ \text{At } y = 1: \ \slope{\frac{dy}{dx}} &= \slope{+1} > 0 \\ \text{At } y = 3: \ \slope{\frac{dy}{dx}} &= \slope{-3} < 0 \end{aligned}
Classify each equilibriumBecause dashes on both sides of y=2\soln{y = 2} point toward y=2\soln{y = 2} while dashes on both sides of y=0\soln{y = 0} point away from y=0\soln{y = 0}, curves move toward 2\soln{2} and move away from 0\soln{0}.
y=2⏟stable equilibriumy=0⏟unstable equilibrium\displaystyle \underbrace{\soln{y = 2}}_{\text{stable equilibrium}} \qquad \qquad \underbrace{\soln{y = 0}}_{\text{unstable equilibrium}}

Starting even slightly off y=0\soln{y = 0} sends the curve away from 0\soln{0}, while curves on both sides of y=2\soln{y = 2} get pulled into y=2\soln{y = 2}. And because the slope depends only on yy, moving the starting point horizontally only shifts the curve left or right.

Nudging off the bottom flat line sends the curve away, nudging off the top one pulls it back in, and moving sideways only slides the same curve left or right.
6

Matching Equations to Slope Fields

Putting these patterns together lets us match differential equations to their slope fields in seconds without plotting a grid of points.

Matching Equations to Slope Fields
1. dydx=x−11.\ \htmlClass{lc-pink}{\dfrac{dy}{dx}} = x - 1
2. dydx=1−y2.\ \htmlClass{lc-pink}{\dfrac{dy}{dx}} = 1 - y
3. dydx=x+y3.\ \htmlClass{lc-pink}{\dfrac{dy}{dx}} = x + y
4. dydx=xy4.\ \htmlClass{lc-pink}{\dfrac{dy}{dx}} = xy
A\textbf{A}
B\textbf{B}
C\textbf{C}
D\textbf{D}
A\textbf{A}
x=0x = 0
y=0y = 0
B\textbf{B}
x=1x = 1
C\textbf{C}
y=−xy = -x
D\textbf{D}
y=1y = 1
Text solution
Check whether the equation has only xx or only yyAn equation with only xx has identical vertical columns, and an equation with only yy has identical horizontal rows.
dydx=x−1  ⟹  Field B (flat column at x=1)dydx=1−y  ⟹  Field D (flat row at y=1)\displaystyle \begin{aligned} \slope{\frac{dy}{dx}} = x - 1 &\implies \text{Field B (flat column at } x = 1\text{)} \\ \slope{\frac{dy}{dx}} = 1 - y &\implies \text{Field D (flat row at } y = 1\text{)} \end{aligned}
Find where the slope is zeroFor the equations with both xx and yy, set dydx=0\slope{\frac{dy}{dx}} = \slope{0} to see where the flat dashes must be.
dydx=xy=0  ⟹  x=0 or y=0 (Field A)dydx=x+y=0  ⟹  y=−x (Field C)\displaystyle \begin{aligned} \slope{\frac{dy}{dx}} = xy = \slope{0} &\implies x = 0 \text{ or } y = 0 \text{ (Field A)} \\ \slope{\frac{dy}{dx}} = x + y = \slope{0} &\implies y = -x \text{ (Field C)} \end{aligned}
Verify with one test pointCheck the sign of the slope at (−2,1)(-2, 1) in the second quadrant to confirm which way the dashes tilt.
At (−2,1):dydx\displaystyle \text{At } (-2, 1): \quad \slope{\frac{dy}{dx}} =(−2)(1)\displaystyle = (-2)(1) =−2<0 (tilts down in Field A)\displaystyle = \slope{-2} < 0 \text{ (tilts down in Field A)}

Key concepts

Before plugging in points to draw or match a slope field, look at which variables appear on the right-hand side of dydx\slope{\frac{dy}{dx}}:

Only xx appears

(such as dydx=x−1\slope{\frac{dy}{dx}} = x - 1): You don't need isoclines or a slope field to find the curves. You can integrate directly, and on the grid every vertical column has identical dashes.

Only yy appears

(such as dydx=y(2−y)\slope{\frac{dy}{dx}} = y(2 - y)): Every horizontal row has identical dashes. Set dydx=0\slope{\frac{dy}{dx}} = \slope{0} to find the flat horizontal equilibrium solutions (y=0\soln{y = 0} and y=2\soln{y = 2}), then check the sign of dydx\slope{\frac{dy}{dx}} in the bands between them: slopes pointing in from both sides mean a stable equilibrium (y=2\soln{y = 2}), while slopes pointing away mean an unstable equilibrium (y=0\soln{y = 0}).

Both xx and yy appear

(such as dydx=x−y\slope{\frac{dy}{dx}} = x - y): Set dydx=m\slope{\frac{dy}{dx}} = \slope{m} to find the isocline where all dashes have slope m\slope{m}. Always start with m=0\slope{m} = \slope{0} (x−y=0  ⟹  y=xx - y = \slope{0} \implies y = x) to find the flat dashes where solution curves can have local minimums or maximums. If an isocline for slope m\slope{m} is itself a straight line of slope mm (y=x−1\soln{y = x - 1} for m=1\slope{m} = \slope{1}), the dashes point right along the line, making it an exact straight-line solution that other curves never cross (for dydx=x−y\slope{\frac{dy}{dx}} = x - y, other curves also approach it as an asymptote as xx grows).

7

Practice

1

For the differential equation dydx=2x+y−1\slope{\frac{dy}{dx}} = 2x + y - 1, find the slope of the dash at (−1,4)(-1, 4), (0,1)(0, 1), and (1,1)(1, 1), and find the equation of the line along which all dashes in the slope field are horizontal.

After plugging each (x,y)(x, y) pair into 2x+y−12x + y - 1, ask what value dydx\slope{\frac{dy}{dx}} must have wherever dashes are horizontal.

Plugging in each point gives:
At (−1,4): dydx=2(−1)+4−1=1At (0,1): dydx=2(0)+1−1=0At (1,1): dydx=2(1)+1−1=2\displaystyle \begin{aligned} \text{At } (-1, 4): \ \slope{\frac{dy}{dx}} &= 2(-1) + 4 - 1 = \slope{1} \\ \text{At } (0, 1): \ \slope{\frac{dy}{dx}} &= 2(0) + 1 - 1 = \slope{0} \\ \text{At } (1, 1): \ \slope{\frac{dy}{dx}} &= 2(1) + 1 - 1 = \slope{2} \end{aligned}
To find where all dashes are horizontal, set the slope dydx=0\slope{\frac{dy}{dx}} = \slope{0}. Be careful not to plug in y=0y = 0, which only finds the xx-intercept and gives x=12x = \frac{1}{2}:
2x+y−1\displaystyle 2x + y - 1 =0  ⟹  y\displaystyle = \slope{0} \implies y =−2x+1\displaystyle = -2x + 1
The slopes are 11 at (−1,4)(-1, 4), 00 at (0,1)(0, 1), and 22 at (1,1)(1, 1), and all dashes are horizontal along the line y=−2x+1y = -2x + 1.
2

A slope field has slopes that change across both vertical columns and horizontal rows, has horizontal dashes along both the xx-axis (y=0y = 0) and the vertical line x=2x = 2, and has upward-tilting dashes in the region where x>2x > 2 and y<0y < 0. Which equation matches this field: (A) dydx=x−2\slope{\frac{dy}{dx}} = x - 2, (B) dydx=y(x−2)\slope{\frac{dy}{dx}} = y(x - 2), (C) dydx=−y(x−2)\slope{\frac{dy}{dx}} = -y(x - 2), or (D) dydx=x+y−2\slope{\frac{dy}{dx}} = x + y - 2?

First check which equations equal 0\slope{0} along the entire line y=0y = 0 and along the entire line x=2x = 2, then test one point in the region where x>2x > 2 and y<0y < 0.

Because the slopes change across both columns and rows, both xx and yy must appear in the equation (ruling out A). Setting dydx=0\slope{\frac{dy}{dx}} = \slope{0} must give the two lines y=0y = 0 and x=2x = 2, which needs the factored form y(x−2)=0y(x - 2) = \slope{0} rather than x+y−2=0x + y - 2 = \slope{0} (ruling out D). Now test (3,−1)(3, -1) in the region x>2x > 2 and y<0y < 0. Don't forget that yy is negative here, or you will pick (B), which gives (−1)(3−2)=−1(-1)(3 - 2) = -1 instead of a positive slope:
At (3,−1):dydx\displaystyle \text{At } (3, -1): \quad \slope{\frac{dy}{dx}} =−(−1)(3−2)\displaystyle = -(-1)(3 - 2) =+1>0\displaystyle = \slope{+1} > 0
The matching equation is (C) dydx=−y(x−2)\slope{\frac{dy}{dx}} = -y(x - 2).
3

For the differential equation dydx=(y−1)(y−4)\slope{\frac{dy}{dx}} = (y - 1)(y - 4), find all equilibrium solutions, classify each as stable or unstable, and find what value y(x)\soln{y(x)} approaches as x→∞x \to \infty if y(0)=2y(0) = 2 and if y(0)=0y(0) = 0.

Set dydx=0\slope{\frac{dy}{dx}} = 0 to find the horizontal equilibrium lines, then test one yy-value in each of the three horizontal bands they create.

Setting (y−1)(y−4)=0(y - 1)(y - 4) = \slope{0} gives the equilibrium solutions y=1\soln{y = 1} and y=4\soln{y = 4}. Testing the three horizontal bands:
For y<1y < 1 (test y=0y = 0): (0−1)(0−4)=+4>0(0 - 1)(0 - 4) = \slope{+4} > 0 (Watch out: both factors are negative when y<1y < 1, so their product is positive. Missing the double negative flips the sign to −4-4 and makes the y(0)=0y(0) = 0 curve go down toward −∞-\infty.)
For 1<y<41 < y < 4 (test y=2y = 2): (2−1)(2−4)=−2<0(2 - 1)(2 - 4) = \slope{-2} < 0
For y>4y > 4 (test y=5y = 5): (5−1)(5−4)=+4>0(5 - 1)(5 - 4) = \slope{+4} > 0 Because curves rise for y<1y < 1 and fall for 1<y<41 < y < 4, curves on both sides get pulled into y=1\soln{y = 1}, while curves on both sides of y=4\soln{y = 4} move away from it. The equilibrium y=1\soln{y = 1} is stable, y=4\soln{y = 4} is unstable, and both y(0)=2y(0) = 2 and y(0)=0y(0) = 0 approach 11.
4

A solution curve y(x)\soln{y(x)} to dydx=x2−y\slope{\frac{dy}{dx}} = x^2 - y passes through the point (2,4)(2, 4). Does the solution curve have a local minimum, a local maximum, or neither at (2,4)(2, 4)? Justify your answer using the slope field.

After checking that the slope is 0\slope{0} at (2,4)(2, 4), check the sign of x2−yx^2 - y along the flat path just to the left and just to the right of x=2x = 2.

At (2,4)(2, 4), the curve crosses the zero-isocline y=x2y = x^2, so the slope is:
dydx\displaystyle \slope{\frac{dy}{dx}} =22−4\displaystyle = 2^2 - 4 =0\displaystyle = \slope{0}
Because the curve is flat at (2,4)(2, 4), yy stays near 44 on either side of x=2x = 2. Just to the left of x=2x = 2 (where x<2x < 2 and y≈4y \approx 4), x2<4x^2 < 4 so dydx=x2−y<0\slope{\frac{dy}{dx}} = x^2 - y < 0 and the dashes tilt downward; just to the right of x=2x = 2 (where x>2x > 2 and y≈4y \approx 4), x2>4x^2 > 4 so dydx=x2−y>0\slope{\frac{dy}{dx}} = x^2 - y > 0 and the dashes tilt upward (be careful not to confuse the upward curve of the parabola y=x2y = x^2 with the sign of x2−yx^2 - y, which would swap the signs and give a local maximum). Because the curve goes from falling to flat to rising, it has a local minimum at (2,4)(2, 4).
5

For the differential equation dydx=2x−y\slope{\frac{dy}{dx}} = 2x - y, find the exact straight-line solution by finding which isocline has dashes pointing directly along itself, then describe the path of the solution curve starting at (−1,1)(-1, 1) as xx increases.

Write the isocline for slope m\slope{m} as y=2x−my = 2x - \slope{m}, and look at the slope of that line to see what value m\slope{m} must equal.

Setting dydx=m\slope{\frac{dy}{dx}} = \slope{m} gives the isocline 2x−y=m2x - y = \slope{m}, or:
y\displaystyle y =2x−m\displaystyle = 2x - \slope{m}
Every isocline is a straight line of slope 22. For the dashes on the line to point directly along the line itself, the dash slope m\slope{m} must match the line slope 22. Don't set m=0m = 0 and call the zero-isocline y=2xy = 2x the straight-line solution, because along y=2xy = 2x the dashes are flat (m=0\slope{m} = \slope{0}) while the line has slope 22. Setting m=2\slope{m} = \slope{2} gives the straight-line solution y=2x−2\soln{y = 2x - 2}. Starting at (−1,1)(-1, 1), where the slope is 2(−1)−1=−32(-1) - 1 = \slope{-3}, the curve goes steeply downward, flattens out at a local minimum as it crosses the zero-isocline y=2xy = 2x, and then rises while approaching y=2x−2\soln{y = 2x - 2} from above as a diagonal asymptote.