Differential Equations, Topic 2 of 10

Separable
Differential Equations

The simplest and most elegant ODE technique: move all the y's to one side, all the x's to the other, then integrate both sides independently. Deceptively easy to learn, powerful enough to model population growth, radioactive decay, and the spread of disease.

Recognition strategy 12 worked examples Real-world models
Share this page

§ 01What Is a Separable ODE?

A first-order ODE is separable if it can be written so that every y term (including dy) sits on one side of the equation and every x term (including dx) sits on the other, with nothing left in the middle that mixes the two variables.

The general separable form is:

Separable Form
dy/dx = f(x) · g(y)

which rearranges to:

1/g(y) ⋅ dy = f(x) ⋅ dx

The key is the product structure on the right-hand side: a function purely of x multiplied by a function purely of y. As long as g(y) ≠ 0, you can divide both sides by g(y) and move it to the left, leaving dy/g(y) on one side and f(x) dx on the other. Then integrate.

If the right-hand side cannot be factored into a product f(x) · g(y), the equation is not separable and you need a different method: typically the integrating factor (for linear equations) or a substitution (for homogeneous equations).

Recognition: Is This ODE Separable?

The quickest way to check is to ask: can I write dy/dx = (something with only x) × (something with only y)? Use the table below to sharpen your eye.

ODE Separable? Reason
dy/dx = 3x²y Yes f(x) = 3x², g(y) = y. Separate to (1/y)dy = 3x² dx.
dy/dx = x + y No Cannot factor x + y into a product. Use integrating factor instead.
dy/dx = ex+y Yes ex+y = ex · ey. Separate to e−ydy = exdx.
dy/dx = sin(xy) No sin(xy) cannot be split into f(x) · g(y) — the argument mixes the variables.
dy/dx = y²/x Yes f(x) = 1/x, g(y) = y². Separate to y−2dy = (1/x)dx.
dy/dx = xy + x Yes Factor: x(y + 1). So f(x) = x, g(y) = y + 1. Separate to dy/(y+1) = x dx.
dy/dx = x/y + y/x No Cannot factor into a clean product. This is a homogeneous equation — use v = y/x.
Tip: factor before giving up Always try to factor the right-hand side before deciding the equation is not separable. The form xy + x = x(y+1) is easy to miss at first glance. Similarly, expressions like (x²y² − y²) = y²(x² − 1) separate cleanly once factored.

§ 02The Method — Four Steps Every Time

The separation procedure is mechanical: four moves in the same order for every separable equation. After a dozen examples you will execute them without thinking.

Separation of Variables — 4-Step Method
1
Separate the variables
Rearrange dy/dx = f(x)⋅g(y) into the form (1/g(y)) dy = f(x) dx. Treat dy and dx as separate differentials and move them to opposite sides. If g(y) = 0 at some value of y, note this separately — it may be a singular (constant) solution.
2
Integrate both sides
Write ∫(1/g(y)) dy = ∫f(x) dx and evaluate both integrals. Include a single constant of integration +C on the right-hand side (one constant is enough for a first-order ODE). The result is an equation relating y and x, possibly implicitly.
3
Solve for y explicitly (if possible)
Rearrange to get y as a function of x. This is not always possible — sometimes the equation remains implicit (an equation in x and y without y isolated). Both forms are valid general solutions. Implicit solutions often require a check that a branch of the relation is actually a function.
4
Apply the initial condition (if given)
Substitute the initial condition y(x0) = y0 into your general solution to find the numerical value of C. Write the particular solution explicitly. Always verify by differentiating and checking against the original ODE.
Why is treating dy and dx as separate objects valid? Formally, dy and dx are differentials in the sense of non-standard analysis or differential forms — objects that can be manipulated algebraically under an integral sign. The practical justification is the chain rule: if dy/dx = f(x)g(y), then (1/g(y))(dy/dx) = f(x), and integrating both sides with respect to x gives ∫(1/g(y))(dy/dx)dx = ∫f(x)dx. The left side equals ∫(1/g(y))dy by substitution. So the "move the dy across" shorthand is a valid abbreviation of a precise argument.

Implicit vs. Explicit Solutions

