AP Calculus AB · Differential equations
Separation of variables
1Separable equations
A differential equation is separable if it can be written as
$$\frac{dy}{dx} = g(x)\,h(y)$$
so the $x$-part and the $y$-part are multiplied. Then we can move all the $y$'s to one side and all the $x$'s to the other.
- $\frac{dy}{dx} = xy$ is separable: $g(x) = x$, $h(y) = y$.
- $\frac{dy}{dx} = \frac{x^2}{y}$ is separable.
- $\frac{dy}{dx} = x + y$ is not separable (a sum, not a product).
Check yourself
Which differential equation is separable?
Show the answer
dy/dx = x²y³
It is a product of an x-part and a y-part.
2The method
- Separate: get all $y$ terms with $dy$ on one side, all $x$ terms with $dx$ on the other.
- Integrate both sides. Put a single constant $C$ on the $x$ side.
- Use the initial condition to find $C$ (do this as soon as you can).
- Solve for $y$ explicitly, if asked.
$\frac{dy}{dx} = \frac{x}{y}$, with $y(0) = 3$
- Separate: $y\,dy = x\,dx$.
- Integrate: $\frac{y^2}{2} = \frac{x^2}{2} + C$.
- Initial condition: $\frac{9}{2} = 0 + C$, so $C = \frac{9}{2}$.
- $y^2 = x^2 + 9$. Since $y(0) = 3 > 0$, take the positive root: $y = \sqrt{x^2 + 9}$.
Check yourself
After separating dy/dx = 2x/y², you get:
Show the answer
y² dy = 2x dx
Multiply both sides by y² dx.
3Exponential solutions
$\frac{dy}{dx} = 2xy$, with $y(0) = 5$
- Separate: $\frac{1}{y}\,dy = 2x\,dx$.
- Integrate: $\ln|y| = x^2 + C$.
- Initial condition: $\ln 5 = 0 + C$, so $C = \ln 5$.
- $|y| = e^{x^2 + \ln 5} = 5e^{x^2}$. Since $y(0) = 5 > 0$, $y = 5e^{x^2}$.
Note how $e^{x^2 + C} = e^C \cdot e^{x^2}$: the constant becomes a multiplier.
Check yourself
Integrating (1/y) dy gives:
Show the answer
ln|y|
The log rule.
4Common mistakes
- Forgetting $C$: without it, you cannot fit the initial condition. On the AP exam, a solution without a constant of integration earns very little credit.
- Adding $C$ too late: write $C$ when you integrate, before solving for $y$. Adding "+C" after exponentiating gives the wrong family.
- Not separating fully: $\frac{dy}{dx} = x(y + 1)$ separates as $\frac{dy}{y + 1} = x\,dx$, not $dy = x(y + 1)\,dx$.
- Choosing the wrong sign after a square root: use the initial condition to decide.
Add the constant when you integrate, then use the initial condition before solving for y
Check yourself
When should the constant C be added?
Show the answer
Immediately when integrating, before solving for y
Adding it later gives the wrong family.
5Domain and checking
After solving, check that your solution satisfies the initial condition and makes sense on its domain.
$\frac{dy}{dx} = y^2$, with $y(0) = 1$
- Separate: $y^{-2}\,dy = dx$.
- Integrate: $-\frac{1}{y} = x + C$.
- $y(0) = 1$: $-1 = C$.
- $-\frac{1}{y} = x - 1$, so $y = \frac{1}{1 - x}$.
- The solution is valid only for $x < 1$ (the interval containing $x = 0$), because it blows up at $x = 1$.
Check yourself
For y = 1/(1 − x) with y(0) = 1, the solution is valid on:
Show the answer
x < 1
The interval containing the initial x-value.
6Going deeper: the full procedure, with the steps that earn each mark
A differential equation is separable if it can be written $\frac{dy}{dx} = g(x)\,h(y)$.
Procedure
- Separate: all y terms with dy on one side; all x terms with dx on the other.
- Integrate both sides.
- Add + C (on one side) immediately.
- Use the initial condition to find C.
- Solve for y.
- Choose the branch (the sign) that fits the initial condition, and note the domain.
On the exam, no separation means almost no credit, and a missing constant of integration loses most of the remaining marks.
$\frac{dy}{dx} = xy$, y(0) = 2.
- $\frac{dy}{y} = x\,dx$.
- $\ln|y| = \frac{x^2}{2} + C$.
- At (0, 2): ln 2 = C.
- $|y| = e^{x^2/2 + \ln 2} = 2e^{x^2/2}$.
- y is positive at the initial point: $y = 2e^{x^2/2}$.
Worked example (choosing the sign): $\frac{dy}{dx} = \frac{x}{y}$, y(0) = −3.
- y dy = x dx.
- $\frac{y^2}{2} = \frac{x^2}{2} + C$.
- At (0, −3): C = $\frac{9}{2}$.
- $y^2 = x^2 + 9$.
- The initial value is negative: $y = -\sqrt{x^2 + 9}$.
Worked example (shifted): $\frac{dy}{dx} = 2x(y - 1)$, y(0) = 3.
- $\frac{dy}{y - 1} = 2x\,dx$.
- $\ln|y - 1| = x^2 + C$.
- C = ln 2.
- $y - 1 = 2e^{x^2}$, so $y = 1 + 2e^{x^2}$.
Worked example (a power of y): $\frac{dy}{dx} = y^2$, y(0) = 1.
- $y^{-2}\,dy = dx$.
- $-\frac{1}{y} = x + C$; C = −1.
- $y = \frac{1}{1 - x}$, valid for x < 1 (the solution blows up at x = 1).
Exponential growth and decay: $\frac{dy}{dt} = ky$ gives $y = y_0e^{kt}$.
Worked example (Newton's law of cooling): $\frac{dT}{dt} = -0.1(T - 20)$, T(0) = 90.
- $\frac{dT}{T - 20} = -0.1\,dt$.
- $\ln|T - 20| = -0.1t + C$; C = ln 70.
- $T = 20 + 70e^{-0.1t}$.
- As t → ∞, T → 20, the room temperature.
Particular and general solutions: the general solution contains C; the particular solution satisfies the initial condition.
Checking: differentiate the answer and confirm it satisfies both the equation and the initial condition.
Not every equation separates: $\frac{dy}{dx} = x + y$ cannot be written as g(x)h(y).
Domain of the solution: the largest interval containing the initial x-value on which the solution is defined and differentiable.
Common mistakes
- Not separating (leaving y on the x side).
- Forgetting + C, or adding it after solving for y (so that it is in the wrong place).
- Writing $e^{x^2/2 + C}$ as $e^{x^2/2} + C$.
- Choosing the wrong sign for a square root.
- Dropping the absolute value too early without checking the sign.
- Integrating $\frac{1}{y^2}$ as ln(y²).
Check yourself
Solve dy/dx = 3y with y(0) = 5.
Show the answer
y = 5e^(3x)
Separating gives ln|y| = 3x + C, and the initial condition makes the constant factor 5.
7For top marks
AP scoring for separation of variables usually gives points for:
- Separating the variables correctly.
- Antiderivatives of both sides.
- The constant of integration and using the initial condition.
- Solving for $y$.
Show each step on its own line.
"$\frac{dy}{y - 2} = 3\,dx$; $\ln|y - 2| = 3x + C$; with $y(0) = 5$, $C = \ln 3$; so $y = 2 + 3e^{3x}$."
Check yourself
dy/dx = 3(y − 2) and y(0) = 5. Then y =
Show the answer
2 + 3e^(3x)
|y − 2| = 3e^(3x), and y − 2 > 0.
Now test yourself
This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.
Practise in Impera