Mathematics.

ordinary differential equations

Separation of Variables

Differential Equations30 minDifficulty4 out of 10

You should know: first order differential equation

Overview

Separation of variables is a method for solving ordinary and partial differential equations in which algebra allows the equation to be rewritten so that each of two variables occurs on a different side of the equation. For a first-order ODE dy/dx = g(x)h(y), this means moving every y-dependent piece (including dy) to one side and every x-dependent piece (including dx) to the other, so that each side can be integrated independently, one variable at a time.

Intuition

Separation of variables works whenever the rate of change dy/dx factors cleanly into 'a piece that depends only on x' times 'a piece that depends only on y.' Once split apart like that, dy/h(y) and g(x)dx are just two ordinary one-variable integrals — the coupling between x and y disappears entirely during the integration step and only comes back when you combine the two antiderivatives into a single implicit (or explicit) relationship between y and x.

Formal Definition

Definition

A first-order ODE is separable if it can be written in the form below; dividing by h(y) and integrating both sides solves it:

dydx=g(x)h(y)\frac{dy}{dx} = g(x)h(y)
Separable ODE
1h(y)dydx=g(x)\frac{1}{h(y)}\frac{dy}{dx} = g(x)
Divide both sides by h(y), assuming h(y) \ne 0
dyh(y)=g(x)dx+C\int \frac{dy}{h(y)} = \int g(x)\,dx + C
Integrate each side with respect to its own variable

Notation

NotationMeaning
g(x)g(x)The factor of the right-hand side depending only on the independent variable x
h(y)h(y)The factor of the right-hand side depending only on the dependent variable y
h(y0)=0    y=y0h(y_0) = 0 \implies y = y_0A constant solution lost when dividing by h(y); must be checked separately

Derivation

Formally, the separation step can be justified by treating dy/dx as a genuine ratio (via the chain rule) rather than mere notation: writing y = f(x), the equation f′(x) = g(x)h(f(x)) rearranges as follows.

ddxf(x)=g(x)h(f(x))\frac{d}{dx}f(x) = g(x)h(f(x))

Original ODE with y = f(x) made explicit

1h(f(x))dfdx=g(x)\frac{1}{h(f(x))}\frac{df}{dx} = g(x)

Divide both sides by h(f(x))

1h(f(x))dfdxdx=g(x)dx\int \frac{1}{h(f(x))}\frac{df}{dx}\,dx = \int g(x)\,dx

Integrate both sides with respect to x

dyh(y)=g(x)dx\int \frac{dy}{h(y)} = \int g(x)\,dx

Substitute y = f(x) on the left, converting the integral to one in y (change of variables)

Applications

Newton's law of cooling, dT/dt = -k(T - T_ambient), and radioactive decay, dN/dt = -λN, are both solved directly by separation of variables.

Worked Examples

  1. Recognize g(x) = x and h(y) = y, then separate.

    dyy=xdx\frac{dy}{y} = x\,dx
  2. Integrate both sides.

    dyy=xdx    lny=x22+C\int \frac{dy}{y} = \int x\,dx \implies \ln|y| = \frac{x^2}{2} + C
  3. Exponentiate and absorb the constant.

    y=Aex2/2y = Ae^{x^2/2}
  4. Apply y(0) = 3 to find A.

    3=Ae0    A=33 = Ae^0 \implies A = 3

Answer: y = 3e^(x²/2)

Practice Problems

Difficulty 4/10

Solve dy/dx = -2xy² with y(0) = 1.

Difficulty 5/10

Solve Newton's law of cooling dT/dt = -k(T - 20) with T(0) = 100.

Common Mistakes

Common Mistake

Dividing by h(y) without checking whether h(y) = 0 for some constant y, which silently discards valid 'singular' solutions.

Before dividing by h(y), check values y₀ where h(y₀)=0 — the constant function y = y₀ is always itself a solution to dy/dx = g(x)h(y), and it can be lost during separation.

Common Mistake

Treating dy/dx purely as notation and refusing to 'split' it, or conversely treating the separation step as fully rigorous algebra rather than a shorthand for the substitution/integration argument.

The dy/dx split is justified rigorously via the chain rule and change of variables in the integral (as in the derivation), so it is safe to use as a computational shortcut once you understand why it works.

Quiz

A first-order ODE is separable when it can be written as:
The key algebraic step in separation of variables is to:

Summary

  • Separation of variables applies to ODEs of the form dy/dx = g(x)h(y), where the right side factors into an x-only and a y-only piece.
  • The method rewrites the equation as dy/h(y) = g(x)dx, then integrates each side independently.
  • Constant solutions where h(y)=0 must be checked separately since they can be lost when dividing by h(y).
  • The technique solves classic models: exponential growth/decay, Newton's law of cooling, and the logistic equation.
  • It generalizes to some partial differential equations, where a solution is sought as a product of single-variable functions.

References