Skip to content

Separable Differential Equations

In this lesson you’ll learn how to solve separable differential equations, the most approachable class of first-order DEs. If you can integrate, you can solve these.

A first-order differential equation is separable if you can write it in the form

dydx=f(x)g(y)\frac{dy}{dx} = f(x) \cdot g(y)

The key idea: get all the y stuff on one side and all the x stuff on the other, then integrate both sides independently.

1g(y)dy=f(x)dx\frac{1}{g(y)}\,dy = f(x)\,dx 1g(y)dy=f(x)dx\int \frac{1}{g(y)}\,dy = \int f(x)\,dx

After integrating, solve for y if possible and include the constant of integration. If you have an initial condition like y(0) = 3, plug it in to find the specific constant.

Example 1: Basic separable equation

Solve dy/dx = 2xy.

Separate the variables by dividing both sides by y

1ydy=2xdx\frac{1}{y}\,dy = 2x\,dx

Integrate both sides

1ydy=2xdx\int \frac{1}{y}\,dy = \int 2x\,dx lny=x2+C\ln|y| = x^2 + C

Exponentiate both sides to solve for y

y=ex2+C=eCex2|y| = e^{x^2 + C} = e^C \cdot e^{x^2} y=Aex2y = Ae^{x^2}

where A = ±e^C is an arbitrary constant. The slope field below shows this equation with three solution curves for different values of A.

The curves grow rapidly away from x = 0 because the slope 2xy gets larger as both x and y increase. Near x = 0 the slopes are nearly flat, which matches the horizontal segments in the field.

Example 2: Initial value problem

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

Separate variables

1y2dy=dx\frac{1}{y^2}\,dy = dx

Integrate both sides

y2dy=dx\int y^{-2}\,dy = \int dx 1y=x+C-\frac{1}{y} = x + C

Apply the initial condition y(0) = 2

12=0+CC=12-\frac{1}{2} = 0 + C \quad \Rightarrow \quad C = -\frac{1}{2}

So the specific solution is

1y=x12-\frac{1}{y} = x - \frac{1}{2}

Solve for y

y=112x=212xy = \frac{1}{\frac{1}{2} - x} = \frac{2}{1 - 2x}

This solution has a vertical asymptote at x = 1/2. The function blows up to infinity there, which makes sense: the slope y² grows faster and faster as y increases, creating a runaway effect.

The solid blue curve is the actual solution starting from (0, 2). It shoots up toward infinity as x approaches 1/2 from the left. The faded branch on the right side of the asymptote is the other piece of the function, but it’s not part of our solution since we can’t cross the asymptote.

Example 3: Newton’s Law of Cooling

A cup of coffee at 90°C is placed in a room at 20°C. The temperature T satisfies

dTdt=k(T20)\frac{dT}{dt} = -k(T - 20)

where k is a positive constant. Separate variables by letting u = T - 20, so du = dT

duu=kdt\frac{du}{u} = -k\,dt lnu=kt+C\ln|u| = -kt + C u=Aektu = Ae^{-kt}

Substituting back

T20=AektT(t)=20+AektT - 20 = Ae^{-kt} \quad \Rightarrow \quad T(t) = 20 + Ae^{-kt}

At t = 0, T = 90, so A = 70. The temperature decays exponentially toward the room temperature of 20°C, never quite reaching it.

T(t)=20+70ektT(t) = 20 + 70e^{-kt}

Separable DEs model tons of real-world processes:

  • Population growth and radioactive decay (exponential models)
  • Newton’s Law of Cooling (temperature equilibration)
  • Drug concentration in the bloodstream over time
  • Charging and discharging capacitors in circuits
  • Game design: health regeneration, resource decay, and difficulty scaling over time
A differential equation is separable if it can be written as
After separating dy/dx = 2xy, the left side becomes
The solution to dy/dx = y² with y(0) = 2 is
In Newton's Law of Cooling, the temperature approaches
The constant of integration in a separable equation is determined by