Kahibaro
Discord Login Register

Separation of variables

Separation of variables is a specific method for solving certain first‑order differential equations. In this chapter we focus entirely on:

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:

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:

  1. 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.

  1. Integrate both sides

Integrate with respect to their own variables:
$$
\int \frac{1}{g(y)}\,dy = \int f(x)\,dx.
$$

  1. 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)$.

  1. (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$.

  1. 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:

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.
$$

  1. Separate variables:
    $$
    \frac{1}{y}\,dy = 3\,dx.
    $$
  2. Integrate both sides:
    $$
    \int \frac{1}{y}\,dy = \int 3\,dx.
    $$
    This gives
    $$
    \ln|y| = 3x + C.
    $$
  3. 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.
$$

  1. Separate:
    $$
    \frac{1}{y}\,dy = 2x\,dx.
    $$
  2. Integrate:
    $$
    \int \frac{1}{y}\,dy = \int 2x\,dx
    \quad\Rightarrow\quad
    \ln|y| = x^2 + C.
    $$
  3. Solve for $y$:
    $$
    |y| = e^{x^2 + C} = e^C e^{x^2}.
    $$
    Let $K = e^C$:
    $$
    y = K e^{x^2}.
    $$
  4. 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.
$$

  1. Separate:
    $$
    \frac{1}{y^3}\,dy = x^2\,dx.
    $$
  2. 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.
$$

  1. 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:

  1. Solve the differential equation by separation to get a general solution with a constant $C$ (or in exponential form with a constant factor).
  2. Plug in $x_0$ and $y_0$:
    $$
    \text{(solution with $x = x_0$, $y = y_0$)} \quad\Rightarrow\quad \text{equation for } C.
    $$
  3. 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:

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:

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.

Views: 12

Comments

Please login to add a comment.

Don't have an account? Register now!