Chapter 7: Differential Equations
Differential equations appear throughout science, engineering, and economics. On the AP Calculus exam, they represent a significant portion of the curriculum: slope fields and separation of variables are tested on both AB and BC, while Euler's method and logistic growth are BC-only topics. This chapter covers all differential equation content you need for a 5 on the exam.
7.1 Introduction to Differential Equations
What Is a Differential Equation?
A differential equation (DE) is any equation that contains one or more derivatives of an unknown function. Rather than asking "what is $y$?", a differential equation asks "what function $y$ has this relationship with its own derivative?"
Order and Degree
The order of a differential equation is the highest derivative that appears. The equation $\frac{dy}{dx} = x + y$ is first-order because the highest derivative is $\frac{dy}{dx}$. The equation $\frac{d^2y}{dx^2} + 3\frac{dy}{dx} = 0$ is second-order. On the AP exam, you will work exclusively with first-order equations.
General vs. Particular Solutions
The general solution of a differential equation contains an arbitrary constant $C$ and represents an entire family of curves. For instance, the general solution of $\frac{dy}{dx} = 2x$ is $y = x^2 + C$, which describes infinitely many parabolas, each shifted vertically by a different amount.
A particular solution is obtained by choosing a specific value of $C$, typically determined by an initial condition. If we know that $y(0) = 5$, then $5 = 0^2 + C$, giving $C = 5$ and the particular solution $y = x^2 + 5$.
Initial Value Problems (IVPs)
Initial value problems appear constantly on the AP exam. You will be given a DE and a point on the solution curve, and you must find the exact function. The general strategy is: solve the DE to obtain the general solution with constant $C$, then substitute the initial condition to determine $C$.
Solution. Integrate both sides with respect to $x$:
$$y = \int (6x^2 - 4x + 1)\, dx = 2x^3 - 2x^2 + x + C.$$Apply the initial condition $y(1) = 3$:
$$3 = 2(1)^3 - 2(1)^2 + 1 + C = 2 - 2 + 1 + C = 1 + C.$$So $C = 2$, and the particular solution is $y = 2x^3 - 2x^2 + x + 2$.
Solution. Differentiate: $\frac{dy}{dx} = 3Ce^{3x} = 3y$. This confirms the equation is satisfied for every value of $C$.
For the particular solution, apply $y(0) = 7$:
$$7 = Ce^{3(0)} = C \cdot 1 = C.$$Therefore $C = 7$ and $y = 7e^{3x}$.
7.2 Slope Fields
A slope field (also called a direction field) is a visual representation of a differential equation. At each point $(x, y)$ in the plane, you draw a short line segment whose slope equals $\frac{dy}{dx}$ evaluated at that point. The result is a picture that shows the "flow" of solutions without actually solving the equation.
Drawing a Slope Field
To construct a slope field by hand:
- Choose a grid of sample points, such as all integer pairs $(x, y)$ in a given region.
- At each point, compute $f(x, y)$ to get the slope.
- Draw a short segment through that point with the computed slope.
- Where $f(x, y) = 0$, draw a horizontal segment. Where $f(x, y)$ is undefined, leave the point blank.
Interpreting Slope Fields
Solution curves follow the slope field like water flowing along a current. Key observations to make:
- Horizontal segments ($\frac{dy}{dx} = 0$): these indicate equilibrium points or where the function has a local extremum.
- Segments depend only on $x$: if $\frac{dy}{dx} = f(x)$, all segments in the same column have the same slope. The slope field has vertical "stripes."
- Segments depend only on $y$: if $\frac{dy}{dx} = f(y)$, all segments in the same row have the same slope. The slope field has horizontal "stripes."
- Steep positive segments indicate rapid growth; steep negative segments indicate rapid decline.
Solution. Compute $f(x, y) = x - y$ at each grid point:
| $(x, y)$ | $(-1, -1)$ | $(-1, 0)$ | $(-1, 1)$ | $(0, -1)$ | $(0, 0)$ | $(0, 1)$ | $(1, -1)$ | $(1, 0)$ | $(1, 1)$ |
|---|---|---|---|---|---|---|---|---|---|
| Slope | $0$ | $-1$ | $-2$ | $1$ | $0$ | $-1$ | $2$ | $1$ | $0$ |
At $(-1,-1)$, $(0,0)$, and $(1,1)$, draw horizontal segments (slope $= 0$). At $(1,-1)$, draw a steeply rising segment (slope $= 2$). At $(-1,1)$, draw a steeply falling segment (slope $= -2$). The segments along the line $y = x$ are all horizontal, confirming that $y = x$ is related to the equilibrium behavior of this DE.
(A) $\frac{dy}{dx} = -y$ (B) $\frac{dy}{dx} = -x$ (C) $\frac{dy}{dx} = x - y$ (D) $\frac{dy}{dx} = y^2$
Solution. Horizontal segments along the $x$-axis mean $\frac{dy}{dx} = 0$ when $y = 0$. This eliminates (B), since $-x \neq 0$ for all $x$, and (D), since $y^2 = 0$ when $y = 0$ but $y^2 \geq 0$ always, so segments below the $x$-axis would also point upward or be horizontal. For (C), at $(1, 0)$ the slope is $1$, which is positive, not zero—so slopes along the $x$-axis are not all zero. Only (A) satisfies all conditions: $\frac{dy}{dx} = -y$ gives slope $0$ on the $x$-axis, negative slopes when $y > 0$, and positive slopes when $y < 0$. The answer is (A).
Direction Field Problem Types on the AP Exam
Direction field (slope field) questions appear in several distinct formats on the AP exam. Mastering each type is essential for earning full credit.
Solution. First, identify equilibrium solutions by setting $\frac{dy}{dx} = 0$:
$$y(2 - y) = 0 \implies y = 0 \text{ or } y = 2.$$These are two horizontal equilibrium lines. Note this DE depends only on $y$ (not $x$), so all segments in the same horizontal row have the same slope.
- When $0 < y < 2$: $y > 0$ and $(2-y) > 0$, so $\frac{dy}{dx} > 0$ (slopes point upward).
- When $y > 2$: $y > 0$ but $(2-y) < 0$, so $\frac{dy}{dx} < 0$ (slopes point downward).
- When $y < 0$: $y < 0$ and $(2-y) > 0$, so $\frac{dy}{dx} < 0$ (slopes point downward).
Starting at $(0, 1)$: since $0 < 1 < 2$, the slope is positive and the solution increases. As $y$ approaches 2, $\frac{dy}{dx} \to 0$ and the curve levels off. The solution curve approaches $y = 2$ asymptotically from below. The equilibrium $y = 2$ is stable (solutions near it converge to it), while $y = 0$ is unstable (solutions near it diverge from it).
Solution. Equilibrium: $\frac{dy}{dx} = 0$ when $(y-1)(y-4) = 0$, so $y = 1$ and $y = 4$.
Analyze the sign of $\frac{dy}{dx}$ in each region:
- $y < 1$: $(y-1) < 0$, $(y-4) < 0$, product is $> 0$. Solutions increase toward $y = 1$.
- $1 < y < 4$: $(y-1) > 0$, $(y-4) < 0$, product is $< 0$. Solutions decrease toward $y = 1$.
- $y > 4$: $(y-1) > 0$, $(y-4) > 0$, product is $> 0$. Solutions increase away from $y = 4$.
Solutions above and below $y = 1$ both move toward it, so $y = 1$ is stable.
Solutions just below $y = 4$ move toward $y = 1$ (away from $y = 4$), and solutions just above $y = 4$ increase further away. So $y = 4$ is unstable.
- All segments along $y = 3$ are horizontal.
- Segments where $y > 3$ have negative slopes.
- Segments where $y < 3$ have positive slopes.
- The steepness increases as $y$ moves farther from 3.
Which differential equation matches? (A) $\frac{dy}{dx} = 3 - y$ (B) $\frac{dy}{dx} = y - 3$ (C) $\frac{dy}{dx} = (3 - y)^2$ (D) $\frac{dy}{dx} = 3 - x$
Solution.
Eliminate (D): slopes depend on $x$, not $y$, so segments in the same column (not row) would have equal slopes—contradicting the described behavior.
Eliminate (C): $(3-y)^2 \geq 0$ always, so slopes can never be negative. But we need negative slopes when $y > 3$.
Test (A) $3 - y$: when $y = 3$, slope $= 0$ (horizontal). When $y > 3$, slope $< 0$ (negative). When $y < 3$, slope $> 0$ (positive). As $|y - 3|$ increases, $|3 - y|$ increases, making slopes steeper. All properties match.
Test (B) $y - 3$: when $y > 3$, slope $> 0$ (positive). This contradicts "segments where $y > 3$ have negative slopes."
The answer is (A).
Interactive slope field for dy/dx = a·x + b·y + c. Adjust a, b, c to see how the slope field changes. Try a=0, b=-1, c=0 for dy/dx = -y, or a=1, b=-1, c=0 for dy/dx = x - y.
7.3 Euler's Method BC Only
Euler's method is a numerical technique for approximating solutions to initial value problems when an exact solution is difficult or impossible to find analytically. The idea is straightforward: starting from the initial point, take small steps along the tangent line to estimate the solution curve.
- Compute the slope at the current point: $m_n = f(x_n, y_n)$.
- Step forward: $x_{n+1} = x_n + \Delta x$.
- Update the $y$-value: $y_{n+1} = y_n + m_n \cdot \Delta x$.
- Repeat from step 1 using the new point $(x_{n+1}, y_{n+1})$.
Accuracy Considerations
Euler's method is a first-order approximation. Its accuracy depends on the step size $\Delta x$: smaller steps produce better approximations but require more computation. Important points for the AP exam:
- If the solution curve is concave up, Euler's method underestimates the true value (the tangent line lies below the curve).
- If the solution curve is concave down, Euler's method overestimates the true value.
- Halving the step size roughly halves the error at each step.
Solution. We need to step from $x = 0$ to $x = 2$ in steps of $0.5$, requiring 4 iterations.
| Step | $x_n$ | $y_n$ | $f(x_n, y_n) = x_n + y_n$ | $y_{n+1} = y_n + f \cdot \Delta x$ |
|---|---|---|---|---|
| 0 | $0$ | $1$ | $0 + 1 = 1$ | $1 + 1(0.5) = 1.5$ |
| 1 | $0.5$ | $1.5$ | $0.5 + 1.5 = 2$ | $1.5 + 2(0.5) = 2.5$ |
| 2 | $1.0$ | $2.5$ | $1.0 + 2.5 = 3.5$ | $2.5 + 3.5(0.5) = 4.25$ |
| 3 | $1.5$ | $4.25$ | $1.5 + 4.25 = 5.75$ | $4.25 + 5.75(0.5) = 7.125$ |
Therefore, $y(2) \approx 7.125$. (The exact solution is $y = 2e^x - x - 1$, giving $y(2) = 2e^2 - 3 \approx 11.78$, illustrating that the large step size introduces significant error.)
Solution.
| Step | $x_n$ | $y_n$ | $f(x_n, y_n) = 2x_n$ | $y_{n+1} = y_n + f \cdot \Delta x$ |
|---|---|---|---|---|
| 0 | $1.0$ | $4$ | $2(1.0) = 2$ | $4 + 2(0.1) = 4.2$ |
| 1 | $1.1$ | $4.2$ | $2(1.1) = 2.2$ | $4.2 + 2.2(0.1) = 4.42$ |
| 2 | $1.2$ | $4.42$ | $2(1.2) = 2.4$ | $4.42 + 2.4(0.1) = 4.66$ |
So $y(1.3) \approx 4.66$. The exact solution is $y = x^2 + 3$, giving $y(1.3) = 1.69 + 3 = 4.69$. With a small step size, Euler's method is quite close. Since $y'' = 2 > 0$ (concave up), our approximation is an underestimate, consistent with the result.
Solution.
| Step | $x_n$ | $y_n$ | $f(x_n, y_n) = -y_n$ | $y_{n+1} = y_n + f \cdot \Delta x$ |
|---|---|---|---|---|
| 0 | $0$ | $4$ | $-4$ | $4 + (-4)(0.5) = 2$ |
| 1 | $0.5$ | $2$ | $-2$ | $2 + (-2)(0.5) = 1$ |
| 2 | $1.0$ | $1$ | $-1$ | $1 + (-1)(0.5) = 0.5$ |
| 3 | $1.5$ | $0.5$ | $-0.5$ | $0.5 + (-0.5)(0.5) = 0.25$ |
Euler's approximation: $y(2) \approx 0.25$. The exact solution is $y = 4e^{-x}$, giving $y(2) = 4e^{-2} \approx 0.541$.
Since $\frac{d^2y}{dx^2} = y > 0$ (the solution curve is concave up), the tangent line lies below the curve, so Euler's method underestimates the true value. Indeed, $0.25 < 0.541$.
Euler's method for dy/dx = f(x,y). The blue curve shows the exact solution y = y₀·e^(kx), while the red step function shows Euler's approximation. Adjust the step size Δx to see how accuracy improves with smaller steps.
7.4 Separation of Variables
Separation of variables is the primary analytical technique for solving first-order differential equations on the AP exam. It works when the DE can be written so that all $y$-terms are on one side and all $x$-terms are on the other.
- Separate: Rewrite as $\frac{1}{h(y)}\, dy = g(x)\, dx$.
- Integrate: $\displaystyle\int \frac{1}{h(y)}\, dy = \int g(x)\, dx$.
- Solve for $y$: Simplify and solve for $y$ if possible.
- Apply initial condition: Substitute the given point to find $C$.
Solution. Separate variables:
$$y\, dy = x^2\, dx.$$Integrate both sides:
$$\int y\, dy = \int x^2\, dx \implies \frac{y^2}{2} = \frac{x^3}{3} + C.$$Apply $y(0) = 3$: $\frac{9}{2} = 0 + C$, so $C = \frac{9}{2}$.
$$\frac{y^2}{2} = \frac{x^3}{3} + \frac{9}{2} \implies y^2 = \frac{2x^3}{3} + 9.$$Since $y(0) = 3 > 0$, we take the positive root: $y = \sqrt{\dfrac{2x^3}{3} + 9}$.
Solution. Separate variables:
$$\frac{1}{y}\, dy = -0.05\, dt.$$Integrate:
$$\ln|y| = -0.05t + C_1.$$Exponentiate both sides:
$$|y| = e^{C_1} e^{-0.05t} \implies y = Ae^{-0.05t}, \quad \text{where } A = \pm e^{C_1}.$$Apply $y(0) = 200$: $200 = Ae^{0} = A$.
Therefore $y = 200e^{-0.05t}$. This represents exponential decay with rate constant $k = -0.05$.
Solution. Separate variables:
$$\frac{1}{y^2}\, dy = \frac{1 + x}{x}\, dx = \left(\frac{1}{x} + 1\right) dx.$$Integrate both sides:
$$\int y^{-2}\, dy = \int \left(\frac{1}{x} + 1\right) dx \implies -\frac{1}{y} = \ln x + x + C.$$Apply $y(1) = -1$: $-\frac{1}{-1} = \ln 1 + 1 + C \implies 1 = 0 + 1 + C$, so $C = 0$.
$$-\frac{1}{y} = \ln x + x \implies y = \frac{-1}{\ln x + x}.$$7.5 Exponential Growth and Decay
The most important differential equation in applications is the exponential model. It arises whenever the rate of change of a quantity is proportional to the quantity itself.
- If $k > 0$: exponential growth (population increase, compound interest).
- If $k < 0$: exponential decay (radioactive decay, depreciation).
This result follows directly from separation of variables (as shown in Example 7.4.2) and is worth memorizing. On the AP exam, you may be asked to derive it or simply apply it to word problems.
Exponential growth and decay: y = y₀·e^(kt). Adjust k (positive = growth, negative = decay) and y₀ to explore solutions of dy/dt = ky.
Common Applications
- Population growth: A population growing at a rate proportional to its size satisfies $\frac{dP}{dt} = kP$, giving $P(t) = P_0 e^{kt}$.
- Radioactive decay: A radioactive substance decays at a rate proportional to the amount present: $\frac{dA}{dt} = -\lambda A$, giving $A(t) = A_0 e^{-\lambda t}$. The half-life $t_{1/2}$ satisfies $t_{1/2} = \frac{\ln 2}{\lambda}$.
- Newton's Law of Cooling: The rate of temperature change is proportional to the difference between the object's temperature $T$ and the ambient temperature $T_s$: $\frac{dT}{dt} = k(T - T_s)$, giving $T(t) = T_s + (T_0 - T_s)e^{kt}$, where $k < 0$.
Solution. The population satisfies $P(t) = 500e^{kt}$. The doubling condition gives:
$$1000 = 500e^{3k} \implies 2 = e^{3k} \implies k = \frac{\ln 2}{3}.$$After 8 hours:
$$P(8) = 500e^{8 \cdot \frac{\ln 2}{3}} = 500 \cdot 2^{8/3} = 500 \cdot 2^{2.667} \approx 500 \cdot 6.35 \approx 3175.$$The colony has approximately 3175 bacteria after 8 hours.
Solution. From the half-life: $\lambda = \frac{\ln 2}{12}$, so $A(t) = 80e^{-\frac{\ln 2}{12}t}$.
Equivalently, $A(t) = 80 \cdot 2^{-t/12}$. After 20 years:
$$A(20) = 80 \cdot 2^{-20/12} = 80 \cdot 2^{-5/3} \approx 80 \cdot 0.3150 \approx 25.2 \text{ grams}.$$Approximately 25.2 grams remain after 20 years. Notice that after 12 years we'd have 40 g, and after 24 years we'd have 20 g, so 25.2 g at 20 years is reasonable.
7.6 Logistic Growth BC Only
Exponential growth is unrealistic for most real populations because it ignores resource limitations. The logistic model improves on this by introducing a carrying capacity $L$—the maximum sustainable population.
Key Properties of Logistic Growth
- When $P$ is small relative to $L$, the factor $(1 - P/L) \approx 1$, so growth is approximately exponential.
- When $P = L/2$, the growth rate $\frac{dP}{dt}$ is maximized. This is the inflection point of the logistic curve.
- As $t \to \infty$, $P(t) \to L$. The population approaches but never exceeds the carrying capacity.
- If $P_0 > L$, the population decreases toward $L$.
- The graph of $P(t)$ is S-shaped (sigmoidal): concave up for $P < L/2$, concave down for $P > L/2$.
(a) What is the carrying capacity?
(b) At what population is the growth rate greatest?
(c) Find $P(t)$.
Solution.
(a) Comparing with the standard form, $L = 5000$. The lake can sustain at most 5000 fish.
(b) The growth rate is maximized when $P = L/2 = 2500$ fish.
(c) We have $k = 0.4$, $L = 5000$, $P_0 = 800$. Compute $A$:
$$A = \frac{L - P_0}{P_0} = \frac{5000 - 800}{800} = \frac{4200}{800} = 5.25.$$Therefore:
$$P(t) = \frac{5000}{1 + 5.25\, e^{-0.4t}}.$$As $t \to \infty$, $e^{-0.4t} \to 0$, so $P(t) \to 5000$, confirming the population approaches the carrying capacity.
Logistic growth: P(t) = L/(1 + Ae^(-kt)). Adjust the carrying capacity L and growth rate k to see how the population approaches its limit.
7.7 Classifying Differential Equations ★ Special Topic
The classification of differential equations as linear vs. nonlinear and homogeneous vs. nonhomogeneous is not explicitly tested on the AP Calculus AB or BC exam. However, this framework is the foundation of every university-level ODE course. Understanding it now will give you a major head start and explain why certain solution methods (like separation of variables) apply to some equations but not others.
Part 1 — Linear vs. Nonlinear Differential Equations
The word "linear" here refers to how $y$ appears in the equation—$y$ and its derivative must occur to the first power and must not be multiplied together. Coefficients like $P(x)$ and $Q(x)$ may be arbitrarily complicated functions of $x$, and that does not affect linearity.
The Three-Question Test for Linearity
Before writing the equation in standard form, ask three questions about how $y$ appears:
- Is $y$ raised to a power other than 1? (e.g., $y^2$, $\sqrt{y}$, $y^{-1}$) → Nonlinear
- Is $y$ inside a function? (e.g., $\sin y$, $e^y$, $\ln y$) → Nonlinear
- Is $y$ multiplied by its own derivative? (e.g., $y\,\frac{dy}{dx}$) → Nonlinear
If all three answers are "No," the equation is linear (provided you can isolate $\frac{dy}{dx}$ and match the standard form).
(a) $\dfrac{dy}{dx} + 4xy = e^x$ (b) $\dfrac{dy}{dx} = y^2 - x$ (c) $\dfrac{dy}{dx} + y\cos x = 0$ (d) $y\,\dfrac{dy}{dx} = x^2$
Solution.
(a) The equation is already in standard form with $P(x) = 4x$ and $Q(x) = e^x$. $y$ appears only to the first power. LINEAR
(b) The right side contains $y^2$ — $y$ is squared. This violates the first test. NONLINEAR
(c) Rewrite: $\dfrac{dy}{dx} + (\cos x)\,y = 0$. This has $P(x) = \cos x$ and $Q(x) = 0$. The $\cos x$ is a coefficient of $y$, not an argument; $y$ appears to the first power. LINEAR
(d) The left side has $y \cdot \dfrac{dy}{dx}$ — a product of $y$ with its own derivative. This violates the third test. NONLINEAR
Solution. Rewrite: $\dfrac{dy}{dx} - e^x y = 0$. Now $P(x) = -e^x$ and $Q(x) = 0$. The exponential $e^x$ is a coefficient of $y$, and $y$ appears to the first power. LINEAR
Compare this carefully with $\dfrac{dy}{dx} = e^y$, where $y$ is in the exponent. That equation is NONLINEAR because $y$ appears inside an exponential function.
Solution. Divide every term by $(x^2 + 1)$: $$\frac{dy}{dx} - \frac{3x}{x^2+1}\,y = \frac{x}{x^2+1}.$$ This is standard form with $P(x) = -\dfrac{3x}{x^2+1}$ and $Q(x) = \dfrac{x}{x^2+1}$. Although the coefficients are complicated, $y$ appears only to the first power. LINEAR
Solution. Try to rearrange into standard form: $$\frac{dy}{dx} + y = xy^2.$$ The right side is $xy^2$, which contains $y^2$. There is no algebraic manipulation that removes $y^2$. NONLINEAR
This equation is a Bernoulli equation — a special nonlinear type solvable by a substitution $v = y^{1-n}$. You will encounter this in a university ODE course.
Solution. Rewrite: $\dfrac{dy}{dx} - \sin(x)\,y = -x^2$. Standard form with $P(x) = -\sin x$ and $Q(x) = -x^2$. $y$ appears once, to the first power, as part of the coefficient term $-\sin(x)\cdot y$. LINEAR
Solution. Divide by $\sqrt{x}$: $$\frac{dy}{dx} + \frac{1}{x}\,y = \sqrt{x}.$$ Standard form with $P(x) = \dfrac{1}{x}$ (defined for $x > 0$) and $Q(x) = \sqrt{x}$. The complicated-looking $\sqrt{x}$ factors are all functions of $x$ only. LINEAR
Part 2 — Homogeneous vs. Nonhomogeneous Linear DEs
Once we know an equation is linear and write it in standard form $\dfrac{dy}{dx} + P(x)\,y = Q(x)$, we make a second classification based on the right-hand side $Q(x)$.
- homogeneous (동차) if $Q(x) = 0$ for all $x$, i.e., $\dfrac{dy}{dx} + P(x)\,y = 0$.
- nonhomogeneous (비동차) if $Q(x) \not\equiv 0$, meaning $Q(x)$ is not identically zero.
Intuitively, a homogeneous equation has "no forcing term" — the system evolves purely under its own internal law. A nonhomogeneous equation has an external "input" or "source" on the right side.
(a) $\dfrac{dy}{dx} + 3y = 0$ (b) $\dfrac{dy}{dx} - 2y = e^x$ (c) $\dfrac{dy}{dx} + \dfrac{y}{x} = \ln x$ (d) $\dfrac{dy}{dx} - ky = 0$
Solution.
(a) $Q(x) = 0$. HOMOGENEOUS. General solution: $y = Ce^{-3x}$.
(b) $Q(x) = e^x \neq 0$. NONHOMOGENEOUS. Requires an integrating factor or undetermined coefficients to solve.
(c) $Q(x) = \ln x \neq 0$ (for $x > 0$). NONHOMOGENEOUS.
(d) $Q(x) = 0$. HOMOGENEOUS. This is exactly the exponential growth/decay equation — its solution $y = Ce^{kx}$ is already familiar from Section 7.5.
Solution. First check linearity. Rewrite:
$$x\,\frac{dy}{dx} + 2y = 5x.$$Divide by $x$ (assuming $x \neq 0$):
$$\frac{dy}{dx} + \frac{2}{x}\,y = 5.$$$P(x) = \dfrac{2}{x}$, $Q(x) = 5 \neq 0$. The equation is linear and NONHOMOGENEOUS.
This is one of the most common sources of confusion in differential equations:
Meaning 1 (for linear DEs): $Q(x) = 0$. Example: $\dfrac{dy}{dx} + 3y = 0$ is homogeneous.
Meaning 2 (for nonlinear DEs — a completely separate concept): A nonlinear equation $\dfrac{dy}{dx} = f(x,y)$ where $f$ depends only on the ratio $y/x$ is also called "homogeneous" (degree-based sense). For example, $\dfrac{dy}{dx} = \dfrac{x+y}{x} = 1 + \dfrac{y}{x}$ is "homogeneous" in this second sense — solvable by substituting $v = y/x$.
These two uses of "homogeneous" are completely unrelated. Context tells you which definition applies: if the equation is linear, homogeneous means $Q(x) = 0$. If the equation is nonlinear, homogeneous means it depends only on $y/x$.
Part 3 — Combined Classification and the Full Picture
Every first-order ODE can be placed into this two-axis classification:
| Category | Standard Form | Key Signature | AP Solution Method |
|---|---|---|---|
| Linear & Homogeneous | $\dfrac{dy}{dx} + P(x)\,y = 0$ | Right side is zero; separable | Separation of variables → $y = Ce^{-\int P\,dx}$ |
| Linear & Nonhomogeneous | $\dfrac{dy}{dx} + P(x)\,y = Q(x)$ | Right side $Q(x) \neq 0$ | Integrating factor $\mu = e^{\int P\,dx}$ (beyond AP) |
| Nonlinear & Separable | $\dfrac{dy}{dx} = g(x)\,h(y)$ | $x$-part times $y$-part | Separation of variables (AP Section 7.4) |
| Nonlinear & Non-separable | e.g., $\dfrac{dy}{dx} = x + y^2$ | Cannot separate; nonlinear terms | Euler's method (numerical, AP Section 7.3); no closed form |
(a) $\dfrac{dy}{dx} = ky$ (b) $\dfrac{dy}{dx} = ky + b$ (c) $\dfrac{dy}{dx} = \dfrac{L - y}{L}\cdot y$ (d) $\dfrac{dy}{dx} + \dfrac{y}{x} = x\sin x$
Solution.
(a) Rewrite: $\dfrac{dy}{dx} - ky = 0$. $y$ appears to the first power, right side zero. Linear, Homogeneous. This is the exponential growth model from Section 7.5. Solution: $y = Ce^{kx}$.
(b) Rewrite: $\dfrac{dy}{dx} - ky = b$ (where $b$ is a nonzero constant). $y$ is linear; right side $Q = b \neq 0$. Linear, Nonhomogeneous. This models growth with a constant input rate $b$. Separation still works here: $\dfrac{dy}{ky+b} = dx$, giving $y = Ce^{kx} - \dfrac{b}{k}$.
(c) Expand: $\dfrac{dy}{dx} = \dfrac{Ly - y^2}{L} = y - \dfrac{y^2}{L}$. The $y^2$ term makes this Nonlinear. (This is the logistic growth equation from Section 7.6, which is separable despite being nonlinear.)
(d) Already in standard form with $P(x) = \dfrac{1}{x}$ and $Q(x) = x\sin x$. No $y^n$ or $f(y)$ terms. Linear, Nonhomogeneous.
(a) $\dfrac{dy}{dx} = \dfrac{x}{y}$ (b) $\dfrac{dy}{dx} + 2y = 4x$ (c) $\dfrac{dy}{dx} = x + y^2$ (d) $\dfrac{dy}{dx} + 3y = 0$
Solution.
(a) $y\,dy = x\,dx$: the equation is separable (nonlinear but separable). Integrate both sides: $\dfrac{y^2}{2} = \dfrac{x^2}{2} + C$, so $y^2 - x^2 = K$. Method: Separation of Variables.
(b) Linear nonhomogeneous. Not directly separable because of the $4x$ term. At AP level, Euler's method estimates solutions numerically. In university, an integrating factor $\mu = e^{2x}$ yields the exact solution $y = 2x - 1 + Ce^{-2x}$. Method: Integrating Factor (university) or Euler's Method (AP).
(c) Nonlinear and non-separable ($x$ and $y^2$ cannot be factored apart). No elementary closed-form solution exists. Method: Euler's Method (numerical approximation) or power series (university).
(d) Linear homogeneous. Also separable: $\dfrac{dy}{y} = -3\,dx \Rightarrow \ln|y| = -3x + C_1 \Rightarrow y = Ce^{-3x}$. Method: Separation of Variables (or direct formula).
Solution. No. To test linearity, we try to rearrange into standard form. Multiply both sides by $(x+y)$:
$$(x+y)\,\frac{dy}{dx} = x - y.$$The left side contains $y\cdot\dfrac{dy}{dx}$, which is a product of $y$ with its derivative — a violation of the third linearity test. The equation is NONLINEAR.
Note: This equation is actually a "degree-0 homogeneous nonlinear DE" (in the second sense of homogeneous). Substituting $v = y/x$ separates it into a solvable form — a technique studied in university ODE courses.
Solution. The general form of a linear second-order ODE is $a(x)y'' + b(x)y' + c(x)y = f(x)$. Here $a = 1$, $b = 3$, $c = -4$, and $f(x) = \sin x$. The dependent variable $y$ and its derivatives $y', y''$ appear only to the first power, with no products like $yy'$ or functions like $\sin(y)$. LINEAR.
Since $f(x) = \sin x \neq 0$, this is NONHOMOGENEOUS. This is a key equation type in university-level ODE courses, solved by finding the complementary solution (of $y'' + 3y' - 4y = 0$) plus a particular solution of the full equation.
Quick Reference: 12 Equations Classified
| # | Equation | Linear? | If Linear: Homogeneous? | Reason / Method |
|---|---|---|---|---|
| 1 | $y' + 3y = 0$ | Linear | Homo | $Q=0$; solution $Ce^{-3x}$ |
| 2 | $y' + 3y = 6$ | Linear | Nonhomo | $Q=6\ne0$; particular solution $y_p=2$ |
| 3 | $y' = y^2$ | Nonlinear | N/A | $y^2$ term; separable: $y=-1/(x+C)$ |
| 4 | $y' = e^y$ | Nonlinear | N/A | $y$ in exponent; separable: $e^{-y}dy=dx$ |
| 5 | $y' = e^x y$ | Linear | Homo | $e^x$ is coefficient of $y$; $Q=0$ |
| 6 | $y' - xy = x$ | Linear | Nonhomo | $Q=x\ne0$; integrating factor method |
| 7 | $y y' = x$ | Nonlinear | N/A | Product $y\cdot y'$; separable: $y^2=x^2+C$ |
| 8 | $y' = \sin(y)$ | Nonlinear | N/A | $y$ inside $\sin$; separable but not elementary |
| 9 | $y' + (\sin x)y = 0$ | Linear | Homo | $\sin x$ is coefficient; $Q=0$ |
| 10 | $y' + (\sin x)y = \cos x$ | Linear | Nonhomo | $Q=\cos x\ne0$ |
| 11 | $y' = ky(L-y)$ | Nonlinear | N/A | $y^2$ term (logistic); separable |
| 12 | $(1+x^2)y' = y$ | Linear | Homo | Divide by $(1+x^2)$: $y'-\frac{y}{1+x^2}=0$ |
7.8 Practice Problems
Test your understanding with these 18 problems covering all topics from this chapter, including direction fields, Euler's method, separation of variables, and growth models. Click "Show Solution" to check your work. Some problems also touch on the classification ideas from Section 7.7.
Problem 1. Solve the initial value problem $\frac{dy}{dx} = 4x^3 - 6x$, where $y(1) = 2$.
Show Solution
Integrate: $y = \int (4x^3 - 6x)\, dx = x^4 - 3x^2 + C$.
Apply $y(1) = 2$: $2 = 1 - 3 + C = -2 + C$, so $C = 4$.
$y = x^4 - 3x^2 + 4$.
Problem 2. A slope field for $\frac{dy}{dx} = f(x,y)$ has horizontal segments along the line $y = 2x$. Which of the following could be $f(x, y)$?
(A) $x - 2y$ (B) $2x - y$ (C) $y - 2x$ (D) $xy - 2$
Show Solution
Horizontal segments mean $f(x, y) = 0$ along $y = 2x$. Substitute $y = 2x$ into each option:
(A) $x - 2(2x) = x - 4x = -3x \neq 0$ generally.
(B) $2x - 2x = 0$. This works for all $x$.
(C) $2x - 2x = 0$. This also works.
(D) $x(2x) - 2 = 2x^2 - 2 \neq 0$ generally.
Both (B) and (C) give zero on $y = 2x$. However, note that (B) $= 2x - y$ and (C) $= y - 2x = -(2x - y)$, so they produce the same zero set but opposite slopes elsewhere. Either could be correct; on a real AP exam the options would be distinct. The answer is (B) or (C).
Problem 3. Use separation of variables to solve $\frac{dy}{dx} = \frac{2x}{y+1}$, where $y(0) = 1$.
Show Solution
Separate: $(y + 1)\, dy = 2x\, dx$.
Integrate: $\frac{y^2}{2} + y = x^2 + C$.
Apply $y(0) = 1$: $\frac{1}{2} + 1 = 0 + C$, so $C = \frac{3}{2}$.
$\frac{y^2}{2} + y = x^2 + \frac{3}{2}$, or equivalently $y^2 + 2y = 2x^2 + 3$.
Completing the square: $(y + 1)^2 = 2x^2 + 4$, so $y = -1 + \sqrt{2x^2 + 4}$ (taking the positive root since $y(0) = 1 > 0$).
Problem 4 (BC). Use Euler's method with $\Delta x = 0.25$ and two steps to approximate $y(0.5)$, given $\frac{dy}{dx} = y - x$ and $y(0) = 2$.
Show Solution
Step 0: $x_0 = 0$, $y_0 = 2$. Slope $= 2 - 0 = 2$. $y_1 = 2 + 2(0.25) = 2.5$.
Step 1: $x_1 = 0.25$, $y_1 = 2.5$. Slope $= 2.5 - 0.25 = 2.25$. $y_2 = 2.5 + 2.25(0.25) = 3.0625$.
$y(0.5) \approx 3.0625$.
Problem 5. A substance decays according to $\frac{dA}{dt} = -0.03A$. If $A(0) = 500$ grams, how long until 100 grams remain?
Show Solution
$A(t) = 500e^{-0.03t}$. Set $A(t) = 100$:
$100 = 500e^{-0.03t} \implies 0.2 = e^{-0.03t} \implies \ln(0.2) = -0.03t$.
$t = \frac{-\ln(0.2)}{0.03} = \frac{\ln 5}{0.03} \approx \frac{1.6094}{0.03} \approx 53.6$ time units.
Problem 6. Solve $\frac{dy}{dx} = \frac{y}{x}$ for $x > 0$, given $y(1) = 5$.
Show Solution
Separate: $\frac{dy}{y} = \frac{dx}{x}$.
Integrate: $\ln|y| = \ln|x| + C_1$, so $|y| = e^{C_1}|x|$, giving $y = Cx$ where $C = \pm e^{C_1}$.
Apply $y(1) = 5$: $5 = C(1)$, so $C = 5$.
$y = 5x$.
Problem 7. A population of 2000 doubles in 5 years. Assuming exponential growth, what is the population after 12 years?
Show Solution
$P(t) = 2000e^{kt}$. Doubling: $4000 = 2000e^{5k}$, so $k = \frac{\ln 2}{5}$.
$P(12) = 2000e^{12 \cdot \frac{\ln 2}{5}} = 2000 \cdot 2^{12/5} = 2000 \cdot 2^{2.4} \approx 2000 \cdot 5.278 \approx 10{,}556$.
Problem 8. Solve $\frac{dy}{dx} = e^{x-y}$, given $y(0) = 0$.
Show Solution
Rewrite: $\frac{dy}{dx} = e^x \cdot e^{-y}$. Separate: $e^y\, dy = e^x\, dx$.
Integrate: $e^y = e^x + C$.
Apply $y(0) = 0$: $e^0 = e^0 + C \implies 1 = 1 + C$, so $C = 0$.
$e^y = e^x$, so $y = x$.
Verification: $\frac{dy}{dx} = 1$ and $e^{x - y} = e^{x - x} = e^0 = 1$. Confirmed.
Problem 9 (BC). A population satisfies $\frac{dP}{dt} = 0.1P\left(1 - \frac{P}{10000}\right)$ with $P(0) = 1000$. What is the population when the growth rate is at its maximum?
Show Solution
This is a logistic equation with $k = 0.1$ and carrying capacity $L = 10000$.
The growth rate $\frac{dP}{dt}$ is maximized when $P = \frac{L}{2} = 5000$.
At that point, $\frac{dP}{dt} = 0.1(5000)\left(1 - \frac{5000}{10000}\right) = 500 \cdot 0.5 = 250$ individuals per unit time.
Problem 10. A cup of coffee at $90°$C is placed in a room at $20°$C. After 10 minutes, the coffee is at $70°$C. Find the temperature after 30 minutes using Newton's Law of Cooling.
Show Solution
Newton's Law of Cooling: $T(t) = T_s + (T_0 - T_s)e^{kt} = 20 + 70e^{kt}$.
At $t = 10$: $70 = 20 + 70e^{10k}$, so $50 = 70e^{10k}$, giving $e^{10k} = \frac{5}{7}$.
Thus $k = \frac{1}{10}\ln\frac{5}{7} = \frac{1}{10}(\ln 5 - \ln 7) \approx \frac{-0.3365}{10} = -0.03365$.
At $t = 30$:
$T(30) = 20 + 70e^{30k} = 20 + 70\left(e^{10k}\right)^3 = 20 + 70\left(\frac{5}{7}\right)^3 = 20 + 70 \cdot \frac{125}{343}$.
$T(30) = 20 + \frac{8750}{343} \approx 20 + 25.51 \approx 45.5°$C.
Direction Field Problems
Problem 11 (Sketching a Slope Field). Sketch the slope field for $\frac{dy}{dx} = y - x$ at the twelve points where $x \in \{0, 1, 2\}$ and $y \in \{-1, 0, 1, 2\}$. At which points are the slopes zero?
Show Solution
Compute $f(x, y) = y - x$ at each grid point:
| $(x, y)$ | $(0,-1)$ | $(0,0)$ | $(0,1)$ | $(0,2)$ | $(1,-1)$ | $(1,0)$ | $(1,1)$ | $(1,2)$ | $(2,-1)$ | $(2,0)$ | $(2,1)$ | $(2,2)$ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Slope | $-1$ | $0$ | $1$ | $2$ | $-2$ | $-1$ | $0$ | $1$ | $-3$ | $-2$ | $-1$ | $0$ |
The slopes are zero at points where $y = x$: at $(0, 0)$, $(1, 1)$, and $(2, 2)$. These lie along the line $y = x$. Above this line the slopes are positive (solution curves increase), and below it the slopes are negative (solution curves decrease).
Problem 12 (Matching DE to Slope Field). A slope field has these properties: (i) all segments in the same column have the same slope, (ii) slopes are positive for $x < 0$ and negative for $x > 0$, (iii) slopes are zero along the $y$-axis. Which DE matches?
(A) $\frac{dy}{dx} = -x$ (B) $\frac{dy}{dx} = -y$ (C) $\frac{dy}{dx} = x^2$ (D) $\frac{dy}{dx} = -x^2$
Show Solution
Property (i) says slopes depend only on $x$ (same column = same $x$). This eliminates (B), which depends on $y$.
Property (iii) says slope $= 0$ when $x = 0$. Check remaining options: (A) $-0 = 0$ ✓, (C) $0^2 = 0$ ✓, (D) $-0^2 = 0$ ✓.
Property (ii) says slopes are positive when $x < 0$. Check: (A) $-x > 0$ when $x < 0$ ✓, (C) $x^2 > 0$ for all $x \neq 0$ ✗ (positive for both sides), (D) $-x^2 < 0$ for all $x \neq 0$ ✗ (negative for both sides).
The answer is (A).
Problem 13 (Solution Curve on Slope Field). Consider $\frac{dy}{dx} = y(1 - y)$ with initial condition $y(0) = 0.5$.
(a) Find all equilibrium solutions.
(b) Classify each as stable or unstable.
(c) Describe the long-term behavior of the solution through $(0, 0.5)$.
Show Solution
(a) Set $y(1-y) = 0$: equilibrium solutions are $y = 0$ and $y = 1$.
(b) Analyze the sign of $\frac{dy}{dx}$ in each region:
- $y < 0$: $y < 0$, $(1-y) > 0$, so $\frac{dy}{dx} < 0$. Solutions decrease (move away from $y = 0$).
- $0 < y < 1$: $y > 0$, $(1-y) > 0$, so $\frac{dy}{dx} > 0$. Solutions increase (move toward $y = 1$).
- $y > 1$: $y > 0$, $(1-y) < 0$, so $\frac{dy}{dx} < 0$. Solutions decrease (move toward $y = 1$).
$y = 0$ is unstable: solutions just above it move away (upward). $y = 1$ is stable: solutions on both sides converge to it.
(c) Since $0 < 0.5 < 1$, the slope is positive and the solution increases. As $y \to 1$, $\frac{dy}{dx} \to 0$ and the curve levels off. The solution approaches $y = 1$ asymptotically. (This is actually a logistic equation with $L = 1$ and $k = 1$.)
Problem 14 (Determining the DE). From a slope field, you observe: slopes are $0$ along both $y = 0$ and $y = 3$; slopes are positive between $y = 0$ and $y = 3$; slopes are negative when $y < 0$ or $y > 3$; slopes do not depend on $x$. Write a differential equation that could produce this slope field.
Show Solution
We need $\frac{dy}{dx} = f(y)$ (independent of $x$) with zeros at $y = 0$ and $y = 3$.
The simplest such function is $f(y) = y(3 - y)$. Check the signs:
- $y < 0$: $y < 0$, $(3 - y) > 0$, product $< 0$ ✓
- $0 < y < 3$: $y > 0$, $(3 - y) > 0$, product $> 0$ ✓
- $y > 3$: $y > 0$, $(3 - y) < 0$, product $< 0$ ✓
Therefore $\frac{dy}{dx} = y(3 - y)$ matches the described slope field. (Any positive scalar multiple, like $\frac{dy}{dx} = 2y(3-y)$, also works.)
Problem 15 (Slope Field + Particular Solution). The slope field for $\frac{dy}{dx} = 2x - y$ is given.
(a) Sketch the solution curve passing through $(0, -1)$ on the slope field.
(b) Use the slope field to determine whether $y(2)$ is positive or negative for this solution.
(c) Find the equilibrium solution (if any).
Show Solution
(a) At $(0, -1)$: slope $= 0 - (-1) = 1$. The curve starts going upward with slope 1.
At $(0.5, -0.5)$ (approximately): slope $= 1 - (-0.5) = 1.5$. Still increasing steeply.
At $(1, 1)$: slope $= 2 - 1 = 1$. The curve continues to rise.
At $(2, 3)$: slope $= 4 - 3 = 1$. Still positive but the curve is leveling off toward the line $y = 2x - 1$.
(b) Starting from $(0, -1)$ with positive slopes, the solution is increasing. By $x = 1$, the solution is near $y = 1$ (positive). So $y(2)$ is positive.
(c) For an equilibrium solution $y = c$ (constant), we need $\frac{dy}{dx} = 0$ for all $x$: $2x - c = 0$ for all $x$, which is impossible. There is no equilibrium solution. (However, the line $y = 2x - 1$ acts as an "attracting curve" since the general solution approaches it as $x \to \infty$.)
Euler's Method Problems
Problem 16 (BC). Use Euler's method with $\Delta x = 0.1$ and 3 steps to approximate $y(0.3)$, given $\frac{dy}{dx} = x + 2y$ and $y(0) = 1$.
Show Solution
| Step | $x_n$ | $y_n$ | $f(x_n, y_n) = x_n + 2y_n$ | $y_{n+1}$ |
|---|---|---|---|---|
| 0 | $0$ | $1$ | $0 + 2(1) = 2$ | $1 + 2(0.1) = 1.2$ |
| 1 | $0.1$ | $1.2$ | $0.1 + 2(1.2) = 2.5$ | $1.2 + 2.5(0.1) = 1.45$ |
| 2 | $0.2$ | $1.45$ | $0.2 + 2(1.45) = 3.1$ | $1.45 + 3.1(0.1) = 1.76$ |
Therefore $y(0.3) \approx 1.76$.
Problem 17 (BC). Consider $\frac{dy}{dx} = 1 - y$ with $y(0) = 0$. Use Euler's method with $\Delta x = 0.5$ and 4 steps to approximate $y(2)$. Then compare with the exact solution.
Show Solution
| Step | $x_n$ | $y_n$ | $f = 1 - y_n$ | $y_{n+1}$ |
|---|---|---|---|---|
| 0 | $0$ | $0$ | $1$ | $0 + 1(0.5) = 0.5$ |
| 1 | $0.5$ | $0.5$ | $0.5$ | $0.5 + 0.5(0.5) = 0.75$ |
| 2 | $1.0$ | $0.75$ | $0.25$ | $0.75 + 0.25(0.5) = 0.875$ |
| 3 | $1.5$ | $0.875$ | $0.125$ | $0.875 + 0.125(0.5) = 0.9375$ |
Euler: $y(2) \approx 0.9375$.
Exact: Separate variables in $\frac{dy}{dx} = 1 - y$. Let $u = 1 - y$, then $du = -dy$:
$\int \frac{-du}{u} = \int dx \implies -\ln|1-y| = x + C$. With $y(0) = 0$: $C = 0$.
$y = 1 - e^{-x}$, so $y(2) = 1 - e^{-2} \approx 0.8647$.
Euler's method gives $0.9375$, which is an overestimate. Since $y'' = e^{-x} > 0$ (concave up), we would expect an underestimate—but here the tangent line actually overshoots because the function is approaching the asymptote $y = 1$ from below. The error comes from the large step size $\Delta x = 0.5$.
Problem 18 (BC). The function $y = f(x)$ satisfies $\frac{dy}{dx} = \frac{y}{x}$ with $f(1) = 2$. Use Euler's method with two equal steps to approximate $f(3)$. Is this an overestimate or underestimate? Justify your answer.
Show Solution
Two steps from $x = 1$ to $x = 3$: $\Delta x = \frac{3 - 1}{2} = 1$.
| Step | $x_n$ | $y_n$ | $f = y_n/x_n$ | $y_{n+1}$ |
|---|---|---|---|---|
| 0 | $1$ | $2$ | $2/1 = 2$ | $2 + 2(1) = 4$ |
| 1 | $2$ | $4$ | $4/2 = 2$ | $4 + 2(1) = 6$ |
Euler: $f(3) \approx 6$. Exact: $y = 2x$, so $f(3) = 6$. In this case, Euler's method gives the exact answer! This occurs because the exact solution is linear ($y = 2x$), so the tangent line at any point IS the solution curve. Euler's method has zero error for linear solutions regardless of step size.