Separable Differential Equation Calculator - Step by Step

Your separable equation

dy/dx = x · y

The x-part: g(x)

The y-part: h(y)

This h(y) takes no extra parameter.

Together these are the initial condition y(x₀) = y₀.

Particular solution

y = 2e^(0.5x²)

General solution (implicit)

ln|y| = 0.5x² + C

y at x = 2

14.778112

Separation of variables, step by step

  1. 1

    Separate the variables

    dy/[y] = x dx

  2. 2

    Integrate both sides

    ∫ dy/y = ∫ x dx

  3. 3

    One constant, written down now

    ln|y| = 0.5x² + C

  4. 4

    Use y(0) = 2 to pin C

    C = ln|(2)| − [0.5(0)²] = 0.693147

  5. 5

    Solve for y

    y = 2e^(0.5x²)

The solution curve through (0, 2)

36−1.65x = −0.36x = 2.36

Dark dot = your initial condition. Blue dot = the value at x = 2.

Interval of existence

(−∞, ∞)

This solution is defined for every x, which is the exception rather than the rule.

x ≠ 0 whenever n is negative.

Solutions separation loses

y = 0

h(y) = 0 at this value, so dividing by h(y) quietly deletes it it is still a perfectly valid constant solution.

Numerical check (Runge–Kutta 4, 4000 steps)

Closed form

14.778112

RK4 integration

14.778112

Relative difference

0

Two independent routes — exact antiderivatives, and a numerical solver that never sees the formula — landing on the same number is a real check on the algebra, not a restatement of it.

Solution values from x₀ to your target

xy(x)slope dy/dx
020
0.333332.1142550.70475
0.666672.4976981.6651
13.2974433.2974
1.33334.8648516.4865
1.66678.02078313.368
214.7781129.556

The slope column is g(x)·h(y) evaluated on the curve itself — it has to match the equation you started from at every single row.

How to Use This Calculator

  1. Rewrite your equation so that everything containing x multiplies everything containing y. For instance y′ = 3x²y is already g(x) = 3x² times h(y) = y.
  2. Pick that x-factor in the “Choose g(x)” menu and set k, n or a to match your coefficients — the equation banner at the top updates as you type.
  3. Pick the y-factor in “Choose h(y)”. Use “1” when y never appears on the right-hand side, and set M for the logistic or cooling forms.
  4. Enter your initial condition in the “x₀” and “y₀” fields, then set “Evaluate the solution at x =” to the point you actually need a number for.
  5. Read the five numbered steps for the worked separation, then check the interval of existence and the lost-equilibrium panel before trusting the formula outside the plotted window.

Share this calculator

Help others solve their calculations

Found this calculator helpful? Share it with your friends, students, or colleagues who might need it!

Separable Differential Equation Calculator: How to Solve by Separation of Variables

About the Author

Marko Šinko - Co-Founder & Lead Developer

Marko Šinko

Co-Founder & Lead Developer, AI Math Calculator

Lepoglava, Croatia
Advanced Algorithm Expert

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Co-founder of award-winning projects, ensuring precise mathematical computations and reliable calculator tools.

📅 Published:
Separable differential equation calculator diagram splitting dy/dx into two integrals that recombine into a single solution curve

A separable differential equation calculator turns dy/dx = g(x)h(y) into an answer in three moves: divide by h(y), integrate both sides, solve for y. That’s the entire method. The interesting part isn’t the recipe — it’s the two things the recipe quietly destroys on the way past, and almost every lost mark on this topic traces back to one of them. What follows runs the mechanics once, fast, then spends the rest of its time on what the mechanics hide: the constant solutions that division deletes, and the interval where your formula is genuinely a solution rather than just an expression.

The Three Moves, Run Once Without Commentary

Take dy/dx = 6x²y with y(0) = 5. Everything with x already sits on one side of the product and everything with y on the other, which is exactly what “separable” means.

dy/y = 6x² dx

∫ dy/y = ∫ 6x² dx

ln|y| = 2x³ + C

y = A e^(2x³),   where A = ±e^C

y(0) = 5 → A = 5 → y = 5e^(2x³)

Check it: differentiate 5e^(2x³) and you get 5e^(2x³)·6x², which is 6x²y. Four lines, done. Two details in there matter more than they look. The constant appeared on the right side only — putting C₁ on the left and C₂ on the right just means subtracting them later, so skip it. And C moved inside the exponential and became a multiplier A rather than staying an addend. That transformation is where the constant most often gets dropped entirely.

