Separable Equations: When Variables Can Be Pulled Apart

Separable Equations: When Variables Can Be Pulled Apart
Separable Equations: When Variables Can Be Pulled Apart | Ideasthesia

Separation of variables is the first real technique you learn for solving differential equations. It's elegant, intuitive, and shockingly powerful.

The idea: if the equation can be factored so all the y terms are on one side and all the x terms on the other, you can integrate both sides independently.

It's almost too simple. But it works for a huge class of equations.

What Makes an Equation Separable

A first-order ODE is separable if you can write it as:

dy/dx = g(x)h(y)

The right side factors into a function of x alone times a function of y alone.

Examples of separable equations:

dy/dx = xy (separable: x times y)

dy/dx = e^(x-y) (separable: e^x · e^(-y))

dy/dx = y²/x (separable: (1/x) · y²)

Examples of non-separable equations:

dy/dx = x + y (cannot factor into g(x)·h(y))

dy/dx = sin(x + y) (the argument mixes x and y)

Separability is structural. Either the equation factors, or it doesn't.

The Technique

Start with dy/dx = g(x)h(y).

Step 1: Rewrite using differentials.

dy = g(x)h(y)dx

Step 2: Separate variables (all y on left, all x on right).

dy/h(y) = g(x)dx

Step 3: Integrate both sides.

∫dy/h(y) = ∫g(x)dx + C

Step 4: Solve for y (if possible).

That's it. The method is mechanical.

Example 1: Exponential Growth

Equation: dy/dx = ky (k constant)

This is separable: dy/dx = k · y

Separate: dy/y = k dx

Integrate: ∫dy/y = ∫k dx

ln|y| = kx + C₁

Exponentiate: |y| = e^(kx + C₁) = e^(C₁)e^(kx)

Let C = ±e^(C₁) (absorb sign and constant):

y = Ce^(kx)

This is exponential growth (k > 0) or decay (k < 0).

Physical interpretation: Any process where the rate of change is proportional to current amount. Radioactive decay, population growth, compound interest.

Example 2: Logistic Equation

Equation: dy/dx = y(1 - y)

This is separable: dy/dx = 1 · y(1 - y)

Separate: dy/(y(1 - y)) = dx

The left side needs partial fractions:

1/(y(1 - y)) = A/y + B/(1 - y)

Solve: 1 = A(1 - y) + By

Set y = 0: 1 = A, so A = 1.

Set y = 1: 1 = B, so B = 1.

Thus: 1/(y(1 - y)) = 1/y + 1/(1 - y)

Integrate: ∫(1/y + 1/(1 - y))dy = ∫dx

ln|y| - ln|1 - y| = x + C₁

ln|y/(1 - y)| = x + C₁

Exponentiate: y/(1 - y) = Ce^x (where C = ±e^(C₁))

Solve for y:

y = Ce^x(1 - y)

y = Ce^x - Ce^x y

y + Ce^x y = Ce^x

y(1 + Ce^x) = Ce^x

y = Ce^x/(1 + Ce^x)

Divide numerator and denominator by e^x:

y = C/(Ce^(-x) + 1)

Rewrite: y = 1/(1 + Ae^(-x)) (where A = 1/C)

This is the logistic function—sigmoid curve approaching 1.

Physical interpretation: Population growth with carrying capacity. Growth slows as population approaches maximum.

Example 3: Newton's Law of Cooling

Equation: dT/dt = -k(T - T_a) (T_a = ambient temperature)

Rewrite: dT/dt = -k·(T - T_a)

This is separable.

Separate: dT/(T - T_a) = -k dt

Integrate: ∫dT/(T - T_a) = ∫-k dt

ln|T - T_a| = -kt + C₁

Exponentiate: T - T_a = Ce^(-kt) (C = ±e^(C₁))

T = T_a + Ce^(-kt)

Apply initial condition T(0) = T₀:

T₀ = T_a + C, so C = T₀ - T_a

Solution: T = T_a + (T₀ - T_a)e^(-kt)

Physical interpretation: Object's temperature approaches ambient exponentially. Hot coffee cools toward room temperature.

Example 4: Mixing Problem

A tank holds 100 liters of water with 10 kg of salt dissolved. Pure water flows in at 5 L/min, and the mixture (kept uniform by stirring) flows out at 5 L/min. How does salt concentration change?

Let Q(t) = amount of salt at time t.

Salt in: 0 kg/min (pure water)

Salt out: (Q/100) · 5 kg/min (concentration Q/100, flow rate 5)

Differential equation: dQ/dt = 0 - 5Q/100 = -Q/20

This is separable: dQ/dt = -1/20 · Q

Separate: dQ/Q = -dt/20

Integrate: ln|Q| = -t/20 + C₁

Q = Ce^(-t/20)

Initial condition: Q(0) = 10, so C = 10.

Solution: Q = 10e^(-t/20)

The salt decays exponentially with time constant 20 minutes.

When Separation Fails

Not all equations are separable.

