Separable Differential Equations: Solve Step By Step

#Calculus
TL;DR
Separable differential equations are first-order equations that can be written as dydx=g(x),h(y)\frac{dy}{dx} = g(x),h(y), so that every yy can be moved to one side and every xx to the other. You solve them by separating the variables, integrating both sides, adding a single constant +C+C, and then solving for yy or leaving the answer implicit. One extra step matters: each root of h(y)=0h(y) = 0 gives a constant singular solution that separation can quietly lose.
BT
Bhanzu TeamLast updated on September 30, 202614 min read

What Are Separable Differential Equations?

Separable differential equations are first-order differential equations whose right-hand side factors into a part that depends only on xx and a part that depends only on yy:

dydx=g(x),h(y)\frac{dy}{dx} = g(x),h(y)

If you can write the equation in that product form, it is separable, and the whole solution method opens up. The idea is to gather every yy (with the dydy) on one side and every xx (with the dxdx) on the other, then integrate each side by itself. That is why the technique is called separation of variables.

Two quick tests decide whether an equation qualifies:

  • It is separable when the right side is a product of a function of xx alone and a function of yy alone, such as dydx=xy\frac{dy}{dx} = xy, dydx=y2\frac{dy}{dx} = y^2, or dydx=xy\frac{dy}{dx} = \frac{x}{y}.

  • It is not separable when xx and yy are locked together in a way that will not factor, such as dydx=x+y\frac{dy}{dx} = x + y. No rearrangement splits a sum like that into an xx-only times a yy-only piece.

Separable equations are the first solvable family in the study of ordinary differential equations, and they carry order and degree one and one: one derivative, raised to the first power.

How Do You Solve A Separable Differential Equation?

The method is four short moves. Start from dydx=g(x),h(y)\frac{dy}{dx} = g(x),h(y) and assume for the moment that h(y)≠0h(y) \neq 0.

  1. Separate the variables. Divide by h(y)h(y) and multiply by dxdx so each variable sits with its own differential:

dyh(y)=g(x),dx\frac{dy}{h(y)} = g(x),dx

  1. Integrate both sides. Integrate the left side with respect to yy and the right side with respect to xx. Each side produces its own constant, but the two combine into a single constant CC on the right:

∫dyh(y)=∫g(x),dx+C\int \frac{dy}{h(y)} = \int g(x),dx + C

  1. Solve for yy, or leave it implicit. If the resulting equation rearranges cleanly, write yy as an explicit function of xx. If it does not, an implicit relation between xx and yy is a complete and acceptable answer.

  2. Recover the singular solutions and apply any initial condition. Check each value where h(y)=0h(y) = 0 (the next section explains why), then, if an initial value y(x0)=y0y(x_0) = y_0 is given, substitute it to pin down CC.

The geometry underneath the algebra is worth holding onto. The equation dydx=g(x),h(y)\frac{dy}{dx} = g(x),h(y) assigns a slope to every point (x,y)(x, y) in the plane. Drawing a short line segment of that slope at many points produces a direction field, and a solution curve is simply a curve that stays tangent to the field everywhere.

Separation of variables is the algebra; the direction field is the same information drawn as a picture. Every solution you compute is one of the curves threading through that field.

Where Do Singular Solutions Come From?

Step 1 divided by h(y)h(y). That move is only legal when h(y)≠0h(y) \neq 0, and dividing quietly throws away any value of yy that makes h(y)=0h(y) = 0. Those values are not junk: each one is a genuine constant solution, called a singular or equilibrium solution, because a horizontal line y=cy = c has dydx=0\frac{dy}{dx} = 0, which matches g(x),h(c)=0g(x),h(c) = 0 exactly when h(c)=0h(c) = 0.

The rule is short. For every root cc of h(y)=0h(y) = 0, the constant function y=cy = c solves the original equation. After you find the general solution by integrating, always go back and list these separately.

Sometimes the singular solution reappears as a special case of the general formula (a particular value of CC), and sometimes it is a truly separate curve the general formula can never produce. The worked examples below show one of each, so the difference is concrete rather than abstract. This is the one step competitors skip, and it is the most common way to lose marks on an otherwise correct solution.

What Are Some Worked Separable Differential Equations Examples?

Each example is fully stepped, and every solution is verified by substituting it back into the original equation.

Example 1: Solve dydx=xy\frac{dy}{dx} = xy, then find the curve through (0,3)(0, 3).