After integrating you will typically arrive at an equation of the form H(y) = F(x) + C, where H and F are antiderivatives. This is a perfectly valid implicit solution. You should attempt to solve for y to get an explicit solution y = h(x), but this is not always algebraically possible.

For example, integrating ∫(1+y²)dy = ∫x dx gives y + y³/3 = x²/2 + C. Solving this cubic for y in closed form is not practical: you leave it implicit. But for simpler integrals like ∫(1/y)dy = ∫x² dx, you get ln|y| = x³/3 + C, then y = Aex³/3 explicitly after exponentiation.

§ 03Handling the Constant of Integration Carefully

The constant of integration can take several algebraic forms as you manipulate the equation. Keeping track of it cleanly is a craft skill that separates confident solvers from error-prone ones.

When you integrate the left side ∫(1/y)dy = ln|y|, the result is ln|y| = F(x) + C. Exponentiating: |y| = eF(x)+C = eC · eF(x). Since eC is just an arbitrary positive constant, write it as A (> 0). The absolute value then gives y = ±A · eF(x). Since ±A is an arbitrary non-zero constant, rename it simply A (now allowing A to be any non-zero real). This is the standard general solution: y = AeF(x).

The ln|y| → AeF(x) Manoeuvre
ln|y| = F(x) + C
|y| = eF(x)+C = eC⋅eF(x)
y = ±eC⋅eF(x)
y = AeF(x)   (A any non-zero constant)

At this point it is also worth checking whether y = 0 (the case we divided out when we assumed g(y) ≠ 0) is itself a solution to the original ODE. If it satisfies the original equation, it is called a singular solution: one not captured by any value of the constant A. Often y = 0 is recovered when we allow A = 0, but not always.

⚠ Only one constant of integration needed When you integrate both sides, write +C on one side only — not on both sides. Putting +C on both sides gives you two constants, which can be combined into one: ∫h(y)dy + C1 = ∫f(x)dx + C2 is equivalent to ∫h(y)dy = ∫f(x)dx + (C2 − C1), where C2 − C1 is just a single arbitrary constant C. Save yourself the algebra — put the constant on just one side from the start.

§ 04Worked Examples

Twelve fully solved problems, progressing from pure algebra through IVPs to real-world models. Each one is a separate story, read the working narrative as well as the symbols.

Example 1 Basic separation — dy/dx = 3x²y

Find the general solution of dy/dx = 3x²y.

Step 1 — Separate
(1/y) dy = 3x² dx   (assuming y ≠ 0)
Step 2 — Integrate both sides
∫(1/y) dy = ∫3x² dx ln|y| = x³ + C
Step 3 — Solve for y
|y| = ex³+C = eC⋅e y = Ae   (A any non-zero constant)
Singular solution check: y = 0
Substituting y = 0 into dy/dx = 3x² · 0 = 0 and dy/dx = 0 ✓ — so y = 0 is also a solution, recovered when A = 0.
y = Ae   (A any real constant)
Example 2 IVP — dy/dx = 2xy, y(0) = 5

Solve the initial value problem: dy/dx = 2xy, y(0) = 5.

Separate and integrate
(1/y) dy = 2x dx ln|y| = x² + C y = Ae
Apply y(0) = 5
5 = A⋅e0 = A ⋅ 1  →  A = 5
y = 5e
Example 3 Exponential form in the equation — dy/dx = ex−y

Solve: dy/dx = ex−y.

Rewrite using exponent law
dy/dx = ex⋅e−y
Separate
ey dy = ex dx
Integrate
∫ey dy = ∫ex dx ey = ex + C
Solve for y (take natural log)
y = ln(ex + C) The argument ex + C must be positive, so the domain of the solution depends on the sign of C.
y = ln(ex + C)
Example 4 Power-type — dy/dx = y²/x, y(1) = 2

Solve the IVP: dy/dx = y²/x, y(1) = 2.

Separate (assuming y ≠ 0)
y−2 dy = (1/x) dx
Integrate
−1/y = ln|x| + C
Apply y(1) = 2
−1/2 = ln(1) + C = 0 + C  →  C = −1/2
Solve for y
−1/y = ln x − 1/2 y = −1 / (ln x − 1/2) = 2/(1 − 2 ln x)
y = 2 / (1 − 2 ln x)

