Section 2.2 · Differential Equations

Separable Equations

The cleanest trick in ODEs — when two variables refuse to mix, you pull them apart and integrate each side on its own.

Separation of Variables Implicit Solutions Initial Value Problems First Principles

What Does "Separable" Mean?

A differential equation connects a function \( y(x) \) to its rate of change \( \frac{dy}{dx} \). A separable equation is one where the right-hand side can be factored into a piece that only involves \( x \) multiplied by a piece that only involves \( y \).

Definition — Separable ODE

An ODE is separable if it can be written as:

$$\frac{dy}{dx} = g(x) \cdot h(y)$$

The \(x\)-stuff and \(y\)-stuff can be completely divorced — no mixing, no cross-terms.

Core Intuition

Imagine you're trying to figure out how fast a population grows. The rate depends on two things: how many creatures are already there (a \(y\) thing) AND how favorable the environment is at time \(t\) (an \(x\) thing). If those two influences just multiply together rather than tangle up in some complicated way, the equation is separable.

How to Spot One

Try to factor \( f(x,y) \) on the right side. If you can split it into \( g(x) \cdot h(y) \), you're done.

EquationSeparable?Factored Form
\(\dfrac{dy}{dx} = xy\)✓ Yes\(g(x)=x,\quad h(y)=y\)
\(\dfrac{dy}{dx} = x + y\)✗ NoCan't factor — terms add, not multiply
\(\dfrac{dy}{dx} = \dfrac{x^2}{y^2}\)✓ Yes\(g(x)=x^2,\quad h(y)=\frac{1}{y^2}\)
\(\dfrac{dy}{dx} = e^{x+y}\)✓ Yes\(e^{x+y} = e^x \cdot e^y\)
\(\dfrac{dy}{dx} = \sin(xy)\)✗ NoNo clean factoring
Pro Tip

The exponential \( e^{x+y} = e^x \cdot e^y \) is a classic disguise. Always try to use exponent rules to split them.

The Separation of Variables Method

Here is the complete procedure. We are going to understand why each step is legal, not just memorize the moves.

Starting Point

We have: \(\quad \dfrac{dy}{dx} = g(x)\,h(y)\)

The Four Moves

Step-by-Step Derivation

Start with the equation:

$$\frac{dy}{dx} = g(x)\,h(y)$$
// We have a rate of change equal to a product of separate pieces

Divide both sides by \(h(y)\) (assuming \(h(y) \neq 0\)):

$$\frac{1}{h(y)}\frac{dy}{dx} = g(x)$$
// Now the left side only "cares" about y, and the right side only "cares" about x

Integrate both sides with respect to \(x\):

$$\int \frac{1}{h(y)}\frac{dy}{dx}\,dx = \int g(x)\,dx$$
// Legal because equality is preserved when you do the same thing to both sides

Apply the substitution \( dy = \frac{dy}{dx}dx \) to the left side:

$$\int \frac{1}{h(y)}\,dy = \int g(x)\,dx$$
// This is the Chain Rule working backwards — the \(\frac{dy}{dx}dx\) collapses to \(dy\)
Why Does Step ④ Work?

Think of \(\frac{dy}{dx}\) as a fraction (this is informal but captures the idea). When you write \(\frac{dy}{dx} \cdot dx\), the \(dx\)'s "cancel" and you're left with \(dy\). More rigorously: by the substitution rule for integrals, if \(y\) is a function of \(x\), then \(\int f(y)\,\frac{dy}{dx}\,dx = \int f(y)\,dy\). This is just the Chain Rule reversed.

Final Form — Separated Equation
$$\int \frac{dy}{h(y)} = \int g(x)\,dx$$

Each side is now a pure, single-variable integral. Evaluate them both, combine constants, done.

The "Leibniz Shortcut" Notation

In practice, people write the separation more suggestively. Starting from step ①:

$$\frac{dy}{dx} = g(x)\,h(y) \quad\Longrightarrow\quad \frac{dy}{h(y)} = g(x)\,dx \quad\Longrightarrow\quad \int\frac{dy}{h(y)} = \int g(x)\,dx$$

It looks like we "multiplied \(dx\) to the right side." That's not exactly what's happening (the rigorous version is the substitution above), but it gives the correct answer and is the standard notation you'll see everywhere.

Why Is This Actually Valid?

Let's go deeper and prove the separation step rigorously using the Chain Rule. This is where the real understanding lives.

Theorem — Validity of Separation of Variables

Suppose \(\frac{dy}{dx} = g(x)h(y)\) and let \(H(y)\) be an antiderivative of \(\frac{1}{h(y)}\), i.e., \(H'(y) = \frac{1}{h(y)}\). Let \(G(x)\) be an antiderivative of \(g(x)\). Then:

1

Define \( F(x) = H(y(x)) \) — the composite function where we plug our solution \(y(x)\) into \(H\).

2

Differentiate \(F\) with respect to \(x\) using the Chain Rule:

$$\frac{d}{dx}H(y(x)) = H'(y(x))\cdot y'(x) = \frac{1}{h(y)}\cdot\frac{dy}{dx}$$
// Chain Rule: derivative of outer × derivative of inner
3

Substitute the ODE \(\frac{dy}{dx} = g(x)h(y)\) into the expression:

$$\frac{d}{dx}H(y(x)) = \frac{1}{h(y)}\cdot g(x)h(y) = g(x)$$
// The h(y) cancels! Now both sides are functions of x only
4

We now have \(\frac{d}{dx}H(y(x)) = \frac{d}{dx}G(x)\). If two functions have the same derivative everywhere, they differ by at most a constant:

$$H(y(x)) = G(x) + C$$
// This is the Fundamental Theorem of Calculus: equal derivatives → equal functions up to a constant
5

Translating back to integral notation:

$$\int \frac{dy}{h(y)} = \int g(x)\,dx + C$$
// QED — the separation step is justified by Chain Rule + FTC
The Deep Insight

The Chain Rule is the engine powering this whole method. When we wrote \(\frac{1}{h(y)}\frac{dy}{dx}\), we were actually constructing the exact derivative of the composite function \(H(y(x))\). The ODE then tells us that derivative equals \(g(x)\), which means \(H(y(x))\) and \(G(x)\) track each other — they're the same function up to a constant.

Implicit vs Explicit Solutions

After separating and integrating, you get an equation that implicitly defines \(y\) as a function of \(x\). Sometimes you can solve for \(y\) explicitly; sometimes you can't (or it's too messy to bother).

Implicit Solution

A relation \(F(x,y) = C\) that the solution curve satisfies — we haven't isolated \(y\).

$$x^2 + y^2 = C$$

Both \(y = \sqrt{C-x^2}\) and \(y = -\sqrt{C-x^2}\) satisfy this.

Explicit Solution

The function \(y = f(x)\) written out directly — \(y\) is isolated on the left.

$$y = \sqrt{C - x^2}$$

\(y\) is a function of \(x\) alone, no ambiguity.

Analogy

Implicit is like saying "the answer is somewhere on this circle." Explicit is like saying "the answer is this specific point on the circle." Both describe the geometry, but explicit is more direct. You can always check an implicit solution by differentiating implicitly.

When Can You Solve for \(y\) Explicitly?

After integration, you get something like \( H(y) = G(x) + C \). You can solve explicitly when \(H\) is easily invertible. Common cases:

After IntegrationExplicit FormNotes
\(\ln|y| = G(x) + C\)\(y = Ae^{G(x)}\) where \(A=\pm e^C\)Exponential — always invertible
\(\frac{y^2}{2} = G(x) + C\)\(y = \pm\sqrt{2G(x)+2C}\)Two branches — need initial condition to pick one
\(\arctan(y) = G(x)+C\)\(y = \tan(G(x)+C)\)Invertible on the right domain
\(y^5 + y = G(x)+C\)Not easily solvableLeave as implicit
Key Rule