The calculator above runs these same steps and prints all five lines for whatever g and h you pick. It also does something a hand solution can’t be bothered to: it re-integrates your original equation numerically with fourth-order Runge–Kutta and compares the two answers. Agreement to eight digits means the antiderivatives are right. Disagreement means something in the algebra isn’t. It’s substitution-back-in, automated.

Why C Has to Go In Before You Solve for y

Here’s the most expensive habit in this topic: integrate both sides, solve for y, and then tack on + C at the end. Watch what it costs on dy/dx = 2xy.

StepCorrect: C earlyWrong: C late
Integrateln|y| = x² + Cln|y| = x²
Exponentiatey = e^(x²)·e^Cy = e^(x²)
Bring in the constanty = A e^(x²)y = e^(x²) + C
Does it satisfy y′ = 2xy?Yes, for every AOnly when C = 0

The late-C version gives y′ = 2x e^(x²) while 2xy = 2x e^(x²) + 2xC. Those agree only if C = 0, so a one-parameter family of solutions has collapsed into a single curve — and the initial condition y(0) = 7 now has no solution at all in your “general” form. The rule that prevents this is purely mechanical: write + C the instant you finish integrating, before any exponentiating, squaring, or reciprocating, then let the algebra carry it wherever it goes. It becomes a multiplier under an exponential, it lands inside a square root, it ends up in the denominator of a logistic fraction. All of those are fine. Bolting it on at the end is not.

The Solutions That Vanish the Moment You Divide

Move one of the method divides by h(y). Division by zero is illegal, so every root of h(y) is excluded from the general solution — and every root of h(y) is itself a perfectly good solution, because if h(y₀) = 0 then dy/dx = 0 and y never moves again.

Logistic growth makes the stakes obvious. For dP/dt = 0.8P(1 − P/1000), separation gives P = 1000/(1 + Ae^(−0.8t)). No value of A produces P = 0, and none produces P = 1000. Yet both are solutions: an empty habitat stays empty, and a population sitting exactly at carrying capacity stays there. Those two equilibria are the entire qualitative story of the model — the floor everything grows away from, the ceiling everything approaches — and the standard formula contains neither one. Run the “Logistic to 1000” preset above and the calculator lists both in its lost-solutions panel; enter y₀ = 1000 and it tells you outright that you’re sitting on the constant branch.

The fix is cheap. Before dividing, set h(y) = 0, solve, and write those y-values down as additional solutions. Ten seconds of work, frequently a mark of its own on an exam, and in applied work it’s the difference between a model that has a steady state and one that appears not to. If you’d rather see the equilibrium structure without solving anything, stepping forward from several starting values in a Euler’s method calculator shows the curves flattening out at precisely those y-values.

Your Formula Is Only a Solution on One Interval

Solve dy/dx = y² with y(0) = 1. Separating gives −1/y = x + C, so C = −1 and y = 1/(1 − x). Nothing about y′ = y² hints at trouble — the right side is a polynomial, smooth everywhere, defined for every real y. But the solution blows up at x = 1. It exists on (−∞, 1) and nowhere beyond, and the branch of 1/(1 − x) living to the right of x = 1 is a different function that never connects back to your initial condition.

This is finite-time blow-up, and it’s a nonlinear phenomenon that linear equations simply don’t exhibit. Four equations, all starting at y(0) = 1:

EquationSolutionInterval of existence
y′ = ye^xAll real x
y′ = y²1/(1 − x)(−∞, 1)
y′ = y³1/√(1 − 2x)(−∞, 0.5)
y′ = 1 + y²tan(x + π/4)(−3π/4, π/4)

The pattern is clean: the faster h(y) grows, the sooner the curve escapes. Squaring buys you until x = 1; cubing halves that to x = 0.5. Three rules fix the interval in general. It must contain x₀. It must be a single interval, not a union of pieces. And the solution has to stay finite and stay inside the domain of h across all of it. The calculator finds the edges numerically, by walking outward from x₀ until the closed form stops returning a finite value, and it refuses to quote y at a target x outside that range rather than printing a confident wrong number. If you want to see the antiderivatives on their own, the integral calculator handles either side, and a general differential equation calculator is the place to start when you’re not yet sure which method the equation wants.

