
# 2.4: Separable Differential Equations

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

A differential equation is called separable if it can be written as

$f(y)\,dy = g(x)\,dx.$

Steps To Solve a Separable Differential Equation

To solve a separable differential equation

1. Get all the $$y$$'s on the left hand side of the equation and all of the $$x$$'s on the right hand side.
2. Integrate both sides.
3. Plug in the boundary conditions (e.g. given initial values) to find the constant of integration ($$C$$).
4. Solve for $$y$$.

Example $$\PageIndex{1}$$

Solve $$\dfrac{dy}{dx} = y(3 - x)$$ with $$y(0 )= 5$$.

Solution

\begin{align*} \dfrac{dy}{y} &= (3 - x) dx \\[4pt] \int \dfrac{dy}{y} &= \int (3-x) dx \\[4pt] \ln\; y &= 3x - \dfrac{x^2}{2} + C \\[4pt] \ln 5 &= 0 + 0 + C \\[4pt] C &= \ln\; 5 \\[4pt] y &= e^{3x-\frac{x^2}{2}} + \ln \; 5 \\[4pt] y &= e^{3x-\frac{x^2}{2}} \; e^{\ln \; 5} \\[4pt] &= 5e^{3x-\frac{x^2}{2}}. \end{align*}

Exercise $$\PageIndex{1}$$

1. $$\dfrac{dy}{dx} = \dfrac{x}{y}$$ with $$y(0) = 1$$
2. $$\dfrac{dy}{dx} = x(x+1)$$ with $$y(1) = 1$$
3. $$2xy + \dfrac{dy}{dx} = x$$ with $$y(0) = 2$$