This solution blows up when 1 − 2 ln x = 0, i.e. x = e1/2 ≈ 1.65. The solution only exists for x in (0, e1/2).

Example 5 Factor to separate — dy/dx = xy + x

Solve: dy/dx = xy + x.

Factor the right-hand side
dy/dx = x(y + 1)
Separate (assuming y ≠ −1)
1/(y+1) dy = x dx
Integrate
ln|y+1| = x²/2 + C
Solve for y
y + 1 = Aex²/2  →  y = Aex²/2 − 1
Singular solution: y = −1 (check)
dy/dx = 0 and x(−1 + 1) = 0 ✓. So y = −1 is also a solution, included when A = 0.
y = Aex²/2 − 1   (A any real constant)
Example 6 Trig functions — dy/dx = cos²(y) · tan(x)

Solve: dy/dx = cos²(y) · tan(x).

Separate (assuming cos y ≠ 0)
sec²(y) dy = tan(x) dx
Integrate both sides
∫sec²(y) dy = ∫tan(x) dx tan(y) = ln|sec(x)| + C Recall ∫tan(x) dx = −ln|cos x| = ln|sec x|.
Solve for y
y = arctan(ln|sec x| + C)
y = arctan(ln|sec x| + C)
Example 7 Implicit solution — (1 + y²) dy/dx = x²

Solve: (1 + y²) dy/dx = x².

Separate — already done
(1 + y²) dy = x² dx
Integrate
y + y³/3 = x³/3 + C
Can we solve for y explicitly?
This is a cubic in y. No elementary closed-form inverse exists, so we leave the solution implicit.
y + y³/3 = x³/3 + C   (implicit solution)
Example 8 Exponential growth and decay — dy/dt = ky

Solve the universal growth/decay equation: dy/dt = ky, y(0) = y0.

Separate
(1/y) dy = k dt
Integrate
ln|y| = kt + C y = Aekt
Apply y(0) = y0
y0 = A⋅e0 = A
y(t) = y0ekt

If k > 0 the quantity grows exponentially (bacterial population, compound interest). If k < 0 it decays (radioactive decay, drug elimination). The half-life T1/2 satisfies y0ekT = y0/2, giving T1/2 = −ln(2)/k.

Example 9 Newton's Law of Cooling — applied IVP

A body cools from 80°C in a room at 20°C. After 10 minutes its temperature is 60°C. Find T(t) and the time it reaches 30°C.

Newton's Law: dT/dt = k(T − 20).

Substitute u = T − 20, so du/dt = dT/dt
du/dt = ku   →   u = Aekt T = 20 + Aekt
Apply T(0) = 80
80 = 20 + A  →  A = 60 T(t) = 20 + 60ekt
Apply T(10) = 60 to find k
60 = 20 + 60e10k  →  e10k = 40/60 = 2/3 k = (1/10)ln(2/3) = −0.0405 min−1
Find t when T = 30°C
30 = 20 + 60ekt  →  ekt = 1/6 t = ln(1/6)/k = −ln(6)/k ≈ 44.1 min
T(t) = 20 + 60e−0.0405t °C   |   reaches 30°C at t ≈ 44 min
Example 10 Radioactive decay — finding the half-life

A radioactive substance decays at a rate proportional to the amount present: dN/dt = −λN. If N(0) = 1000 atoms and N(5) = 800 atoms, find the half-life.

General solution (from Example 8 with k = −λ)
N(t) = 1000e−λt
Use N(5) = 800 to find λ
800 = 1000e−5λ  →  e−5λ = 0.8 λ = −(1/5)ln(0.8) ≈ 0.04463 per year
Half-life: solve N(T) = 500
500 = 1000e−λT  →  e−λT = 0.5 T1/2 = ln(2)/λ = ln(2)/0.04463 ≈ 15.5 years
T1/2 = ln(2)/λ ≈ 15.5 years
Example 11 Logistic growth model — separation with partial fractions

Solve the logistic equation: dP/dt = kP(1 − P/M), P(0) = P0, where M is the carrying capacity.