Here g(x)=xg(x) = x and h(y)=yh(y) = y. Separate the variables (assuming y≠0y \neq 0):

dyy=x,dx\frac{dy}{y} = x,dx

Integrate both sides:

∫dyy=∫x,dx⟹ln⁡∣y∣=x22+C\int \frac{dy}{y} = \int x,dx \quad\Longrightarrow\quad \ln\lvert y\rvert = \frac{x^2}{2} + C

Solve for yy by exponentiating. Writing A=±eCA = \pm e^{C} absorbs the constant and its sign:

y=A,ex2/2y = A,e^{x^2/2}

Singular solution: h(y)=y=0h(y) = y = 0 gives y=0y = 0, and here it is the special case A=0A = 0, so the single family y=A,ex2/2y = A,e^{x^2/2} (any real AA) captures every solution.

Now apply the initial condition y(0)=3y(0) = 3: since e0=1e^{0} = 1, we get 3=A3 = A, so y=3,ex2/2y = 3,e^{x^2/2}.

Check by differentiating back: dydx=3⋅x,ex2/2=x(3,ex2/2)=xy\frac{dy}{dx} = 3 \cdot x,e^{x^2/2} = x\big(3,e^{x^2/2}\big) = xy, and y(0)=3y(0) = 3. Both the equation and the condition hold.

Final answer: y=3,ex2/2y = 3,e^{x^2/2}.

Example 2: Solve dydx=y2\frac{dy}{dx} = y^2, then find the curve through (0,1)(0, 1).

Now g(x)=1g(x) = 1 and h(y)=y2h(y) = y^2. Separate (assuming y≠0y \neq 0):

dyy2=dx\frac{dy}{y^2} = dx

Integrate both sides, using ∫y−2,dy=−y−1\int y^{-2},dy = -y^{-1}:

−1y=x+C⟹y=−1x+C-\frac{1}{y} = x + C \quad\Longrightarrow\quad y = \frac{-1}{x + C}

Singular solution: h(y)=y2=0h(y) = y^2 = 0 gives y=0y = 0. Substituting y=0y = 0 into the original equation gives dydx=0=02\frac{dy}{dx} = 0 = 0^2, so it is a valid solution, and no finite CC makes −1x+C\frac{-1}{x+C} equal to zero. This time y=0y = 0 is a true singular solution, separate from the general family.

Apply y(0)=1y(0) = 1: 1=−10+C1 = \frac{-1}{0 + C} gives C=−1C = -1, so y=−1x−1=11−xy = \frac{-1}{x - 1} = \frac{1}{1 - x}.

Check: dydx=ddx(1−x)−1=(1−x)−2\frac{dy}{dx} = \frac{d}{dx}(1 - x)^{-1} = (1 - x)^{-2}, and y2=(11−x)2=(1−x)−2y^2 = \left(\frac{1}{1-x}\right)^2 = (1 - x)^{-2}. They agree, and y(0)=1y(0) = 1. Note the solution blows up at x=1x = 1, so its interval of validity is x<1x < 1, a reminder that a solution need not exist for every xx.

Final answer: y=11−xy = \dfrac{1}{1 - x} (valid for x<1x < 1), with the singular solution y=0y = 0.

Example 3: Solve dydx=−xy\frac{dy}{dx} = -\frac{x}{y} with y(0)=3y(0) = 3 (an implicit answer made explicit).

Here the right side factors as g(x),h(y)=(−x)⋅1yg(x),h(y) = (-x)\cdot\frac{1}{y}, so the equation is separable. Move each variable to its own side by multiplying across:

y,dy=−x,dxy,dy = -x,dx

Integrate both sides:

y22=−x22+C⟹x2+y2=2C\frac{y^2}{2} = -\frac{x^2}{2} + C \quad\Longrightarrow\quad x^2 + y^2 = 2C

Writing R2=2CR^2 = 2C, the general solution is the implicit family of circles x2+y2=R2x^2 + y^2 = R^2. Apply y(0)=3y(0) = 3: 0+9=R20 + 9 = R^2, so R2=9R^2 = 9. Solving for the branch through (0,3)(0, 3) gives the explicit form:

y=9−x2y = \sqrt{9 - x^2}

Check by implicit differentiation of x2+y2=9x^2 + y^2 = 9: 2x+2ydydx=02x + 2y\frac{dy}{dx} = 0, so dydx=−xy\frac{dy}{dx} = -\frac{x}{y}, the original equation, and y(0)=9=3y(0) = \sqrt{9} = 3. Geometrically the solution curves are circles centred at the origin, always crossing the radial direction at a right angle, which is exactly what a slope of −xy-\frac{x}{y} encodes.