The constant of integration from both sides can always be combined into one constant \(C\). You only need one arbitrary constant for a first-order ODE (one integration step). So write \(\int \frac{dy}{h(y)} = \int g(x)\,dx + C\), not \(+C_1 - C_2\).

Worked Examples, Full Detail

Example 1 — Classic Exponential Growth: \( \frac{dy}{dx} = ky \)

This models population growth, radioactive decay (with \(k<0\)), and countless other phenomena. Let's solve it from scratch.

Identify the structure: \(g(x) = k\) (constant), \(h(y) = y\).

// It's separable because the right side is purely a function of y

Assume \( y \neq 0 \), divide both sides by \(y\):

$$\frac{1}{y}\,\frac{dy}{dx} = k$$
// Left side is now a y-only expression; right side is x-only (constant)

Rewrite using Leibniz notation and separate:

$$\frac{dy}{y} = k\,dx$$

Integrate both sides:

$$\int \frac{dy}{y} = \int k\,dx$$ $$\ln|y| = kx + C$$
// Left side: standard integral \(\int \frac{1}{y}dy = \ln|y|\). Right side: \(\int k\,dx = kx\), plus one constant C

Exponentiate both sides to solve for \(y\) explicitly:

$$|y| = e^{kx+C} = e^C \cdot e^{kx}$$ $$y = \pm e^C \cdot e^{kx}$$
// \(e^{kx+C} = e^C \cdot e^{kx}\) by exponent laws. The ± comes from the absolute value

Let \(A = \pm e^C\) be a new arbitrary constant (absorbing the ±). Note: \(y=0\) is also a solution (the trivial one we divided away). So the general solution is:

$$\boxed{y = Ae^{kx}}$$
// A can be any real number, including zero (which gives back the trivial solution)
Geometric Meaning

The ODE says: the rate of change of \(y\) is proportional to \(y\) itself. If you're big, you grow fast. If you're small, you grow slow. The only functions where "the rate of change equals a constant times the function itself" are exponentials — that's what this equation is selecting for.

Example 2 — Logistic-Style: \( \frac{dy}{dx} = xy^2 \)

Here both \(x\) and \(y\) appear, but they multiply — so it's separable.

Identify: \(g(x) = x\), \(h(y) = y^2\). Separate (assume \(y \neq 0\)):

$$\frac{dy}{y^2} = x\,dx$$ $$y^{-2}\,dy = x\,dx$$

Integrate both sides:

$$\int y^{-2}\,dy = \int x\,dx$$ $$\frac{y^{-1}}{-1} = \frac{x^2}{2} + C$$ $$-\frac{1}{y} = \frac{x^2}{2} + C$$
// Power rule: \(\int y^n dy = \frac{y^{n+1}}{n+1}\), with \(n=-2\) giving \(\frac{y^{-1}}{-1}\)

Solve explicitly for \(y\):

$$\frac{1}{y} = -\frac{x^2}{2} - C$$

Let \(K = -C\) (just renaming the constant):

$$\boxed{y = \frac{1}{K - \frac{x^2}{2}}}$$
// The solution blows up (goes to ±∞) when the denominator hits zero — this is a finite-time blowup, a real physical phenomenon
Watch Out — Singular Solutions

We divided by \(y^2\), so we assumed \(y \neq 0\). Check: is \(y = 0\) also a solution? Plug in: \( \frac{d(0)}{dx} = x \cdot 0^2 \Rightarrow 0 = 0\). Yes! \(y = 0\) is a singular solution — it can't be obtained from the general solution by any choice of \(K\).

Example 3 — With Trig: \( \frac{dy}{dx} = \frac{\cos x}{y} \)

\(g(x) = \cos x\), \(h(y) = \frac{1}{y}\). Separate:

$$y\,dy = \cos x\,dx$$
// Multiply both sides by y and by dx

Integrate both sides:

$$\int y\,dy = \int \cos x\,dx$$ $$\frac{y^2}{2} = \sin x + C$$
// Left: power rule gives y²/2. Right: antiderivative of cos x is sin x

Implicit solution: \(\dfrac{y^2}{2} = \sin x + C\)

Explicit (two branches):

$$\boxed{y = \pm\sqrt{2\sin x + C'}} \quad (C' = 2C)$$
// Two branches because squaring loses sign information. Initial condition picks which branch

Initial Value Problems

The general solution of a first-order ODE contains one arbitrary constant \(C\). An initial condition \(y(x_0) = y_0\) pins down exactly which solution curve you're on.

Geometric Picture

The general solution is a whole family of curves filling the plane — one for each value of \(C\). The initial condition is like dropping a pin at the point \((x_0, y_0)\): exactly one curve from the family passes through that point. That's your particular solution.

x y (x₀, y₀) particular solution family of curves
The family of solutions (teal) fills the plane. The initial condition (amber dot) picks the one specific curve (purple) that passes through it.

IVP Procedure

Two-Stage Process

Stage 1 — Solve the ODE to get the general solution \(y = f(x, C)\).

Stage 2 — Substitute \(x = x_0\), \(y = y_0\) and solve for \(C\).

IVP Example: \( \frac{dy}{dx} = 2xy,\quad y(0) = 3 \)

Stage 1 — General Solution

Separate: \(\quad \dfrac{dy}{y} = 2x\,dx\)

Integrate: \(\quad \ln|y| = x^2 + C\)

Exponentiate: \(\quad y = Ae^{x^2}\) where \(A = \pm e^C\)

Stage 2 — Apply Initial Condition

Plug in \(y(0) = 3\):

$$3 = A\,e^{0^2} = A\,e^0 = A \cdot 1 = A$$
// So A = 3

Particular solution:

$$\boxed{y = 3e^{x^2}}$$
Check Your Answer

Differentiate: \(y' = 3 \cdot 2x \cdot e^{x^2} = 6xe^{x^2}\). Now check the ODE: \(2xy = 2x \cdot 3e^{x^2} = 6xe^{x^2}\). ✓ Check initial condition: \(y(0) = 3e^0 = 3\). ✓ Always verify both the ODE and the initial condition.

IVP Example 2 (Harder): \( \frac{dy}{dx} = \frac{x}{y},\quad y(1) = -2 \)

Separate: \(\quad y\,dy = x\,dx\)

Integrate both sides:

$$\frac{y^2}{2} = \frac{x^2}{2} + C$$ $$y^2 = x^2 + K \quad (K = 2C)$$
// This is a family of hyperbolas centered at the origin (when K > 0)

Apply initial condition \(y(1) = -2\):

$$(-2)^2 = (1)^2 + K \implies 4 = 1 + K \implies K = 3$$

Implicit solution: \(\quad y^2 - x^2 = 3\) — this is a hyperbola!

To find the explicit solution, we solve for \(y\):

$$y = \pm\sqrt{x^2 + 3}$$

Since \(y(1) = -2 < 0\), we pick the negative branch:

$$\boxed{y = -\sqrt{x^2 + 3}}$$
// Initial condition determines which branch (top or bottom of hyperbola)

Traps and Pitfalls

⚠ Trap 1 — Forgetting the Constant of Integration

You get ONE constant \(C\) total — not one per side. \(\int \frac{dy}{y} = \int k\,dx\) gives \(\ln|y| + C_1 = kx + C_2\), which collapses to \(\ln|y| = kx + C\) where \(C = C_2 - C_1\). Only write one \(C\).

⚠ Trap 2 — Dividing by Zero (Lost Solutions)

When you divide by \(h(y)\) to separate, you implicitly assume \(h(y) \neq 0\). Always check separately: does \(h(y) = 0\) give a constant solution (equilibrium) that satisfies the ODE? If yes, add it as a singular solution.

⚠ Trap 3 — Dropping the Absolute Value from ln

\(\int \frac{dy}{y} = \ln|y|\), NOT \(\ln y\). When you exponentiate: \(|y| = e^C e^{kx}\), so \(y = \pm e^C e^{kx}\). The \(\pm\) is absorbed into the arbitrary constant \(A\), but skipping the absolute value can cause errors when \(y < 0\).

⚠ Trap 4 — Assuming Every ODE Is Separable

\(\frac{dy}{dx} = x + y\) is NOT separable. No matter how hard you try, \(x + y\) cannot be written as \(g(x) \cdot h(y)\). (It can only be written as a sum, not a product.) Trying to force separation here gives wrong answers.

⚠ Trap 5 — Not Verifying the Solution

Always plug your solution back into the original ODE and the initial condition. Integration errors are common and verification catches them before they propagate.

Test Your Intuition

Try each question before expanding the answer.

Q1 — Is \( \frac{dy}{dx} = x^2 - y^2 \) separable?
No. The right side is \(x^2 - y^2\). This is a difference, not a product. To be separable, you'd need to write it as \(g(x) \cdot h(y)\). There's no way to factor \(x^2 - y^2\) into a pure \(x\)-function times a pure \(y\)-function. (Note: \(x^2 - y^2 = (x-y)(x+y)\) but that still mixes \(x\) and \(y\) in each factor.)
Q2 — Solve \( \frac{dy}{dx} = \frac{y}{x} \) (with \( y(1) = 2 \))

Separate: \(\dfrac{dy}{y} = \dfrac{dx}{x}\)

Integrate: \(\ln|y| = \ln|x| + C\)

Exponentiate: \(|y| = e^C|x|\), so \(y = Ax\) for some constant \(A\).

Initial condition: \(y(1) = 2 \Rightarrow A \cdot 1 = 2 \Rightarrow A = 2\)

Answer: \(\boxed{y = 2x}\) — a straight line through the origin!

The ODE \(\frac{dy}{dx} = \frac{y}{x}\) says "the slope at any point equals the \(y/x\) ratio," which is exactly the slope of the line from the origin to that point. So the solutions ARE lines through the origin. Pure geometric elegance.

Q3 — What singular solution might \( \frac{dy}{dx} = y(1-y) \) have?

When separating, we'd divide by \(h(y) = y(1-y)\). This is zero when \(y = 0\) or \(y = 1\). Check both:

\(y = 0\): \(\frac{d(0)}{dx} = 0\) and \(0(1-0) = 0\). ✓ Solution.

\(y = 1\): \(\frac{d(1)}{dx} = 0\) and \(1(1-1) = 0\). ✓ Solution.

Both \(y = 0\) and \(y = 1\) are equilibrium (singular) solutions — constant functions that satisfy the ODE. These are the stable points of the logistic equation. The general solution (via partial fractions) is \(y = \dfrac{1}{1 + Ae^{-x}}\), which approaches 0 as \(x \to -\infty\) and 1 as \(x \to +\infty\).

Q4 — Why does a first-order ODE only have ONE constant C?

A first-order ODE involves only \(y\) and \(y'\) — one derivative. To "undo" one derivative, you integrate once. One integration produces one constant. Geometrically, specifying one piece of information (the initial value \(y(x_0) = y_0\)) is enough to uniquely select a solution from the family, which confirms there's exactly one degree of freedom — one constant. Second-order ODEs need two integrations, produce two constants, and need two initial conditions to pin them down.

Complete
Section Summary — What You Now Know

A separable ODE factors as \(\frac{dy}{dx} = g(x)h(y)\). The method pulls the variables apart using the Chain Rule (working backwards), producing two independent integrals. The result is either an implicit relation \(H(y) = G(x) + C\) or an explicit function \(y = f(x)\). Adding an initial condition fixes \(C\) uniquely, selecting one curve from the family of solutions. Always check for singular solutions lost when dividing by \(h(y)\), and always verify your answer.