Separate
1 / [P(1−P/M)] dP = k dt M / [P(M−P)] dP = k dt
Partial fractions on M/[P(M−P)]
M/[P(M−P)] = 1/P + 1/(M−P)
Integrate
∫[1/P + 1/(M−P)] dP = ∫k dt ln|P| − ln|M−P| = kt + C ln|P/(M−P)| = kt + C
Exponentiate and solve
P/(M−P) = Aekt P = MAekt/(1 + Aekt)
Apply P(0) = P0 to find A
A = P0/(M − P0)
P(t) = MP0 / (P0 + (M−P0)e−kt)

As t → ∞, e−kt → 0 and P(t) → M. The population approaches the carrying capacity M regardless of the starting value P0 (as long as 0 < P0 < M).

Example 12 Torricelli's Law — water draining from a tank

A cylindrical tank of cross-sectional area A contains water. Water drains through a hole of area a at the bottom. Torricelli's Law gives: A⋅dh/dt = −a√(2gh), where h is the water height and g is gravitational acceleration.

With A = 1 m², a = 0.01 m², g = 9.8 m/s², and h(0) = 4 m, find h(t) and when the tank empties.

Separate
h−1/2 dh = −(a/A)√(2g) dt = −0.01⋅√(19.6) dt ≈ −0.04427 dt
Integrate both sides
2√h = −0.04427t + C
Apply h(0) = 4:   C = 2√4 = 4
2√h = 4 − 0.04427t h(t) = (2 − 0.02214t)²
Tank empties when h = 0
2 − 0.02214t = 0  →  t = 2/0.02214 ≈ 90.3 s
h(t) = (2 − 0.02214t)² m   |   empties at t ≈ 90 s

Notice the parabolic profile: h decreases more slowly as the water level drops, because lower water pressure means slower outflow. This is exactly what Torricelli's square-root law predicts.

§ 05Real-World Models That Use Separable Equations

The same four-step method appears in dozens of application areas. Here is a concise guide to the six most common models you will meet at undergraduate level.

Exponential Growth / Decay
dy/dt = ky  →  y(t) = y0ekt
Population growth (k>0), radioactive decay (k<0), drug clearance
Newton's Law of Cooling
dT/dt = k(T − T)  →  T(t) = T + (T0−T)ekt
Temperature of a body cooling in an environment at T
Logistic Growth
dP/dt = kP(1−P/M)  →  P(t) = MP0/(P0+(M−P0)e−kt)
Population limited by carrying capacity M; S-shaped growth curve
Torricelli's Law (Tank Draining)
dh/dt = −(a/A)√(2gh)  →  h(t) = (√h0 − (a/2A)√(2g)⋅t)²
Water depth in a tank with a small outlet hole
Continuous Compound Interest
dA/dt = rA  →  A(t) = A0ert
Bank balance A growing at continuous interest rate r
Epidemic Spread (Simple SI Model)
dI/dt = βI(N−I)  →  same form as logistic with M = N
I = infected, N = total population, β = transmission rate
A unifying observation Every one of these models is separable because the rate of change of the quantity depends only on the current value of the quantity (and possibly time as a separate multiplicative factor). This "rate depends only on current state" structure is the hallmark of separable ODEs — and it is the reason they arise so naturally in models of growth, decay, and equilibration.

§ 06Common Mistakes

⚠ Applying separation to a non-separable ODE Always check that the right-hand side truly factors into f(x)⋅g(y) before separating. The equation dy/dx = x + y is first-order linear but not separable — x + y cannot be factored into a product. Applying separation here gives a wrong answer. Use the integrating factor method instead.
⚠ Forgetting to check singular solutions When you divide by g(y) to separate variables, you implicitly assume g(y) ≠ 0. Any value y = c for which g(c) = 0 must be checked separately against the original ODE. If it satisfies the equation, it is a singular (or equilibrium) solution that cannot be obtained by setting any value of the constant A. Common examples: y = 0 for dy/dx = ky, and y = M for the logistic equation.
⚠ Forgetting to exponentiate when inverting ln|y| After integrating to get ln|y| = F(x) + C, the next step is to exponentiate both sides completely: eln|y| = eF(x)+C, giving |y| = eC⋅eF(x). A common error is to write y = F(x) + C directly, which is wrong — the left side was ln|y|, not y, and you must undo the logarithm.
⚠ Integrating the wrong side with respect to the wrong variable After separating into h(y)dy = f(x)dx, the left integral is with respect to y and the right integral is with respect to x. Writing ∫h(y)dx on the left is a fundamental error. The differential tells you which variable to integrate with respect to.
⚠ Applying the initial condition too early Find the general solution first (with the arbitrary constant C), then substitute the initial condition to find the specific value of C. If you substitute before integrating, you introduce the initial values into the algebra in the wrong place.

