Math Core

Lesson 3.1 · Differential Equations

Slope fields and separable equations review

A differential equation tells you how a quantity changes instead of telling you the quantity itself. Before this unit adds Euler's method and logistic growth, this lesson reviews the AB toolkit you will lean on constantly: reading slope fields, checking solutions, and solving separable equations with an initial condition.

Differential equations and their solutions

A differential equation is an equation that involves a derivative, such as dydx=x−y\dfrac{dy}{dx} = x - y or dPdt=0.3P\dfrac{dP}{dt} = 0.3P. A solution is a function that makes the equation true for every xx in an interval.

To check a proposed solution, differentiate it and substitute. For example, is y=x−1y = x - 1 a solution of dydx=x−y\dfrac{dy}{dx} = x - y? The left side is dydx=1\dfrac{dy}{dx} = 1. The right side is x−(x−1)=1x - (x - 1) = 1. The two sides match for every xx, so yes.

A differential equation usually has a whole family of solutions, called the general solution, that differ by a constant CC. An initial condition such as y(0)=3y(0) = 3 picks out one member of the family: the particular solution.

Slope fields

You can see the solutions of dydx=f(x,y)\dfrac{dy}{dx} = f(x, y) without solving anything. At each point (x,y)(x, y), the equation gives the slope a solution curve must have if it passes through that point. Draw a short segment with that slope at each point of a grid, and you get a slope field.

Definition

Slope field

A slope field for dydx=f(x,y)\dfrac{dy}{dx} = f(x, y) is a grid of short line segments. The segment at (x,y)(x, y) has slope f(x,y)f(x, y). Every solution curve is tangent to the segments it passes through.

Here is the slope field for dydx=x−y\dfrac{dy}{dx} = x - y, together with the particular solution y=x−1y = x - 1 (dashed). Notice how the dashed line runs along the segments instead of cutting across them.

Slope field for dy/dx = x − y with the solution y = x − 1 dashed.Open in grapher →

To read or match a slope field, look for patterns rather than computing every segment:

  • Where are the segments horizontal? Those points satisfy f(x,y)=0f(x, y) = 0. For dydx=x−y\dfrac{dy}{dx} = x - y that is the line y=xy = x.
  • Do the slopes depend on xx only, yy only, or both? If dydx\dfrac{dy}{dx} depends only on xx, every vertical column of segments is identical. If it depends only on yy (an autonomous equation), every horizontal row is identical.
  • Where are slopes positive or negative? Check a few convenient points, such as points on the axes.

Separation of variables

When the right side factors into a function of xx times a function of yy, the equation is separable and you can solve it exactly.

Solving a separable equation

For dydx=g(x) h(y)\dfrac{dy}{dx} = g(x)\,h(y):

  1. Separate: move every yy to the side with dydy and every xx to the side with dxdx: 1h(y) dy=g(x) dx\dfrac{1}{h(y)}\,dy = g(x)\,dx.
  2. Integrate both sides, and add one constant CC.
  3. Use the initial condition to find CC right away.
  4. Solve for yy if possible, and choose the sign or branch that matches the initial condition.

On the AP exam, a separable-equation free-response part is scored step by step. Separating the variables correctly earns the first point, and you can't earn later points without it, so write the separated form clearly.

Worked example: A square-root solution

Find the particular solution of dydx=2xy\dfrac{dy}{dx} = \dfrac{2x}{y} with y(0)=3y(0) = 3.

Solution. Separate: y dy=2x dxy\,dy = 2x\,dx. Integrate:

y22=x2+C.\frac{y^2}{2} = x^2 + C.

Substitute x=0x = 0, y=3y = 3: 92=C\dfrac{9}{2} = C. So y2=2x2+9y^2 = 2x^2 + 9. Taking square roots gives y=±2x2+9y = \pm\sqrt{2x^2 + 9}. Because y(0)=3y(0) = 3 is positive, choose the positive root:

y=2x2+9.y = \sqrt{2x^2 + 9}.

Worked example: An exponential of a trig function

Solve dydx=ycos⁡x\dfrac{dy}{dx} = y\cos x with y(0)=2y(0) = 2.

Solution. Separate: 1y dy=cos⁡x dx\dfrac{1}{y}\,dy = \cos x\,dx. Integrate: ln⁡∣y∣=sin⁡x+C\ln\lvert y \rvert = \sin x + C. At x=0x = 0: ln⁡2=0+C\ln 2 = 0 + C, so C=ln⁡2C = \ln 2. Then

∣y∣=esin⁡x+ln⁡2=2esin⁡x.\lvert y \rvert = e^{\sin x + \ln 2} = 2e^{\sin x}.

Since y(0)=2>0y(0) = 2 \gt 0, drop the absolute value: y=2esin⁡xy = 2e^{\sin x}. Check: dydx=2esin⁡xcos⁡x=ycos⁡x\dfrac{dy}{dx} = 2e^{\sin x}\cos x = y\cos x.

Common mistake

Add the constant when you integrate, not after you solve for yy. Writing ln⁡∣y∣=sin⁡x\ln\lvert y \rvert = \sin x and then tacking on "+C+ C" at the end as y=esin⁡x+Cy = e^{\sin x} + C gives the wrong family. The constant becomes a multiplier after you exponentiate, because esin⁡x+C=eCesin⁡xe^{\sin x + C} = e^C e^{\sin x}.

Exponential growth and decay

The most important separable equation is dydt=ky\dfrac{dy}{dt} = ky: the rate of change is proportional to the amount present. Separating gives ln⁡∣y∣=kt+C\ln\lvert y \rvert = kt + C, so

y=y0ekt,y = y_0 e^{kt},

where y0=y(0)y_0 = y(0). If k>0k \gt 0 you get exponential growth; if k<0k \lt 0, exponential decay.

Worked example: Finding k from a half-life

A radioactive substance decays at a rate proportional to the amount present. Its half-life is 6 years. What fraction of the original sample remains after 15 years?

Solution. The amount is A=A0ektA = A_0 e^{kt}. After 6 years, half remains: e6k=12e^{6k} = \dfrac{1}{2}, so k=ln⁡(1/2)6=−ln⁡26k = \dfrac{\ln(1/2)}{6} = -\dfrac{\ln 2}{6}. After 15 years,

A(15)A0=e15k=e−15ln⁡2/6=2−2.5≈0.177.\frac{A(15)}{A_0} = e^{15k} = e^{-15\ln 2/6} = 2^{-2.5} \approx 0.177.

About 17.7%17.7\% of the sample remains.

Tip

Always check a particular solution twice: plug in the initial condition, and differentiate to make sure the equation holds. Both checks take under a minute and catch most sign errors.

Practice

Practice 1

Which differential equation could have the slope field shown?

A slope field on the grid −2 ≤ x ≤ 2, −2 ≤ y ≤ 2.Open in grapher →
Practice 2

For dydx=x2−2y\dfrac{dy}{dx} = x^2 - 2y, find the slope of the slope-field segment at the point (3,1)(3, 1).

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

Practice 3

Which function is a solution of dydx=x+y\dfrac{dy}{dx} = x + y?

Practice 4

Find the particular solution y=f(x)y = f(x) of dydx=3x2y\dfrac{dy}{dx} = 3x^2 y with f(0)=5f(0) = 5.

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

Practice 5

Find the particular solution of dydx=xy\dfrac{dy}{dx} = \dfrac{x}{y} with y(0)=−2y(0) = -2.

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

Practice 6

Find the particular solution of dydx=ex−y\dfrac{dy}{dx} = e^{x - y} with y(0)=ln⁡2y(0) = \ln 2.

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

Practice 7

A bacteria population grows at a rate proportional to its size. It starts at 200 and doubles every 5 hours. To the nearest whole number, what is the population after 12 hours?

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