dy/dx = x + y cannot be written as g(x)h(y). The sum x + y doesn't factor.

For non-separable first-order equations, you need other techniques:

  • Integrating factor (for linear equations)
  • Exact equations
  • Substitution methods
  • Numerical approximation

Separation is powerful but limited.

The Constant of Integration

Notice every solution has an arbitrary constant C. This is the general solution—a family of curves.

To get a particular solution, apply an initial condition: y(x₀) = y₀.

Example: dy/dx = 2x with y(0) = 3

General solution: y = x² + C

Apply initial condition: 3 = 0² + C, so C = 3

Particular solution: y = x² + 3

The initial condition selects one curve from the family.

Losing Solutions: Singular Solutions

Be careful when dividing by h(y) during separation. If h(y) = 0 for some y, you might lose solutions.

Example: dy/dx = y²

Separate: dy/y² = dx

Integrate: -1/y = x + C

y = -1/(x + C)

But wait—check y = 0.

dy/dx = 0, and y² = 0. So y = 0 also satisfies the equation!

This is a singular solution (constant solution). It was lost when we divided by y².

Always check: if h(y) = 0, does that constant function satisfy the original equation? If yes, include it.

Implicit Solutions

Sometimes you can't solve for y explicitly.

Example: dy/dx = -x/y

Separate: y dy = -x dx

Integrate: y²/2 = -x²/2 + C

Simplify: x² + y² = 2C

This is a circle. You can't write y = f(x) as a single-valued function (a circle isn't a function of x).

The solution is implicit: F(x, y) = 0.

Implicit solutions are valid. They satisfy the differential equation even if you can't isolate y.

Separation with Substitution

Sometimes equations aren't obviously separable but become so after substitution.

Homogeneous equations: Form dy/dx = f(y/x)

Substitute v = y/x, so y = vx and dy/dx = v + x dv/dx.

The equation becomes separable in v and x.

Example: dy/dx = (y/x) + 1

This is homogeneous (depends on y/x).

Let v = y/x, so dy/dx = v + x dv/dx.

Substitute: v + x dv/dx = v + 1

x dv/dx = 1

Separate: dv = dx/x

Integrate: v = ln|x| + C

Back-substitute: y/x = ln|x| + C

y = x ln|x| + Cx

Substitution transforms non-separable into separable.

Applications of Separable Equations

1. Exponential growth/decay: dy/dt = ky

All processes where rate proportional to amount.

2. Logistic growth: dy/dt = ry(1 - y/K)

Population with carrying capacity, epidemic models.

3. Newton's cooling: dT/dt = -k(T - T_a)

Temperature equilibration.

4. Free fall with air resistance: dv/dt = g - kv

Velocity under gravity and drag.

5. Chemical kinetics: dC/dt = -kC^n

Reaction rates (first-order if n = 1, second-order if n = 2).

6. Torricelli's law: dh/dt = -k√h

Draining tank—height decreases as square root.

All separable. All solved by the same technique.

Why Separation Works

Mathematically, separation of variables is justified by the chain rule.

If dy/dx = g(x)h(y), then:

dy = g(x)h(y)dx

Divide by h(y):

dy/h(y) = g(x)dx

Integrate both sides with respect to their respective variables:

∫dy/h(y) = ∫g(x)dx

The left side integrates with respect to y, the right with respect to x. The equality holds because dy and dx are differentials satisfying the original equation.

It's a formal manipulation that works because derivatives and integrals are inverse operations.

Practical Tips

Tip 1: Always check for singular solutions (where you divided by zero).

Tip 2: Don't forget the absolute value in logarithms: ∫dy/y = ln|y|, not ln(y).

Tip 3: You can absorb signs into the constant. If ln|y| = x + C₁, then y = ±e^(C₁)e^x = Ce^x where C can be positive or negative.

Tip 4: Check your solution by differentiating and verifying it satisfies the original equation.

Tip 5: If the equation isn't obviously separable, try algebraic manipulation or substitution.

When to Use Separation

Use separation of variables if:

  • The equation is first-order
  • The right side factors into g(x)h(y)
  • You can integrate both ∫dx/g(x) and ∫dy/h(y)

If any condition fails, use a different method.

Limitations

Separation requires:

  1. Separability: The equation must factor
  2. Integrable factors: Both integrals must be computable

If ∫dy/h(y) or ∫g(x)dx can't be expressed in elementary functions, you're stuck.

Example: dy/dx = e^(x²)y

Separable: dy/y = e^(x²)dx

But ∫e^(x²)dx has no elementary antiderivative. You'd need numerical methods or special functions (error function).

Separation is powerful, not omnipotent.

Next Steps

Separation of variables handles a large class of first-order ODEs. But not all first-order equations are separable.

For linear first-order equations (dy/dx + P(x)y = Q(x)), you need a different technique: the integrating factor method.

We'll cover that in linear first-order ODEs.


Part 4 of the Differential Equations series.

Previous: First-Order ODEs: The Simplest Differential Equations Next: Linear First-Order: The Integrating Factor Method