§ 07Practice Quiz — 10 Questions

Test your ability to recognise separable ODEs, execute the method, and apply it to initial value problems and real-world models.

Score: 0 / 0
Question 1 — Recognition

Which of the following ODEs is separable?

  1. dy/dx = x + y: Cannot factor x + y as f(x)⋅g(y). Not separable.
  2. dy/dx = xy²: f(x) = x, g(y) = y². Separates to y−2dy = x dx. ✓
  3. dy/dx = sin(xy): sin of a product cannot be split. Not separable.
  4. dy/dx = x/y + y = (x + y²)/y: mixed: not separable.
Question 2 — Basic Integration

Separate and integrate dy/dx = 4x³y. The general solution is y = Aekx⁴. What is k?

Separate to (1/y)dy = 4x³dx. Integrate the right side: ∫4x³dx = x⁴ + C.
Question 3 — Separation Step

For the ODE dy/dx = x²(1 + y), which expression correctly separates the variables?

Question 4 — Initial Value Problem

Solve dy/dx = −2y, y(0) = 7. The solution is y = Ce−2x. What is C?

Question 5 — Singular Solution

For dy/dx = 3y(y − 5), which of the following is a singular (equilibrium) solution?

  1. g(y) = 3y(y−5) = 0 when y = 0 or y = 5.
  2. Check y = 0: dy/dx = 0 and 3⋅0⋅(0−5) = 0 ✓
  3. Check y = 5: dy/dx = 0 and 3⋅5⋅(5−5) = 0 ✓
  4. Both y = 0 and y = 5 are equilibrium (singular) solutions.
Question 6 — Exponential Decay

A substance decays according to dN/dt = −0.02N. Starting from N(0) = 500, evaluate N(10) to the nearest whole number.

N(t) = 500e−0.02t. Substitute t = 10.
  1. N(t) = 500e−0.02t
  2. N(10) = 500e−0.2 = 500 × 0.8187 ≈ 409
Question 7 — Logistic Growth

In the logistic model dP/dt = kP(1−P/M), what does P(t) approach as t → ∞?

Question 8 — Integration

Separate and solve (1+y²)dy/dx = x. The general solution has the form y + y³/3 = x²/k + C. What is k?

Separate to (1+y²)dy = x dx. Integrate the right side: ∫x dx = x²/2 + C.
Question 9 — Choosing the Right Method

For dy/dx + 2xy = e, the best method is:

  1. The equation is in the form dy/dx + P(x)y = Q(x) with P(x) = 2x, Q(x) = e.
  2. This is a first-order linear ODE, not separable (the 2xy term mixes variables).
  3. The integrating factor μ = e turns the left side into d/dx[ey] = e2x².
Question 10 — Applied IVP

A liquid cools according to dT/dt = −0.1(T − 20) with T(0) = 100. Find T(10) to the nearest whole number.

Let u = T − 20. Then du/dt = −0.1u → u = 80e−0.1t. So T = 20 + 80e−0.1t.
  1. General solution: T(t) = 20 + Ae−0.1t
  2. T(0) = 100: 100 = 20 + A → A = 80
  3. T(t) = 20 + 80e−0.1t
  4. T(10) = 20 + 80e−1 = 20 + 80×0.3679 ≈ 20 + 29.4 = 49.4 ≈ 49

§ 08What to Study Next

Separable equations handle one important class of first-order ODEs. The next pages expand your toolkit for everything that cannot be separated:

  • First-Order Linear ODEs, the standard form dy/dx + P(x)y = Q(x), which includes all separable equations plus the non-separable linear ones.
  • The Integrating Factor Method: the systematic technique for solving all first-order linear ODEs, with full derivation of μ = e∫P dx.
  • Homogeneous Equations, equations of the form dy/dx = F(y/x), solved by the substitution v = y/x which reduces them to a separable equation.
  • Partial Fractions: the integration technique used in Example 11 (logistic growth) and in many other separable equations where the y-side requires decomposition.

Cookie Settings