Table of Contents
Separation of variables is a specific method for solving certain first‑order differential equations. In this chapter we focus entirely on:
- Recognizing when separation of variables can be used.
- Performing the steps of the method.
- Understanding the role of the constant of integration and initial conditions.
- Seeing a few simple examples and common pitfalls.
We assume you already know what a first‑order differential equation is from the parent chapter.
The basic idea
A first‑order differential equation involving a function $y(x)$ and its derivative $\dfrac{dy}{dx}$ is separable if it can be written so that:
- all terms involving $y$ are on one side, and
- all terms involving $x$ are on the other side,
in a form like
$$
\frac{dy}{dx} = f(x)\,g(y).
$$
In that case, we can “separate” the variables by rewriting this as
$$
\frac{1}{g(y)}\,dy = f(x)\,dx
$$
and then integrate both sides.
So the key pattern to recognize is that the derivative can be expressed as a product of a function of $x$ and a function of $y$.
General procedure
Suppose we have a differential equation that can be written in the form
$$
\frac{dy}{dx} = f(x)\,g(y).
$$
The standard separation of variables procedure is:
- Rewrite in separated form
Move all $y$-dependent factors to one side and all $x$-dependent factors to the other:
$$
\frac{1}{g(y)}\,dy = f(x)\,dx.
$$
This step is often written informally by “treating $\dfrac{dy}{dx}$ like a fraction,” although formally it comes from the chain rule. For this chapter, we simply use that manipulation as a working tool.
- Integrate both sides
Integrate with respect to their own variables:
$$
\int \frac{1}{g(y)}\,dy = \int f(x)\,dx.
$$
- Add the constant of integration
After integrating, combine any constants from both sides into a single constant $C$:
$$
G(y) = F(x) + C,
$$
where $G'(y) = \dfrac{1}{g(y)}$ and $F'(x) = f(x)$.
- (If possible) Solve explicitly for $y$
Try to isolate $y$ in terms of $x$. This gives an explicit solution $y = y(x)$. Sometimes you can only leave the relationship in implicit form, e.g. $G(y) = F(x) + C$.
- Use initial conditions if given
If an initial value is given, such as $y(x_0) = y_0$, substitute $x_0$ and $y_0$ into your solution to determine the constant $C$.
This turns a general solution (with $C$) into a particular solution (with a specific value of $C$).
Recognizing a separable equation
A first‑order equation is separable if you can rewrite it in the form
$$
\frac{dy}{dx} = f(x)\,g(y)
$$
or, more generally,
$$
M(y)\,dy = N(x)\,dx,
$$
with $M$ depending only on $y$ and $N$ only on $x$.
Some common patterns:
- $y' = k y$ (exponential growth/decay):
$$
\frac{dy}{dx} = k y \quad\Rightarrow\quad \frac{1}{y}\,dy = k\,dx.
$$ - $y' = x^2 y^3$:
$$
\frac{dy}{dx} = x^2 y^3 \quad\Rightarrow\quad \frac{1}{y^3}\,dy = x^2\,dx.
$$ - $y' = \dfrac{x}{1 + y^2}$:
$$
\frac{dy}{dx} = \frac{x}{1 + y^2}
\quad\Rightarrow\quad
(1 + y^2)\,dy = x\,dx.
$$
If $x$ and $y$ are “mixed together” in a way that can’t be separated into a product or separated sides, then this method does not apply.
Simple worked examples
Example 1: Exponential growth
Solve
$$
\frac{dy}{dx} = 3y.
$$
- Separate variables:
$$
\frac{1}{y}\,dy = 3\,dx.
$$ - Integrate both sides:
$$
\int \frac{1}{y}\,dy = \int 3\,dx.
$$
This gives
$$
\ln|y| = 3x + C.
$$ - Solve for $y$:
Exponentiate both sides:
$$
|y| = e^{3x + C} = e^C e^{3x}.
$$
Rename $e^C$ as a new constant $K$ (which can be positive or negative when you drop the absolute value):
$$
y = K e^{3x}.
$$
This is the general solution. Any particular solution corresponds to a specific value of $K$.
Example 2: With an initial condition
Solve
$$
\frac{dy}{dx} = 2xy,
\quad\text{with}\quad y(0) = 5.
$$
- Separate:
$$
\frac{1}{y}\,dy = 2x\,dx.
$$ - Integrate:
$$
\int \frac{1}{y}\,dy = \int 2x\,dx
\quad\Rightarrow\quad
\ln|y| = x^2 + C.
$$ - Solve for $y$:
$$
|y| = e^{x^2 + C} = e^C e^{x^2}.
$$
Let $K = e^C$:
$$
y = K e^{x^2}.
$$ - Use the initial condition $y(0) = 5$:
Substitute $x = 0$, $y = 5$:
$$
5 = K e^{0^2} = K.
$$
So $K = 5$, and the particular solution is
$$
y = 5 e^{x^2}.
$$
Example 3: Nonlinear power
Solve
$$
\frac{dy}{dx} = x^2 y^3.
$$
- Separate:
$$
\frac{1}{y^3}\,dy = x^2\,dx.
$$ - Integrate:
$$
\int y^{-3}\,dy = \int x^2\,dx.
$$
Compute:
$$
\int y^{-3}\,dy = \frac{y^{-2}}{-2} = -\frac{1}{2y^2}, \quad
\int x^2\,dx = \frac{x^3}{3}.
$$
So
$$
-\frac{1}{2y^2} = \frac{x^3}{3} + C.
$$
- Solve for $y$ (optional but often useful):
Multiply by $-2$:
$$
\frac{1}{y^2} = -\frac{2}{3}x^3 + C_1,
$$
where $C_1 = -2C$ is just another constant.
Invert both sides (where the right side is not zero):
$$
y^2 = \frac{1}{- \frac{2}{3}x^3 + C_1}.
$$
Then
$$
y = \pm \sqrt{\frac{1}{- \frac{2}{3}x^3 + C_1}}.
$$
Often it is acceptable to leave the answer in an implicit form like
$$
-\frac{1}{2y^2} = \frac{x^3}{3} + C.
$$
Using initial conditions
When you have an initial value problem
$$
\frac{dy}{dx} = f(x)\,g(y), \quad y(x_0) = y_0,
$$
the steps are:
- Solve the differential equation by separation to get a general solution with a constant $C$ (or in exponential form with a constant factor).
- Plug in $x_0$ and $y_0$:
$$
\text{(solution with $x = x_0$, $y = y_0$)} \quad\Rightarrow\quad \text{equation for } C.
$$ - Solve that equation for $C$ and substitute back to obtain the particular solution.
This procedure is the same pattern you saw in earlier examples.
Important subtleties
1. Division by zero and missing solutions
When you separate variables, you often divide by an expression involving $y$ (for example, dividing by $y$ or $1-y$). You must check whether any solutions are lost by this division.
Example:
$$
\frac{dy}{dx} = y(1 - y).
$$
This is separable:
$$
\frac{dy}{dx} = y(1-y)
\quad\Rightarrow\quad
\frac{1}{y(1-y)}\,dy = dx.
$$
But before dividing by $y(1-y)$, notice that $y = 0$ and $y = 1$ make the right-hand side zero. Both $y(x) \equiv 0$ and $y(x) \equiv 1$ are constant solutions (they satisfy $y' = 0$ and $y(1-y) = 0$).
The separated equation
$$
\frac{1}{y(1-y)}\,dy = dx
$$
implicitly assumes $y \neq 0$ and $y \neq 1$, so those constant solutions are not captured by the integration step. When you finish solving, always check whether constant functions might also satisfy the original equation.
2. Implicit vs explicit solutions
Sometimes solving for $y$ explicitly is messy or impossible with elementary functions. In those cases, it is acceptable to leave the solution in implicit form, such as:
$$
G(y) = F(x) + C.
$$
As long as this relation correctly describes the set of $(x,y)$ that satisfy the differential equation, it is a valid solution.
3. Domains and absolute values
When integrating $\dfrac{1}{y}$, you get $\ln|y|$, not just $\ln y$. In many textbook solutions, the constant of integration is adjusted so that the absolute value is absorbed into the constant factor in the exponential form (for example, going from $\ln|y| = x + C$ to $y = C_1 e^x$ where $C_1$ can be positive or negative). However, be aware that:
- The sign of the constant affects the possible values of $y$.
- Sometimes the domain in $x$ is restricted so that $y$ does not cross zero.
If the domain or sign matters in an application, you must interpret your constant and absolute value carefully.
Common practice problems (conceptual types)
While detailed exercises are for another part of the course, here are typical types of problems that use separation of variables:
- Purely algebraic separable equations, like
$$
\frac{dy}{dx} = (x^2 + 1)\,y^4.
$$ - Growth and decay type equations:
$$
\frac{dy}{dx} = ky,
$$
with given initial values. - Equations where $x$ appears in a simple way but $y$ has a more complicated function, for instance:
$$
\frac{dy}{dx} = \frac{x}{1 + y^2}, \qquad
\frac{dy}{dx} = (1+y)^2 e^x.
$$ - Problems combining separation of variables with an applied interpretation (for example, population growth models), where you first separate and integrate, then interpret the constants using the given conditions.
In all such problems, the key is to identify whether all $y$ terms can be collected on one side and all $x$ terms on the other, then apply the steps of separation and integration systematically.