Separable or Not? A Thirty-Second Test

Separable means dy/dx factors into a function of x alone times a function of y alone. The test is blunt: try to write the right-hand side as a product with no mixed terms. If a sum survives that refuses to factor, it isn’t separable and you need a different method.

EquationSeparable?Why
y′ = xy + xYesFactors as x(y + 1)
y′ = x + yNoA sum that won’t factor — use an integrating factor
y′ = e^(x+y)Yese^x·e^y — exponent rules do the factoring
y′ = (x + y)²NoThe cross term 2xy blocks it — substitute u = x + y
y′ = y sin(x)/(1 + y)Yessin(x)·[y/(1 + y)] — ugly h(y), still a product

The e^(x+y) row is the one people miss. A sum inside an exponential looks unseparable, but e^(x+y) = e^x·e^y and the equation separates fine. Whenever you see a sum in an exponent, or terms sharing a common factor, spend a moment factoring before reaching for something heavier. Equations that are linear but not separable, like y′ = x + y, belong to a first-order differential equation calculator using an integrating factor instead.

When You Can’t Solve for y — and Shouldn’t Try

Separation always lands you at Φ(y) = G(x) + C. Getting from there to y = something requires inverting Φ, and plenty of ordinary-looking Φ have no elementary inverse. Take dy/dx = x/(y + e^y). Separating gives y²/2 + e^y = x²/2 + C, and no amount of algebra isolates y — not because the problem is hard, but because the inverse function doesn’t exist in closed form. That implicit relation is the answer, and it’s complete.

Implicit form stays fully usable. Differentiate it implicitly and you recover the original equation, which verifies it. Plug in the initial condition and you get C exactly. Solve numerically and you get y at any specific x you care about. The one thing you can’t do is write y = …, and inventing a formula to scratch that itch is how wrong answers get produced. When a problem says “find the general solution” without demanding explicit form, an implicit relation earns full marks. When it does say “solve for y” and you can’t, suspect an algebra slip earlier — a mistake in h(y) often turns an invertible Φ into a non-invertible one.

One more wrinkle: even when you can solve for y, you often get ±. From y²/2 = x²/2 + C comes y = ±√(x² + 2C), and the initial condition picks the branch. If y(0) = 3 you take the positive root and keep it for every x, because a solution cannot jump branches — it would have to pass through y = 0, where dy/dx is undefined for this equation. The calculator handles that by carrying the sign of y₀ through every evaluation instead of defaulting to the principal root, which is why the “y′ = x/y” preset with a negative y₀ returns the lower branch rather than silently flipping to the upper one.

Four Models You’ll Solve Again and Again With a Separable Differential Equation Calculator

Most separable equations that turn up outside a textbook are one of a small handful of shapes. Recognising the shape tells you the answer before you integrate anything.

ModelEquationSolutionBehaviour
Exponential growth or decayy′ = kyy₀e^(kt)Unbounded, or decays toward 0
Newton’s coolingy′ = k(M − y)M − (M − y₀)e^(−kt)Approaches M, never reaches it
Logistic growthy′ = ky(1 − y/M)M/(1 + Ae^(−kt))S-curve, inflection at y = M/2
Torricelli drainingy′ = −k√y(√y₀ − kt/2)²Hits zero in finite time

The draining tank is the sneaky one. A tank holding y₀ = 4 m of water with k = 0.5 empties at t = 2√y₀/k = 8 time units — and the formula (2 − 0.25t)² happily keeps producing positive numbers after t = 8, which is physical nonsense. Tanks don’t refill themselves.

That’s the interval-of-existence idea again in applied clothing: the model holds until the water runs out, after which the real solution is y = 0 — the equilibrium separation deleted back in step one. Splicing a solution branch onto its equilibrium at the right moment is standard modelling practice, and it’s only possible if you bothered to write that equilibrium down. For the theory behind why √y in particular allows two different solutions through the same point, the Lipschitz condition in the Picard–Lindelöf existence and uniqueness theorem is where to look: √y isn’t Lipschitz at y = 0, so uniqueness fails at exactly that point and nowhere else. When your equation turns out not to separate at all, the broader ODE calculator covers the methods that take over from here.

Frequently Asked Questions

Still Have Questions?

The detailed content on this page provides comprehensive explanations and examples to help you understand better.