Separable Equations

When a differential equation factors as \(\dfrac{dy}{dx} = g(x)h(y)\), you can put all the \(y\)'s on one side and all the \(x\)'s on the other, integrate each side on its own — \(\int \frac{dy}{h(y)} = \int g(x)\,dx\) — and use an initial condition to nail down the constant.

By the end you'll be able to recognize a separable equation, solve it by separating and integrating, and apply an initial condition to pick out the one particular solution.

Predict: raise \(y(0)\) — does the whole solution curve shift straight up, keeping its shape? Slide to check.

This is \(\dfrac{dy}{dx} = \dfrac{x}{y}\). Separating gives \(y\,dy = x\,dx\); integrating both sides gives \(y^2 = x^2 + C\), so through \((0, y_0)\) the curve is \(y = \sqrt{x^2 + C}\) with \(C = y_0^2\). The short grey segments are the equation's own slope field — each one has slope \(x/y\) — and the solution curve threads them tangentially, starting at the initial-condition point. Hover or focus the curve and the point for exact values.

C = y(0)² = 9.00 · particular solution y = √(x² + 9.00)

dy/dx = x/y — slope field, the family y = √(x² + C), and the particular solution through (0, y(0))
particular solution initial condition (0, y(0)) other family members slope field

A separable equation \(dy/dx = g(x)h(y)\) is solved by separating variables — \(\int dy/h(y) = \int g(x)\,dx\) — then integrating both sides and applying an initial condition to find the constant.

Algebraic

The whole trick is that the right side factors: one factor \(g(x)\) depends only on \(x\), the other \(h(y)\) only on \(y\). Divide by \(h(y)\) (assuming \(h(y) \neq 0\)) and multiply by \(dx\) to get \(\frac{1}{h(y)}\,dy = g(x)\,dx\) — treating \(dy/dx\) as a ratio here can be made rigorous, but practically you just cross-multiply. Integrating each side produces one equation in \(x\) and \(y\) with a single constant \(C\) (the two integrals' constants combine into one). Sometimes you can solve that equation for \(y\) explicitly; sometimes you can't, and you're left with an implicit solution.

Procedural

The same five moves solve every separable equation:

  1. Separate: get \(\frac{1}{h(y)}\,dy = g(x)\,dx\).
  2. Integrate both sides independently; merge the constants into one \(C\).
  3. Solve for \(y\) explicitly if you can; otherwise keep the implicit form.
  4. Apply the initial condition \(y(x_0) = y_0\): substitute and solve for \(C\).
  5. Check the interval of validity: logs, roots, and denominators in the antiderivatives can restrict where the solution lives.
Worked example

Solve \(\dfrac{dy}{dx} = \dfrac{x}{y}\), \(y(0) = 3\). Separate: \(y\,dy = x\,dx\). Integrate: \(\dfrac{y^2}{2} = \dfrac{x^2}{2} + C\), so \(y^2 = x^2 + 2C\). Apply \(y(0)=3\): \(9 = 0 + 2C\), so \(2C = 9\) and \(y^2 = x^2 + 9\). Pick the branch: \(y(0) = 3 > 0\), so take the positive square root: \(y = \sqrt{x^2 + 9}\) — exactly the curve the slider above draws at its default setting.

Your turn

Solve \(\dfrac{dy}{dx} = \dfrac{6x^2}{2y + \cos y}\), \(y(0) = 0\). Separate: \((2y + \cos y)\,dy = 6x^2\,dx\). Integrate: \(y^2 + \sin y = 2x^3 + C\) — this can't be solved explicitly for \(y\), so it stays implicit. Apply \(y(0) = 0\): substitute \(x = 0, y = 0\) and solve for \(C\): \(C = \) ____

Reveal the answer

\(0^2 + \sin 0 = 2 \cdot 0^3 + C\) gives \(0 = C\), so \(C = 0\) and the particular solution is the implicit equation \(y^2 + \sin y = 2x^3\). Leaving it implicit is a perfectly good answer — the method guarantees the relation holds, even when algebra can't invert it.

More info — why dividing by h(y) deserves a second look

Step one divides by \(h(y)\), which silently assumes \(h(y) \neq 0\) — and the antiderivatives you produce may involve logarithms, roots, or denominators of their own. That's why the last step checks the interval of validity: the particular solution is often only guaranteed on an interval around \(x_0\) that avoids division by zero, logs of non-positive numbers, or square roots of negatives. You can see the same caution in the picture at the top of this page: the slope \(x/y\) blows up as \(y \to 0\), which is why the field segments turn vertical near the bottom edge — the same visual warning a slope field gave you in the previous lesson. Paul's Online Math Notes (in Dive deeper below) works several examples where finding this interval is the interesting part.

Check your understanding

Question 1 of 4

Solve \(\dfrac{dy}{dx} = \dfrac{x}{y}\) with \(y(0) = 4\).

Question 2 of 4

You integrate both sides of \(\dfrac{1}{h(y)}\,dy = g(x)\,dx\), and each antiderivative brings its own constant. Why does the solution end up carrying only one constant \(C\)?

Question 3 of 4

Separating \(\dfrac{dy}{dx} = \dfrac{x}{y}\) gives \(y^2 = x^2 + C\). If the initial condition is \(y(0) = -3\), what is the particular solution?

Question 4 of 4

You sketch the slope field of \(\dfrac{dy}{dx} = x/y\), then solve by separation and get \(y = \sqrt{x^2 + 9}\) through \((0, 3)\). How should that curve sit in the field?

Recap

  • An equation is separable when it factors as \(\dfrac{dy}{dx} = g(x)h(y)\) — all the \(x\)-dependence in one factor, all the \(y\)-dependence in the other.
  • Solve by separating and integrating both sides: \(\int \dfrac{dy}{h(y)} = \int g(x)\,dx\), with the two constants of integration merged into a single \(C\).
  • Apply the initial condition \(y(x_0) = y_0\) to find \(C\) — and use its sign to pick the right branch when solving for \(y\) involves a square root.
  • Solve for \(y\) explicitly when you can; otherwise an implicit solution is a valid answer. Either way, check the interval of validity around \(x_0\).

Dive deeper

Sources

  • Separable differential equations