A differential equation is an equation involving a function and its derivatives, such as $\dfrac{dy}{dx} = f(x, y)$. Rather than finding an explicit solution immediately, we can visualize the family of solutions using a slope field.
A slope field (or direction field) for $\dfrac{dy}{dx} = f(x, y)$ is drawn by computing the slope $f(x_0, y_0)$ at a grid of points $(x_0, y_0)$ and drawing a short line segment with that slope at each point.
Each solution curve $y(x)$ is tangent to the slope field at every point it passes through — the slope field encodes all solutions simultaneously.
Consider $\dfrac{dy}{dx} = y$. At any point $(x, y)$, the slope equals $y$.
The solution curves are $y = Ce^x$ for various constants $C$. A particular solution through $(0, 1)$ gives $C = 1$, so $y = e^x$.
AP Exam Tip: On the AP exam, slope field questions typically ask you to: (1) match a slope field to a DE, (2) sketch a solution curve through a given point, or (3) determine which slope field matches a given DE. Key strategy: check special lines — what happens along $y=0$? Along $x=0$? Along $y=x$? These "zero-slope" or "unit-slope" lines narrow down the answer quickly.
Slope field for $dy/dx = y$ — the solution curves are exponentials $y = Ce^x$. Notice how the slopes get steeper as $|y|$ increases.
Figure 9.1 — Slope Field for $\dfrac{dy}{dx} = y$ with solution curves
A differential equation is separable if it can be written as $\dfrac{dy}{dx} = g(x) \cdot h(y)$ — functions of $x$ and $y$ fully separated. We solve by moving all $y$ terms to one side and $x$ terms to the other, then integrating.
This is the most important separable DE. Separate: $\dfrac{dy}{y} = k\,dx$
Integrate: $\ln|y| = kx + C_1$
Solve: $|y| = e^{kx+C_1} = e^{C_1}e^{kx}$, so $y = Ce^{kx}$ where $C = \pm e^{C_1}$.
With initial condition $y(0) = y_0$: $y = y_0 e^{kx}$.
If $k > 0$: exponential growth. If $k < 0$: exponential decay (e.g., radioactive decay).
Solve $\dfrac{dy}{dx} = \dfrac{x}{y}$ with $y(0) = 3$.
Separate: $y\,dy = x\,dx$
Integrate: $\dfrac{y^2}{2} = \dfrac{x^2}{2} + C$, so $y^2 = x^2 + K$ where $K = 2C$.
Apply IC: $9 = 0 + K \Rightarrow K = 9$. Solution: $y = \sqrt{x^2 + 9}$ (positive branch since $y(0)=3>0$).
Solve $\dfrac{dy}{dx} = -2xy$ with $y(0) = 5$.
When a DE can't be solved analytically, Euler's method approximates the solution numerically by stepping along tangent lines from an initial point.
Given $\dfrac{dy}{dx} = f(x,y)$ with initial condition $y(x_0) = y_0$ and step size $h$:
$$x_{n+1} = x_n + h \qquad y_{n+1} = y_n + h \cdot f(x_n, y_n)$$
Each step uses the current slope to predict the next $y$ value. Smaller $h$ gives more accuracy but requires more steps.
Use $y(0) = 1$, step size $h = 0.5$. Approximate $y(1)$.
| $n$ | $x_n$ | $y_n$ | $f(x_n, y_n) = x_n + y_n$ | $y_{n+1} = y_n + 0.5f$ |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 1.5 |
| 1 | 0.5 | 1.5 | 2 | 2.5 |
| 2 | 1.0 | 2.5 | — | — |
Euler approximation: $y(1) \approx 2.5$. (Actual solution is $y = 2e^x - x - 1$; exact value $y(1) = 2e - 2 \approx 3.436$. Error is large here because $h=0.5$ is big.)
AP Exam Tip: Euler's method problems on the AP exam usually use 2–4 steps with a given step size and ask you to fill in a table or state whether the approximation is an overestimate or underestimate. If $f$ is increasing (concave up), Euler underestimates. If $f$ is decreasing (concave down), Euler overestimates.
Euler's method with $dy/dx = x+y$, $y(0)=1$. Adjust the step size $h$ to see how accuracy improves as steps get smaller.
Figure 9.2 — Euler's Method vs. Exact Solution for $dy/dx = x + y$
Exponential growth $\dfrac{dP}{dt} = kP$ is unrealistic for populations — resources limit growth. The logistic model adds a carrying capacity $M$:
$$\frac{dP}{dt} = kP\left(1 - \frac{P}{M}\right) \quad \text{or equivalently} \quad \frac{dP}{dt} = kP(M-P)/M$$
where $M$ is the carrying capacity (maximum sustainable population) and $k > 0$.
Behavior:
Solution: $P(t) = \dfrac{M}{1 + Ae^{-kt}}$ where $A = \dfrac{M - P_0}{P_0}$.
Maximum growth rate occurs at $P = M/2$ (inflection point of $P(t)$).
A lake can support 1000 fish ($M = 1000$). Currently $P_0 = 100$, and $k = 0.2$. Find $P(t)$ and when the population reaches 500.
$A = \dfrac{1000-100}{100} = 9$, so $P(t) = \dfrac{1000}{1 + 9e^{-0.2t}}$
Set $P = 500$: $500 = \dfrac{1000}{1+9e^{-0.2t}} \Rightarrow 1 + 9e^{-0.2t} = 2 \Rightarrow e^{-0.2t} = \dfrac{1}{9}$
$t = \dfrac{\ln 9}{0.2} = 5\ln 9 \approx 10.99$ years.
Note: $P = 500 = M/2$ is where growth is fastest — this is the inflection point.
For $\dfrac{dP}{dt} = 0.3P\!\left(1 - \dfrac{P}{500}\right)$ with $P(0) = 50$: What is the carrying capacity? At what population is the growth rate maximum?
Logistic growth: population $P(t)$ approaches carrying capacity $M$ as an S-curve. Adjust $k$ and $M$ with the sliders to see how they affect the growth.
Figure 9.3 — Logistic Growth Model: S-curve approaching carrying capacity $M$
For the slope field of $\dfrac{dy}{dx} = x - y$, what is the slope at $(2, 1)$? At $(0, 0)$? Sketch a solution curve through $(0, 1)$.
Solve the initial value problem $\dfrac{dy}{dx} = \dfrac{2x}{y}$, $y(1) = 4$.
A sample of radioactive material decays at rate $\dfrac{dA}{dt} = -0.05A$. If initially $A(0) = 200$ grams, find $A(t)$ and the half-life.
Use Euler's method with $h = 0.25$ to approximate $y(0.5)$ for $\dfrac{dy}{dx} = x^2 + y$, $y(0) = 1$.
A population grows logistically with $M = 2000$, $k = 0.1$, and $P(0) = 400$. Find $P(t)$ and the time when $P = 1000$.
Identify the equilibrium solutions of $\dfrac{dy}{dx} = y^2(y-4)$ and classify each as stable or unstable.
Solve $\dfrac{dy}{dx} = \dfrac{y\cos x}{1+2y^2}$.
(AP Style) For $\dfrac{dP}{dt} = 0.4P\!\left(1-\dfrac{P}{800}\right)$: (a) What are the equilibrium solutions? (b) At what value of $P$ is $dP/dt$ greatest? (c) For what values of $P$ is the population increasing?
An equation relating a function $y$ with its derivatives. A solution is a function $y = f(x)$ satisfying the equation.
$\dfrac{dy}{dx} = g(x)h(y)$ — separate variables: $\dfrac{dy}{h(y)} = g(x)\,dx$, then integrate both sides.
A visual representation of $\frac{dy}{dx}$ at points $(x,y)$. Draw short segments with slope $f(x,y)$ at each point to sketch solution curves.
$\dfrac{dP}{dt} = kP\!\left(1-\dfrac{P}{M}\right)$ — population grows toward carrying capacity $M$. Solution has an S-shaped curve.
$\dfrac{dy}{dt} = ky$ has solution $y = Ce^{kt}$. Growth if $k>0$, decay if $k<0$.
$y_{n+1} = y_n + h \cdot f(x_n, y_n)$ — approximates solution using step size $h$ from initial condition $(x_0, y_0)$.
$t_{1/2} = \dfrac{\ln 2}{k}$ — time for exponential decay to reduce $y$ to half its value.
$P(t) = \dfrac{M}{1 + Ae^{-kt}}$ where $A = \dfrac{M - P_0}{P_0}$ and $M$ is the carrying capacity.