Chapter 4: Introduction to Differential Equations
4.3 Separable Equations
Study guide for Calculus Volume 2 (Gilbert Strang, 2016 edition)
Independent study guide. Not affiliated with OpenStax or Rice University.
Big idea
The previous section gave you a way to see solutions and a way to approximate them. This one gives the first way to produce them exactly, and it works whenever the right side of a first-order equation factors into a part that depends only on the independent variable and a part that depends only on the unknown.
The idea is bookkeeping. If $\frac{dy}{dx} = f(x)g(y)$, move everything involving $y$ to one side and everything involving $x$ to the other, so that the equation reads $\frac{dy}{g(y)} = f(x)\,dx$. Now each side is an ordinary integration problem in a single variable, and the chain rule guarantees that integrating both sides produces a correct relation between $x$ and $y$. The whole method is one substitution dressed up in convenient notation.
What you get out is usually an implicit relation rather than a formula for $y$. That is normal and often final: $y^2 + x^2 = C$ describes the solutions perfectly well even though solving for $y$ forces a choice of branch. When an initial condition is supplied, it picks the branch for you, and it also tells you which interval around the starting point the solution actually lives on.
Two things go wrong if you are careless, and both are worth naming in advance. Dividing by $g(y)$ is illegal wherever $g(y) = 0$, and those values give constant solutions that the general formula may not contain. And the interval of validity is not always the whole line: a separable equation can produce a solution that runs off to infinity at a finite value of $x$, and the formula does not warn you unless you look.
Decoder
If the derivative factors as a function of the independent variable times a function of the unknown, then antiderivatives of the two factors, taken separately, are equal up to a constant.
Read the statement as a licence to integrate two different variables in the same line. The justification is the chain rule run backwards. Starting from $\frac{1}{g(y)}\frac{dy}{dx} = f(x)$, let $H$ be an antiderivative of $1/g$. Then the left side is exactly $\frac{d}{dx}H(y(x))$, so both sides are derivatives with respect to $x$ of known things, and equal derivatives differ by a constant.
The differential notation $\frac{dy}{g(y)} = f(x)\,dx$ is shorthand for that argument, not a separate fact. It is safe because it always unwinds to the substitution above. This is why one constant of integration suffices: a constant on each side could be merged into a single one anyway.
The classic mistake is attaching the constant at the end, after solving for $y$. Add $C$ at the moment you integrate, while the relation is still implicit. Moving it later changes what it means, since exponentiating or squaring a relation does not carry an additive constant through unchanged.
Definitions and results
Separable equation. A first-order equation that can be written $\frac{dy}{dx} = f(x)\,g(y)$. Equivalently, $h(y)\,\frac{dy}{dx} = f(x)$ with $h = 1/g$.
The method. Separate, integrate both sides once, and attach a single constant:
$$ \int \frac{dy}{g(y)} = \int f(x)\,dx + C $$
Then solve for $y$ if you can, and leave the relation implicit if you cannot.
Why it is legal. With $H' = 1/g$ and $F' = f$, the separated equation says $\frac{d}{dx}\big[H(y(x))\big] = \frac{d}{dx}\big[F(x)\big]$. Two functions with the same derivative on an interval differ by a constant, which gives $H(y) = F(x) + C$.
Equilibrium solutions. Every root of $g$ gives a constant solution. If $g(a) = 0$ then $y \equiv a$ satisfies the equation, and dividing by $g(y)$ during separation can hide it. Check the roots of $g$ separately and report them.
General versus particular. The relation with $C$ free is the general solution. An initial condition $y(x_0) = y_0$ determines $C$, and the resulting particular solution is the one whose curve passes through that point.
Choosing a branch. When solving for $y$ requires a square root or an inverse, the initial condition selects the sign or the branch. Substitute the initial point into your final formula to confirm you chose correctly.
Interval of validity. The solution of an initial-value problem is defined on the largest interval containing $x_0$ on which the formula is defined and the denominator never vanishes. It can be much smaller than the domain of the differential equation itself.
Combining a constant of integration. Constants that pass through an exponential or a logarithm change form. Rewriting $e^{C}$ as a new positive constant $A$, and then allowing $A$ to be negative or zero to absorb the equilibrium solutions, is standard and worth doing explicitly once.
Worked examples
Separating a growth equation
Solve $\dfrac{dy}{dx} = 2xy$.
The constant function $y \equiv 0$ is a solution, since both sides are then $0$. For $y \neq 0$, separate and integrate:
$$ \int \frac{dy}{y} = \int 2x\,dx \quad \Longrightarrow \quad \ln|y| = x^2 + C $$
Exponentiate: $|y| = e^{C}e^{x^2}$, so $y = A e^{x^2}$ with $A = \pm e^{C}$ any nonzero constant. Allowing $A = 0$ folds the equilibrium back in, so the general solution is $y = Ae^{x^2}$ with $A$ arbitrary.
Check: $y' = 2xAe^{x^2} = 2xy$, as required.
An initial-value problem with a branch to choose
Solve $\dfrac{dy}{dx} = \dfrac{3x^2}{2y}$ with $y(0) = 2$.
Separate: $2y\,dy = 3x^2\,dx$. Integrating both sides gives
$$ y^2 = x^3 + C $$
The initial condition gives $4 = 0 + C$, so $C = 4$ and $y^2 = x^3 + 4$. Since $y(0) = 2$ is positive and a solution is continuous, take the positive root:
$$ y = \sqrt{x^3 + 4} $$
Check by differentiating: $y' = \frac{3x^2}{2\sqrt{x^3+4}} = \frac{3x^2}{2y}$, which is the equation, and $y(0) = \sqrt{4} = 2$.
The interval matters here. The formula needs $x^3 + 4 > 0$, that is $x > -\sqrt[3]{4}$, and the original equation needs $y \neq 0$, which fails exactly at that endpoint. So the solution lives on $\left(-\sqrt[3]{4}, \infty\right)$ and no larger interval.
A solution that quits early
Solve $\dfrac{dy}{dx} = y^2$ with $y(0) = 1$.
Again $y \equiv 0$ is an equilibrium. For $y \neq 0$, separate:
$$ \int y^{-2}\,dy = \int dx \quad \Longrightarrow \quad -\frac{1}{y} = x + C \quad \Longrightarrow \quad y = \frac{-1}{x + C} $$
The condition $y(0) = 1$ gives $-1/1 = C$, so $C = -1$ and
$$ y = \frac{1}{1 - x} $$
Check: $y' = \frac{1}{(1-x)^2} = y^2$, and $y(0) = 1$. The right side of the differential equation is a polynomial, defined everywhere, yet this solution runs to infinity as $x$ approaches $1$. The interval of validity is $(-\infty, 1)$. Note also that the equilibrium $y \equiv 0$ is not any member of the family $-1/(x+C)$, which is exactly the solution that division threw away.
Cooling toward room temperature
A cup of coffee at $190$ degrees is left in a room held at $70$ degrees, and its temperature obeys $\frac{dT}{dt} = -k(T - 70)$ for some $k > 0$. After $10$ minutes it reads $150$ degrees. Find the temperature after $20$ minutes.
Separate and integrate:
$$ \int \frac{dT}{T - 70} = \int -k\,dt \quad \Longrightarrow \quad \ln|T - 70| = -kt + C $$
so $T = 70 + Ae^{-kt}$. The initial reading gives $190 = 70 + A$, hence $A = 120$. The ten-minute reading gives
$$ 150 = 70 + 120e^{-10k} \quad \Longrightarrow \quad e^{-10k} = \frac{80}{120} = \frac{2}{3} $$
Rather than extracting $k$, use that value directly. Since $e^{-20k} = \left(e^{-10k}\right)^2 = \frac49$,
$$ T(20) = 70 + 120 \cdot \frac{4}{9} = 70 + \frac{160}{3} \approx 123.3 $$
The answer sits between $70$ and $150$, and the second ten minutes cooled the cup by about $27$ degrees against $40$ for the first ten. That is the right shape: the gap above room temperature shrinks by the same factor $\tfrac23$ every ten minutes, so cooling slows as the coffee approaches the room.
Practice
Begin with the mechanics on equations given to you already factored. Separate, integrate, attach one constant, and report the constant solutions that division removed.
Practice
Generated problems for this section, graded instantly.
Then add initial data. These ask for the particular solution, the correct branch when a root or logarithm appears, and the interval on which the answer is valid.
Practice
Generated problems for this section, graded instantly.
Quiz
Five items on recognizing separability, carrying out the integration, handling equilibrium solutions, and pinning down a particular solution.
Quiz
5 problems with a score at the end.