Final answer: x2+y2=9x^2 + y^2 = 9, or explicitly y=9−x2y = \sqrt{9 - x^2} on −3<x<3-3 < x < 3.

How Does The Logistic Equation Use Separation Of Variables?

The logistic equation models population growth that levels off at a carrying capacity KK:

dPdt=rP(1−PK)\frac{dP}{dt} = rP\left(1 - \frac{P}{K}\right)

The right side is g(t),h(P)g(t),h(P) with g(t)=1g(t) = 1 and h(P)=rP(1−PK)h(P) = rP\left(1 - \frac{P}{K}\right), so the equation is separable. Its two singular solutions come straight from h(P)=0h(P) = 0: the roots are P=0P = 0 (no population) and P=KP = K (population already at capacity), and both are constant equilibrium solutions.

Separating and integrating the left side needs partial fractions, because 1P(1−P/K)=1P+1/K1−P/K\frac{1}{P\left(1 - P/K\right)} = \frac{1}{P} + \frac{1/K}{1 - P/K}. Carrying the integration through and solving for PP gives the S-shaped logistic curve:

P(t)=K1+A,e−rt,A=K−P0P0P(t) = \frac{K}{1 + A,e^{-rt}}, \qquad A = \frac{K - P_0}{P_0}

As t→∞t \to \infty the exponential dies and P(t)→KP(t) \to K: every non-zero starting population rises or falls toward the carrying capacity, one of the equilibria that separation flagged at the very first step. The same machinery, in its simplest form dPdt=rP\frac{dP}{dt} = rP, produces plain exponential growth and decay.

When Is A First-Order Equation Separable? A Reference Table

Table: Common first-order equations, whether they separate, and why.

Equation

Separable?

g(x)g(x)

h(y)h(y)

Singular solution(s)

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

Yes

xx

yy

y=0y = 0 (inside the family)

dydx=y2\frac{dy}{dx} = y^2

Yes

11

y2y^2

y=0y = 0 (truly separate)

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

Yes

xx

1y\frac{1}{y}

none (hh never 00)

dydx=rP(1−P/K)\frac{dy}{dx} = rP(1 - P/K)

Yes

11

rP(1−P/K)rP(1 - P/K)

P=0P = 0 and P=KP = K

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

No

—

—

not of product form

dydx=x2+y2\frac{dy}{dx} = x^2 + y^2

No

—

—

not of product form

When an equation fails the separability test, other first-order methods take over, such as the integrating-factor method for linear differential equations, the substitution for homogeneous differential equations, or the test for exact differential equations.

Why Does Separation Of Variables Work?

Splitting dydx\frac{dy}{dx} as if it were a fraction looks like a trick, but it rests on the chain rule and the fundamental link between differentiation and integration.

  • It is the chain rule read backwards. Start from 1h(y)dydx=g(x)\frac{1}{h(y)}\frac{dy}{dx} = g(x). If HH is an antiderivative of 1h(y)\frac{1}{h(y)}, the left side is exactly ddx,H(y(x))\frac{d}{dx},H\big(y(x)\big) by the chain rule. Integrating both sides with respect to xx gives H(y)=∫g(x),dx+CH(y) = \int g(x),dx + C, which is the same relation the "separate and integrate" shortcut produces. The differentials are a bookkeeping notation for a legitimate chain-rule step.

  • Each side has its own variable, so each integrates alone. Once every yy sits with dydy and every xx with dxdx, the two integrals are independent one-variable problems. That independence is the whole payoff of the product form g(x),h(y)g(x),h(y).

  • The constant carries the family. A first-order equation has a one-parameter family of solutions, and the single +C+C is that parameter. An initial condition selects one curve from the family, which is why CC is found last.

Seen this way, separability is not a lucky accident of certain equations. It is the precise condition under which the chain rule can be undone one variable at a time.

Who Discovered Separable Differential Equations?

Separation of variables is almost as old as calculus itself, arriving within a few years of the notation that made it writable.

Two figures anchor the story with dates:

  • Gottfried Wilhelm Leibniz (1646–1716, Germany) introduced the differential notation and the separation technique that still bears no better name than "separation of variables."

  • Johann Bernoulli (1667–1748, Switzerland) turned the method into a working tool for applied problems and taught it to the next generation, including Euler.

