Separable differential equations
Solving separable differential equations dy/dx = f(x)g(y) by separating the variables and integrating both sides, finding constant solutions first, handling absolute values, and using initial conditions.
A huge number of real models, from population growth to draining tanks, have the gradient split into an "$x$ part" times a "$y$ part". These separable equations are the main type you solve exactly in this course, and the method is short: get all the $y$ on one side, all the $x$ on the other, and integrate.
The method
Why does this work? If $\dfrac{1}{g(y)}\dfrac{dy}{dx} = f(x)$, integrate both sides with respect to $x$. By the chain rule (substitution in reverse), $\displaystyle\int \frac{1}{g(y)}\frac{dy}{dx}\,dx = \int \frac{dy}{g(y)}$.
Solve $\dfrac{dy}{dx} = 2xy$, given $y = 3$ when $x = 0$.
More examples
Solve $\dfrac{dy}{dx} = \dfrac{x}{y}$, given $y = 2$ when $x = 0$.
Solve $\dfrac{dy}{dx} = e^{x - y}$, given $y = \ln3$ when $x = 0$.
Find the general solution of $\dfrac{dy}{dx} = x(1 + y^2)$.
Your turn
Solve $\dfrac{dy}{dx} = y\cos x$, given $y = 2$ when $x = 0$.
Show the working
$\displaystyle\int \frac{dy}{y} = \int \cos x\,dx$, so $\ln|y| = \sin x + C$ and $y = Ae^{\sin x}$. At $x = 0$: $2 = Ae^0$, so $A = 2$ and $y = 2e^{\sin x}$.
Which differential equation is separable?
$x^2y$ is an $x$ part times a $y$ part. The others cannot be written as $f(x)g(y)$.
Solve $\dfrac{dy}{dx} = 3x^2y$ with $y = 2$ when $x = 0$. Find $y$ when $x = 1$, correct to $2$ decimal places.
$\ln|y| = x^3 + C$, so $y = Ae^{x^3}$ with $A = 2$. Then $y(1) = 2e \approx 5.44$.
Solve $\dfrac{dy}{dx} = \dfrac{x}{y}$ with $y = 3$ when $x = 0$. Find $y$ when $x = 4$.
$\dfrac{y^2}{2} = \dfrac{x^2}{2} + C$, and $(0, 3)$ gives $y^2 = x^2 + 9$. Since $y \gt 0$ at the start, $y = \sqrt{x^2 + 9}$, and $y(4) = \sqrt{25} = 5$.
Separating the variables in $\dfrac{dy}{dx} = \dfrac{1 + y^2}{x}$ gives:
Divide both sides by $1 + y^2$ and multiply by $dx$: the $y$ terms go with $dy$, and $\tfrac1x$ goes with $dx$.
Solve $\dfrac{dy}{dx} = e^{x - y}$ with $y = \ln2$ when $x = 0$. Find $y$ when $x = 1$, correct to $2$ decimal places.
$e^y = e^x + C$, and at $x = 0$: $2 = 1 + C$, so $C = 1$. Then $y = \ln(e^x + 1)$ and $y(1) = \ln(e + 1) \approx 1.31$.
Find the constant solution of $\dfrac{dy}{dx} = x(y - 4)$.
$g(y) = y - 4 = 0$ at $y = 4$. On that line $\dfrac{dy}{dx} = 0$ for every $x$, so $y = 4$ is a solution.
Solve $\dfrac{dy}{dx} = x(1 + y^2)$ with $y = 0$ when $x = 0$. Find $y$ when $x = 1$, correct to $2$ decimal places.
$\tan^{-1}y = \tfrac12 x^2 + C$, and $y(0) = 0$ gives $C = 0$. So $y = \tan\left(\tfrac12 x^2\right)$ and $y(1) = \tan0.5 \approx 0.55$.
From $\ln|y| = 2x + C$, the general solution is:
$|y| = e^{2x + C} = e^C e^{2x}$. Combining $\pm e^C$ into one constant gives $y = Ae^{2x}$.
Exam style: solve $\dfrac{dy}{dx} = \dfrac{y^2}{x^2}$ with $y = \tfrac12$ when $x = 1$. Find $y$ when $x = 3$.
$\displaystyle\int y^{-2}\,dy = \int x^{-2}\,dx$ gives $-\dfrac1y = -\dfrac1x + C$. At $(1, \tfrac12)$: $-2 = -1 + C$, so $C = -1$. Then $\dfrac1y = \dfrac1x + 1 = \dfrac{1 + x}{x}$, so $y = \dfrac{x}{1 + x}$ and $y(3) = 0.75$.
Exam style: water drains from a tank so that its depth $h$ (cm) satisfies $\dfrac{dh}{dt} = -0.5\sqrt h$, with $h = 16$ at $t = 0$. When is the tank empty?
$\displaystyle\int h^{-1/2}\,dh = \int -0.5\,dt$ gives $2\sqrt h = -0.5t + C$. At $t = 0$: $8 = C$. Empty when $h = 0$: $0 = -0.5t + 8$, so $t = 16$.
Coaching Centre