In short
A variable-separable differential equation is one where you can rearrange the equation so that all terms involving y (and dy) are on one side and all terms involving x (and dx) are on the other. Then you integrate both sides independently. It is the simplest and most common method for solving first-order ODEs.
Radioactive material decays. If you start with N_0 atoms, the number remaining after time t satisfies
where \lambda > 0 is a constant specific to the material. The rate of decay is proportional to how many atoms are left — fewer atoms, slower decay.
You want N as a function of t. Look at the equation carefully. On the right side, N and t are tangled together only through the derivative \frac{dN}{dt}. If you rewrite the equation as
then the left side involves only N and the right side involves only t. The variables have been separated. Now integrate both sides:
where N_0 = e^C is the initial number of atoms. Three lines of algebra, and you have the law of radioactive decay — the same exponential curve that governs carbon dating, nuclear medicine, and the half-life calculations you have seen in chemistry.
That is the entire method: separate, then integrate. The rest of this article is about when you can do this, how to handle the details, and what to do with initial conditions.
When separation works
Not every differential equation is separable. The method works when the equation can be written in the form
or equivalently, after rearranging,
The key is that the right-hand side of \frac{dy}{dx} = \ldots is a product (or quotient) of a function of x alone and a function of y alone. If x and y are mixed in a way that cannot be untangled into such a product, the equation is not separable.
Quick test: \frac{dy}{dx} = x^2 y is separable (it is x^2 \cdot y). The equation \frac{dy}{dx} = x + y is not separable — there is no way to write x + y as a product f(x) \cdot g(y).
Variable Separable Form
A first-order ODE is called variable separable if it can be written as
The solution method is:
Step 1. Separate: \dfrac{dy}{g(y)} = f(x)\, dx
Step 2. Integrate both sides: \displaystyle\int \frac{dy}{g(y)} = \int f(x)\, dx + C
The constant of integration C is placed on one side only — adding a constant to both sides is redundant.
The method in full detail
Take a specific equation and walk through every step.
Step 1. Separate. Multiply both sides by y and by dx:
Now the left side has only y and the right side has only x.
Step 2. Integrate both sides.
Step 3. Simplify (if you want). Multiply through by 2:
where C_1 = 2C is still an arbitrary constant. You can leave it in this form — not every solution needs to be solved explicitly for y.
This implicit form y^2 = \frac{2x^3}{3} + C_1 is a perfectly valid general solution. It represents a family of curves in the xy-plane, one for each value of C_1.
A subtlety: dividing by g(y)
When you separate variables, you divide by g(y). If g(y) = 0 for some value of y, you are dividing by zero — and that value of y might be a solution you are losing.
Take \frac{dy}{dx} = y. Separating gives \frac{dy}{y} = dx, which requires y \neq 0. Integrating: \ln|y| = x + C, so y = Ae^x where A = \pm e^C. But y = 0 is also a solution (if y = 0 for all x, then \frac{dy}{dx} = 0 = y). This constant solution y = 0 is recovered by setting A = 0 in y = Ae^x, so in this case no solution is truly lost. But you should always check whether g(y) = 0 gives a solution that the general formula misses.
Initial value problems
An initial value problem (IVP) is a differential equation together with a condition that pins the solution at a specific point: y(x_0) = y_0. This condition eliminates the arbitrary constant and gives you one specific curve.
The recipe: first solve the DE to get the general solution with constant C, then substitute the initial condition to find C.
Take the equation \frac{dy}{dx} = 2xy with the initial condition y(0) = 3.
Separate: \frac{dy}{y} = 2x\, dx (for y \neq 0).
Integrate: \ln|y| = x^2 + C.
Exponentiate: y = Ae^{x^2} where A = \pm e^C.
Apply the initial condition: y(0) = 3 gives Ae^0 = 3, so A = 3.
Particular solution: y = 3e^{x^2}.
This is the one curve in the family y = Ae^{x^2} that passes through the point (0, 3).
Worked examples
Example 1: Solve dy/dx = (1 + y²)/(1 + x²)
Step 1. Separate variables. Divide both sides by (1 + y^2), multiply both sides by dx:
Why: the right-hand side is a ratio of a function of x and a function of y, so separation is possible. The left side now contains only y, the right side only x.
Step 2. Integrate both sides.
Why: both integrals are standard — \int \frac{du}{1+u^2} = \arctan u. The constant C goes on one side only.
Step 3. Solve for y (optional). Take the tangent of both sides:
This can be simplified using the tangent addition formula:
Writing \tan C = k (just another constant):
Why: since C is an arbitrary constant, k = \tan C is also an arbitrary constant. The explicit form shows that the solution is a Möbius transformation in x — a ratio of linear functions.
Step 4. Check. If y = \frac{x+k}{1-kx}, then by the quotient rule:
And \frac{1+y^2}{1+x^2} = \frac{1 + \frac{(x+k)^2}{(1-kx)^2}}{1+x^2} = \frac{(1-kx)^2 + (x+k)^2}{(1-kx)^2(1+x^2)}. Expanding the numerator: (1-kx)^2 + (x+k)^2 = 1 - 2kx + k^2x^2 + x^2 + 2kx + k^2 = (1+k^2)(1+x^2). So the ratio is \frac{(1+k^2)(1+x^2)}{(1-kx)^2(1+x^2)} = \frac{1+k^2}{(1-kx)^2}. It matches.
Result: \arctan y = \arctan x + C, or equivalently y = \dfrac{x + k}{1 - kx}.
The k = 0 case gives y = x — the simplest solution, where the function equals its argument everywhere. Each other value of k rotates and stretches this line into a different curve.
Example 2: Solve dy/dx = y cos x, with y(0) = 2
Step 1. Separate.
Why: divide by y, multiply by dx. The right side y \cos x is already in the form f(x) \cdot g(y) with f(x) = \cos x and g(y) = y.
Step 2. Integrate.
Why: \int \frac{dy}{y} = \ln|y| and \int \cos x\, dx = \sin x. Both are standard.
Step 3. Exponentiate to solve for y.
where A = \pm e^C is an arbitrary constant.
Why: exponentiating removes the logarithm. The absolute value goes away because A absorbs the \pm sign.
Step 4. Apply the initial condition y(0) = 2.
So A = 2.
Why: at x = 0, \sin 0 = 0 and e^0 = 1, so the entire exponential collapses to 1, and A is directly the value of y at x = 0.
Result: y = 2e^{\sin x}.
The solution oscillates because \sin x oscillates, but it is always positive (an exponential is always positive). The initial condition y(0) = 2 picks out one specific oscillating curve from the family.
Common confusions
-
"I can separate \frac{dy}{dx} = x + y by putting x on one side and y on the other." The expression x + y is a sum, not a product. You cannot write \frac{dy}{y} = (x/y + 1)\, dx and call that separated — the right side still contains y. This equation is not separable; it is linear, and requires a different method (integrating factors).
-
"The constant of integration should appear on both sides." If you write \int \frac{dy}{y} = \int \cos x\, dx and add a constant to each side, you get \ln|y| + C_1 = \sin x + C_2. But C_2 - C_1 is just another constant. One constant on one side is enough.
-
"I can cross-multiply \frac{dy}{dx} as if dy and dx are separate numbers." Technically, \frac{dy}{dx} is a single symbol — the derivative. Separation of variables "looks like" fraction manipulation, and it gives correct results, but the justification is the chain rule, not arithmetic with infinitesimals. The notation is designed to make the correct manipulation look like the obvious one.
-
"Forgetting to check g(y) = 0." When you divide by g(y) to separate, any value of y where g(y) = 0 might be a constant solution that the general formula misses. Always check.
-
"Solving the IVP before finding the general solution." You can sometimes substitute the initial condition directly into the separated-but-not-yet-integrated form, but it is cleaner and less error-prone to first get the general solution, then substitute.
Going deeper
If you came here to learn the variable-separable method, you have it — you can stop here. The rest is for readers who want to see the formal justification and the connections.
Why separation of variables works
The manipulation \frac{dy}{g(y)} = f(x)\, dx looks like treating \frac{dy}{dx} as a fraction. Here is what is actually happening.
Start with \frac{dy}{dx} = f(x) \cdot g(y). Divide both sides by g(y):
Now integrate both sides with respect to x:
On the left side, the chain rule says \frac{1}{g(y)} \cdot \frac{dy}{dx}\, dx = \frac{1}{g(y)}\, dy — this is just a u-substitution with u = y. So
The "informal" separation of variables is a shorthand for a perfectly rigorous chain-rule argument. The notation was designed to make the shorthand work. That is one of the things that makes Leibniz's notation so powerful.
Orthogonal trajectories
Here is an application that connects differential equations to geometry. Given a family of curves, the orthogonal trajectories are curves that cross every member of the family at right angles.
If the original family satisfies \frac{dy}{dx} = f(x,y), then the orthogonal trajectories satisfy \frac{dy}{dx} = -\frac{1}{f(x,y)} (negative reciprocal, since perpendicular slopes multiply to -1).
For example, the family of parabolas y = cx^2 satisfies \frac{dy}{dx} = \frac{2y}{x} (as derived in the previous article). The orthogonal trajectories satisfy \frac{dy}{dx} = -\frac{x}{2y}. Separating: 2y\, dy = -x\, dx. Integrating: y^2 = -\frac{x^2}{2} + K, or \frac{x^2}{2} + y^2 = K — a family of ellipses. Every ellipse in this family crosses every parabola at a right angle. This kind of result appears in physics (electric field lines are orthogonal trajectories of equipotential curves) and in fluid dynamics (streamlines vs. potential lines).
Equations that are "almost" separable
Some equations are not separable as written, but become separable after a simple substitution. For instance, \frac{dy}{dx} = f(ax + by + c) is not separable because x and y are inside the same function f. But the substitution v = ax + by + c (so \frac{dv}{dx} = a + b\frac{dy}{dx}) turns it into a separable equation in v and x. These "reducible to separable" equations are the subject of the next article.
Where this leads next
Variable separation is the foundation. The next articles cover equations that are not directly separable but can be made so, and equations that require entirely different tools.
- First Order — Reducible to Separable — homogeneous equations and other types that become separable after a substitution.
- First Order — Linear DE — equations of the form \frac{dy}{dx} + Py = Q, solved using integrating factors.
- First Order — Exact Equations — equations where the left side is already a total derivative.
- Differential Equations — Introduction — the parent article, covering definitions, order, degree, and formation.