Book a session
Home / Subjects / Mathematics / AP Calculus AB / Differential Equations and Slope Fields
Differential Equations

Differential Equations and Slope Fields

Read a slope field, separate variables, and solve growth, decay and cooling problems.

The big idea

A differential equation relates a function to its own rate of change. A slope field draws the slope at every point so you can see the family of solutions. If you can get all the y terms on one side and all the x terms on the other, you can integrate both sides and solve it.

Key ideas

  • A slope field shows a short line of slope dy/dx at each point. Solution curves follow the lines.
  • Separation: move every y (with dy) to one side and every x (with dx) to the other, then integrate.
  • Use the initial condition to find the constant, then solve for y.
  • dy/dt = ky has the solution y = y0ekt: exponential growth (k > 0) or decay (k < 0).
  • Newton's law of cooling: the temperature difference from the surroundings decays exponentially.

Equations

dy/dx = f(x)g(y) ⇒ ∫ dy/g(y) = ∫ f(x) dxseparation of variables
dy/dt = ky ⇒ y = y0ektexponential growth and decay
t1/2 = (ln 2)/|k|half-life or doubling time
T − Ts = (T0 − Ts)e−ktNewton's law of cooling

Worked questions: easy, medium, hard

Three questions that climb in difficulty, each solved one step at a time. Try each one before you read the steps.

Easy

Solve dy/dx = 3x2 with y(0) = 2.

  1. Integrate: y = x3 + C.
  2. Use y(0) = 2: C = 2.
  3. y = x3 + 2.
Answer: y = x³ + 2.
Medium

Solve dy/dx = xy with y(0) = 3.

  1. Separate: dy/y = x dx.
  2. Integrate: ln|y| = x2/2 + C.
  3. Exponentiate: y = Aex2/2.
  4. y(0) = 3 gives A = 3: y = 3ex2/2.
Answer: y = 3ex²/2.
Hard

Coffee at 90 °C sits in a 20 °C room. After 5 minutes it is at 70 °C. What is its temperature after 15 minutes?

  1. Newton's law: T − 20 = (90 − 20)e−kt = 70e−kt.
  2. At t = 5: 50 = 70e−5k, so e−5k = 5/7.
  3. At t = 15: e−15k = (5/7)3 = 0.364.
  4. T = 20 + 70(0.364) = 45.5 °C.
Answer: About 45.5 °C.

Common mistakes

  • Adding + C after solving for y instead of straight after integrating.
  • Forgetting the absolute value and the constant when exponentiating ln|y|.
  • Using the temperature itself rather than the difference from room temperature in cooling problems.

Now you try: easy to hard

Six more questions, two at each level. These are the questions on the worksheet; each solution opens when you are ready.

Easy 1. Solve dy/dx = cos x with y(0) = 1.

Show the step-by-step solution

y = sin x + C, and y(0) = 1 gives C = 1. y = sin x + 1.

Easy 2. For dy/dx = x − y, find the slope at (2, 1) and describe where the slopes are zero.

Show the step-by-step solution

Slope = 2 − 1 = 1. Slopes are zero where x − y = 0, along the line y = x.

Medium 3. Solve dy/dx = y2 with y(0) = 1.

Show the step-by-step solution

Separate: y−2 dy = dx. Integrate: −1/y = x + C. y(0) = 1 gives C = −1. So −1/y = x − 1 and y = 1/(1 − x).

Medium 4. A population obeys dP/dt = kP. It grows from 500 to 1000 in 4 hours. Find the population after 10 hours.

Show the step-by-step solution

It doubles every 4 hours, so P = 500 · 2t/4. P(10) = 500 · 22.5 ≈ 2828.

Hard 5. Solve dy/dx = x/y with y(0) = −2.

Show the step-by-step solution

Separate: y dy = x dx. Integrate: y2/2 = x2/2 + C, so y2 = x2 + 4 after using y(0) = −2. The initial value is negative, so take the negative root: y = −√(x2 + 4).

Hard 6. Solve dy/dx = 2x(1 + y2) with y(0) = 0.

Show the step-by-step solution

Separate: dy/(1 + y2) = 2x dx. Integrate: tan−1 y = x2 + C. y(0) = 0 gives C = 0. y = tan(x2).

Worksheet for this lesson

6 questions to print or save, with full step-by-step answers at the end.

See it in action

Open the Slope Fields & Euler's Method simulation and test every idea on this page yourself.

Open the simulation →