Separable Differential Equations

April 13, 2026

Problem

Solve dy/dx = xy. Separate variables to get dy/y = x dx, integrate both sides, and show the family of solution curves.

Explanation

What does "separable" mean?

A first-order ODE is separable when you can rearrange it so that every yy-term (including dydy) sits on one side and every xx-term (including dxdx) sits on the other: dydx=f(x)g(y)dyg(y)=f(x)dx\frac{dy}{dx} = f(x) \, g(y) \quad \Longleftrightarrow \quad \frac{dy}{g(y)} = f(x) \, dx

Once separated, the ODE is just two independent integrals. That's the whole trick — no need for integrating factors, no need for linear-algebra machinery. It is by far the fastest technique when it applies, so always check separability first.

The given equation

dydx=xy\frac{dy}{dx} = x y

Here f(x)=xf(x) = x and g(y)=yg(y) = y. Separable.

Step-by-step solution

Step 1 — Separate. dyy=xdx(y0)\frac{dy}{y} = x \, dx \qquad (y \ne 0)

Step 2 — Integrate both sides. dyy=xdx\int \frac{dy}{y} = \int x \, dx lny=x22+C1\ln|y| = \frac{x^2}{2} + C_1

Step 3 — Solve for yy by exponentiating. y=ex2/2+C1=eC1ex2/2|y| = e^{x^2/2 + C_1} = e^{C_1} \, e^{x^2/2}

Drop the absolute value by letting C=±eC1C = \pm e^{C_1} absorb the sign: y(x)=Cex2/2\boxed{\, y(x) = C \, e^{x^2/2} \,}

Every non-zero value of CC gives a different solution curve — that is the general solution, a one-parameter family.

The constant solution we might have lost

When we divided by yy in step 1 we implicitly assumed y0y \ne 0. Check y0y \equiv 0 directly in the original ODE: ddx(0)=0,x0=0\frac{d}{dx}(0) = 0, \quad x \cdot 0 = 0 \quad \checkmark

So y=0y = 0 is also a solution — and it corresponds to C=0C = 0 in our formula. The general solution y=Cex2/2y = C e^{x^2/2} covers all solutions, including the zero solution.

Verification

Differentiate y=Cex2/2y = C e^{x^2/2}: dydx=Cxex2/2=x(Cex2/2)=xy\frac{dy}{dx} = C \cdot x \cdot e^{x^2/2} = x \cdot \bigl(C e^{x^2/2}\bigr) = x y \quad \checkmark

Initial value problem — picking one curve out of the family

If you're told y(0)=3y(0) = 3, plug in: 3=Ce0=C    C=33 = C e^{0} = C \implies C = 3

So the unique solution through (0,3)(0, 3) is y(x)=3ex2/2y(x) = 3 \, e^{x^2/2}

One initial condition ↔ one curve.

Geometric picture

  • Every member of the family has the same shape — a Gaussian-like ex2/2e^{x^2/2} profile — scaled vertically by CC.
  • Positive CC gives curves that live above the xx-axis; negative CC mirrors them below.
  • The xx-axis (C=0C = 0) is an invariant line — a trajectory that stays put.

When to use separation

Check if the right side factors as f(x)g(y)f(x) g(y):

  • dydx=cos(x)ey\dfrac{dy}{dx} = \cos(x) e^{y}separable (f=cosxf = \cos x, g=eyg = e^y).
  • dydx=x+y\dfrac{dy}{dx} = x + ynot separable (a sum, not a product).
  • dydx=xy1+x2\dfrac{dy}{dx} = \dfrac{x y}{1 + x^2}separable (f=x1+x2f = \frac{x}{1+x^2}, g=yg = y).
  • dydx=x+yxy\dfrac{dy}{dx} = \dfrac{x + y}{x - y} — not separable, but homogeneous (see #178).

Common mistakes

  • Forgetting the absolute value when integrating 1/y1/y. It matters if you want negative-valued solutions.
  • Leaving two constants (one for each integral). There's only one independent constant — fold them into a single CC.
  • Dropping the singular solution y=0y = 0 (or more generally wherever g(y)=0g(y) = 0) without checking. Always verify it directly.
  • Writing lny\ln y without the absolute value, then being stuck when the data is negative.

Try it in the visualization

Slide the initial condition y(0)y(0) to pick a curve out of the family, and watch how all curves share the same Gaussian shape. Toggle the zero solution to see the invariant line y=0y = 0.

Interactive Visualization

Parameters

1.50
3.00
8.00
1.00
6.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Separable Differential Equations | MathSpin