Calculus · Grade 12 and undergraduate

Differential Equations and Slope Fields

Quick answer

A differential equation relates a function to its derivatives, as dy/dx = 2y does. A solution is a function that makes the equation true, which can be checked by substituting it in. Most equations have a whole family of solutions, the general solution; an initial condition picks one particular solution. A slope field draws the slope the equation assigns at each point, so every solution curve can be seen threading through it, and horizontal rows of flat marks reveal equilibrium solutions.

What you'll learn

  • Write differential equations that model rates of change
  • Verify that a function solves a differential equation
  • Find a particular solution from an initial condition
  • Sketch and read slope fields, including equilibrium solutions

Equations about rates

Many laws describe how a quantity changes rather than what it is:

  • A population grows at a rate proportional to its size: dPdt=kP\tfrac{dP}{dt} = kP.
  • A falling object’s velocity changes at a constant rate: dvdt=−9.8\tfrac{dv}{dt} = -9.8.
  • A cup of coffee cools at a rate proportional to its difference from the room’s temperature: dTdt=−k(T−20)\tfrac{dT}{dt} = -k(T - 20).

Each is a differential equation: an equation involving an unknown function and its derivatives. Solving it means finding the function.

Solutions and how to check them

A solution is a function that makes the equation true. To check one, substitute it and its derivative.

For dydx=2y\tfrac{dy}{dx} = 2y, try y=Ce2xy = Ce^{2x}: the left side is 2Ce2x2Ce^{2x} and the right side is 2⋅Ce2x2 \cdot Ce^{2x}. They agree for every xx and every constant CC.

So y=Ce2xy = Ce^{2x} is the general solution, a whole family. An initial condition such as y(0)=3y(0) = 3 picks out one particular solution: 3=Ce03 = Ce^0 gives C=3C = 3, so y=3e2xy = 3e^{2x}.

Slope fields

A differential equation dydx=f(x,y)\tfrac{dy}{dx} = f(x, y) gives a slope at every point of the plane. A slope field draws that slope as a short segment at each point of a grid.

The slope field of dy/dx = x − y A grid of short segments with slope x minus y at each point: flat along the line y = x, steep and falling in the upper left, rising in the lower right. Two solution curves follow the segments, one through (0, 2) and one through (0, −2); both approach the line y = x − 1 as x grows. -3-2-1123-3-2-1123xy
  • through (0, 2)
  • through (0, −2)
The slope field of dy/dx = x − y

Why one picture shows every solution

A solution curve through a point must have, at that point, exactly the slope the equation prescribes. So wherever it goes, it runs along the marks, like a leaf carried by a current.

The field does not favor any one curve. Start anywhere, follow the marks, and you trace the solution through that starting point. The slope field is the differential equation drawn out, and every solution is a path along it. An initial condition is the choice of where to start.

Reading a slope field

  • Zero slopes: where f(x,y)=0f(x, y) = 0, the marks are flat. For dydx=x−y\tfrac{dy}{dx} = x - y, that happens along the line y=xy = x.
  • Equilibrium solutions: if a whole horizontal row of marks is flat, the constant function there is a solution. For dydx=y−1\tfrac{dy}{dx} = y - 1, the row y=1y = 1 is flat, so y=1y = 1 is an equilibrium.
  • Patterns: if the slope depends only on yy, every mark in a horizontal row is the same. If it depends only on xx, every mark in a vertical column is the same.

Worked examples

Common mistakes

Practice problems

  1. Verify that y=e−3xy = e^{-3x} solves dydx=−3y\tfrac{dy}{dx} = -3y.

    Answer

    It does: both sides equal −3e−3x-3e^{-3x}.

    Full solution

    dydx=−3e−3x\tfrac{dy}{dx} = -3e^{-3x}, and −3y=−3e−3x-3y = -3e^{-3x}. They agree for every xx.

  2. Find the particular solution of dydx=6x2\tfrac{dy}{dx} = 6x^2 with y(0)=5y(0) = 5.

    Answer

    y=2x3+5y = 2x^3 + 5

    Full solution

    The general solution is y=2x3+Cy = 2x^3 + C, and y(0)=C=5y(0) = C = 5.

  3. Is y=sin⁡xy = \sin x a solution of d2ydx2=−y\tfrac{d^2y}{dx^2} = -y?

    Answer

    Yes

    Full solution

    y′=cos⁡xy' = \cos x and y′′=−sin⁡x=−yy'' = -\sin x = -y.

  4. For dydx=x−y\tfrac{dy}{dx} = x - y, find the slope of the solution curve at (2,5)(2, 5).

    Answer

    −3-3

    Full solution

    Substitute: 2−5=−32 - 5 = -3.

  5. Find the equilibrium solutions of dydx=y(4−y)\tfrac{dy}{dx} = y(4 - y).

    Answer

    y=0y = 0 and y=4y = 4

    Full solution

    The slope is 00 for every xx exactly when y(4−y)=0y(4 - y) = 0.

  6. Which equation has a slope field whose marks are the same across each horizontal row: dydx=2x\tfrac{dy}{dx} = 2x or dydx=2y\tfrac{dy}{dx} = 2y?

    Answer

    dydx=2y\tfrac{dy}{dx} = 2y

    Full solution

    Along a horizontal row, yy is fixed. If the slope depends only on yy, the whole row shares one slope.

  7. A population satisfies dPdt=0.03P\tfrac{dP}{dt} = 0.03P. How fast is it growing when P=2000P = 2000?

    Answer

    6060 per unit of time

    Full solution

    0.03×2000=600.03 \times 2000 = 60.

  8. For dydx=x+y\tfrac{dy}{dx} = x + y, where are the slope field’s marks flat?

    Answer

    Along the line y=−xy = -x

    Full solution

    The slope is 00 when x+y=0x + y = 0.

  9. Show that y=20+70e−0.1ty = 20 + 70e^{-0.1t} solves dydt=−0.1(y−20)\tfrac{dy}{dt} = -0.1(y - 20) with y(0)=90y(0) = 90.

    Answer

    Both sides equal −7e−0.1t-7e^{-0.1t}, and y(0)=90y(0) = 90.

    Full solution

    dydt=70⋅(−0.1)e−0.1t=−7e−0.1t\tfrac{dy}{dt} = 70 \cdot (-0.1)e^{-0.1t} = -7e^{-0.1t}. And −0.1(y−20)=−0.1⋅70e−0.1t=−7e−0.1t-0.1(y - 20) = -0.1 \cdot 70e^{-0.1t} = -7e^{-0.1t}. At t=0t = 0, y=20+70=90y = 20 + 70 = 90.

  10. A student says the slope field of dydx=x\tfrac{dy}{dx} = x shows that the solution is the line y=xy = x. What went wrong?

    Hint

    Is xx the height or the slope?

    Answer

    The equation gives the slope, not the height. The solutions are y=x22+Cy = \tfrac{x^2}{2} + C.

    Full solution

    A solution must have slope xx at each point. The line y=xy = x has slope 11 everywhere, so it fails except where x=1x = 1.

    Antidifferentiating gives the family of parabolas y=x22+Cy = \tfrac{x^2}{2} + C.

Frequently asked questions

What is a differential equation?

An equation that involves an unknown function and its derivatives, such as dy/dx = 2y or dT/dt = −k(T − 20).

How do I check a solution?

Substitute the function and its derivative into the equation. If both sides agree for every x, it is a solution.

What is the difference between a general and a particular solution?

The general solution is the whole family, with an arbitrary constant such as C. A particular solution is the one member that also satisfies an initial condition.

What is a slope field?

A grid of short segments, each drawn with the slope the differential equation gives at that point. Solution curves follow the segments.

What is an equilibrium solution?

A constant solution, where dy/dx = 0 for every x. In a slope field it shows up as a horizontal row of flat marks.

What to learn next