Later, rigour caught up: the existence-and-uniqueness theorems of the nineteenth century explained when the one-parameter family and its singular solutions form the complete answer.

Where Are Separable Differential Equations Used In The Real World?

Any process whose rate of change depends on the current amount tends to be separable, which is why the method reaches across the sciences.

  • Radioactive decay and cooling: dydx=ky\frac{dy}{dx} = ky models decay, and Newton's law of cooling, dTdt=k(T−Troom)\frac{dT}{dt} = k(T - T_{\text{room}}), both separate and integrate to exponential curves.

  • Population biology: unchecked growth is dPdt=rP\frac{dP}{dt} = rP; growth with a ceiling is the logistic equation, and both are solved by separation.

  • Draining tanks (Torricelli's law): the height of water in a leaking tank obeys dhdt=−kh\frac{dh}{dt} = -k\sqrt{h}, a separable equation that predicts the emptying time.

  • Mixing problems: the concentration of salt in a stirred tank with inflow and outflow leads to a separable first-order equation in chemical engineering.

  • Simple circuits: the charge on a capacitor in an RC circuit, dqdt=1R(V−qC)\frac{dq}{dt} = \frac{1}{R}\left(V - \frac{q}{C}\right), separates to give the familiar charging curve.

One method, "separate and integrate," quietly powers models of decay, populations, fluids, and electronics, which is why it is the first solution technique every differential-equations course teaches.

What Are The Most Common Mistakes With Separable Differential Equations?

These four errors account for most lost marks, and each matches a question real students ask on r/calculus, r/learnmath, and course common-error handouts.

Losing the singular solution when you divide by h(y)h(y).

Where it slips in:

Solving dydx=y2\frac{dy}{dx} = y^2, a student divides by y2y^2, integrates to y=−1x+Cy = \frac{-1}{x + C}, and stops, never noticing that y=0y = 0 was discarded at the division step.

Don't do this:

Do not treat the general family as the whole answer. Dividing by h(y)h(y) silently removes every yy with h(y)=0h(y) = 0.

The correct way:

Before or after integrating, solve h(y)=0h(y) = 0 and test each root in the original equation. For dydx=y2\frac{dy}{dx} = y^2, the root y=0y = 0 is a valid constant solution that must be stated alongside the family.

Adding the constant of integration too late, or to both sides.

Where it slips in:

A student integrates, solves all the way to an explicit yy, and only then appends +C+C, or writes a separate constant on each side and never combines them.

Don't do this:

Do not attach CC after solving for yy, and do not carry two constants. Adding +C+C at the wrong stage changes the family of curves entirely.

The correct way:

Add a single +C+C the moment you integrate, while the equation is still ∫dyh(y)=∫g(x),dx+C\int \frac{dy}{h(y)} = \int g(x),dx + C, then carry it through the algebra. Two constants, one from each side, always merge into one.

Mishandling the logarithm-to-exponential step.

Where it slips in:

From ln⁡∣y∣=x22+C\ln\lvert y\rvert = \frac{x^2}{2} + C, a student writes y=ex2/2+eCy = e^{x^2/2} + e^{C}, splitting the exponential of a sum into a sum of exponentials, or drops the absolute value and loses the negative branch.

Don't do this:

Do not turn ea+be^{a + b} into ea+ebe^{a} + e^{b}, and do not ignore the sign hidden by ∣y∣\lvert y\rvert.

The correct way:

Use ea+b=eaebe^{a + b} = e^{a}e^{b}, so e,x2/2+C=eCex2/2e^{,x^2/2 + C} = e^{C}e^{x^2/2}, and fold the constant sign into one symbol: y=A,ex2/2y = A,e^{x^2/2} with A=±eCA = \pm e^{C} any real constant.

Trying to separate an equation that is not separable.

Where it slips in:

Faced with dydx=x+y\frac{dy}{dx} = x + y, a student forces a split such as dyy=dxx\frac{dy}{y} = \frac{dx}{x}, which does not follow from the original equation at all.

Don't do this:

Do not separate before checking that the right side factors as g(x),h(y)g(x),h(y). A sum like x+yx + y never factors that way.

The correct way:

Test the form first. If it will not factor into an xx-only part times a yy-only part, reach for a linear method (integrating factor), a homogeneous substitution, or an exactness test instead.

Practice Problems On Separable Differential Equations

Work each one, then check against the answer. Every answer has been verified by substitution.

  1. Solve dydx=yx\frac{dy}{dx} = \frac{y}{x} for x>0x > 0.
    (Answer: dyy=dxx\frac{dy}{y} = \frac{dx}{x} gives ln⁡∣y∣=ln⁡∣x∣+C\ln\lvert y\rvert = \ln\lvert x\rvert + C, so y=Axy = Ax; singular solution y=0y = 0 is the case A=0A = 0.)

  2. Solve dydx=2xy\frac{dy}{dx} = 2xy with y(0)=5y(0) = 5.
    (Answer: ln⁡∣y∣=x2+C\ln\lvert y\rvert = x^2 + C, so y=5ex2y = 5e^{x^2}.)

  3. Solve dydx=ex−y\frac{dy}{dx} = e^{x - y}.
    (Answer: ey,dy=ex,dxe^{y},dy = e^{x},dx, so ey=ex+Ce^{y} = e^{x} + C, giving y=ln⁡(ex+C)y = \ln\left(e^{x} + C\right).)

  4. Solve dydx=3x2y2\frac{dy}{dx} = \frac{3x^2}{y^2}.
    (Answer: y2,dy=3x2,dxy^2,dy = 3x^2,dx, so y33=x3+C\frac{y^3}{3} = x^3 + C, giving y=(3x3+C1)1/3y = \left(3x^3 + C_1\right)^{1/3}.)

  5. Solve dydx=y−1\frac{dy}{dx} = y - 1 with y(0)=3y(0) = 3.
    (Answer: ln⁡∣y−1∣=x+C\ln\lvert y - 1\rvert = x + C, so y=1+2exy = 1 + 2e^{x}; singular solution y=1y = 1.)

  6. Solve dydx=cos⁡xy\frac{dy}{dx} = \frac{\cos x}{y} with y(0)=2y(0) = 2.
    (Answer: y,dy=cos⁡x,dxy,dy = \cos x,dx, so y22=sin⁡x+2\frac{y^2}{2} = \sin x + 2, giving y=2sin⁡x+4y = \sqrt{2\sin x + 4}.)

Where Should You Go Next After Separable Differential Equations?

Separation of variables is the first door into differential equations, and several natural next steps open from here.

  1. Ordinary differential equations. See where separable equations sit in the wider map of first- and higher-order equations.

  2. Linear differential equations. Learn the integrating-factor method for the many equations that are not separable.

  3. Initial value problems. Go deeper on using a condition y(x0)=y0y(x_0) = y_0 to select one curve from the solution family.

If your child is meeting separable differential equations for the first time, a live Bhanzu trainer teaches the method from the direction-field picture up, so separation feels like following a slope rather than shuffling symbols, in the Bhanzu math classes.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What are separable differential equations in simple terms?
They are first-order equations you can write as dydx=g(x),h(y)\frac{dy}{dx} = g(x),h(y), where the right side splits into an xx-only part and a yy-only part. That split lets you move all the yy-terms to one side, all the xx-terms to the other, and integrate each side on its own.
How do you know if a differential equation is separable?
Check whether the right-hand side factors into a function of xx times a function of yy. Equations like dydx=xy\frac{dy}{dx} = xy or dydx=y2\frac{dy}{dx} = y^2 pass; equations like dydx=x+y\frac{dy}{dx} = x + y do not, because a sum will not factor into a product of an xx-part and a yy-part.
Do you lose solutions when you separate variables?
You can. Dividing by h(y)h(y) removes any yy where h(y)=0h(y) = 0, and each such value is a constant singular solution. Always solve h(y)=0h(y) = 0 separately and add those solutions back, since they are the ones most often dropped.
Where does the constant of integration go?
Add a single +C+C at the moment you integrate both sides, not after you have solved for yy. Each side technically gets its own constant, but they merge into one, and an initial condition then fixes its value.
What is the difference between separable differential equations and linear ones?
A separable equation factors as g(x),h(y)g(x),h(y); a linear first-order equation has the form dydx+p(x)y=q(x)\frac{dy}{dx} + p(x)y = q(x) and is solved with an integrating factor. Some equations are both, but many linear equations, such as dydx+y=x\frac{dy}{dx} + y = x, are not separable.
Can a separable differential equation have an implicit solution?
Yes. After integrating, the relation between xx and yy may not rearrange into y=f(x)y = f(x). An implicit equation such as x2+y2=R2x^2 + y^2 = R^2 is a complete solution, and you solve for yy only when a clean explicit form exists.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →