In short

An equation that looks inseparable — with x and y tangled together — can often be turned into a separable equation by the right substitution. The most important case is the homogeneous equation, where \frac{dy}{dx} depends only on the ratio y/x. The substitution y = vx untangles it. Other forms use substitutions like v = ax + by + c to achieve the same effect.

Here is an equation that is clearly not separable:

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

Try to separate x and y — you cannot. The numerator x + y mixes them, and no algebraic rearrangement will pull them apart.

But notice something. Divide numerator and denominator by x:

\frac{dy}{dx} = \frac{1 + y/x}{1 - y/x}

The right side depends on x and y only through the single combination y/x. That is the clue. If you introduce a new variable v = y/x, so that y = vx, the equation becomes an equation in v and x alone — and that new equation is separable.

This is the strategy: find a substitution that collapses a non-separable equation into a separable one. The art is in knowing which substitution to use.

Homogeneous functions — the key idea

A function f(x, y) is called homogeneous of degree n if multiplying both x and y by the same factor t simply multiplies the function by t^n:

f(tx, ty) = t^n f(x, y)

For example:

The important case for us: a function that is homogeneous of degree 0 depends only on the ratio y/x. When you set t = 1/x, you get f(x, y) = f(1, y/x), which is a function of y/x alone.

Homogeneous Differential Equation

A first-order equation \frac{dy}{dx} = f(x, y) is called homogeneous if f(x, y) is a homogeneous function of degree 0 — equivalently, if f(x, y) can be written as a function of y/x alone:

\frac{dy}{dx} = \phi\!\left(\frac{y}{x}\right)

The substitution y = vx (so v = y/x) reduces it to a separable equation in v and x.

The substitution y = vx — why it works

Set y = vx, where v is a new unknown function of x. By the product rule:

\frac{dy}{dx} = v + x\frac{dv}{dx}

Substitute into \frac{dy}{dx} = \phi(y/x) = \phi(v):

v + x\frac{dv}{dx} = \phi(v)
x\frac{dv}{dx} = \phi(v) - v

This is separable:

\frac{dv}{\phi(v) - v} = \frac{dx}{x}

Integrate both sides, then substitute back v = y/x to get the solution in terms of x and y.

The entire method rests on one structural fact: in a homogeneous equation, x and y always appear in the same "degree," so dividing by x^n collapses everything down to the single variable v = y/x.

The full method, step by step

Let's solve the equation from the opening:

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

Step 1. Verify homogeneity. Check that f(tx, ty) = t^0 f(x, y):

f(tx, ty) = \frac{tx + ty}{tx - ty} = \frac{x + y}{x - y} = f(x, y) \checkmark

Step 2. Substitute y = vx. Then \frac{dy}{dx} = v + x\frac{dv}{dx} and \frac{y}{x} = v:

v + x\frac{dv}{dx} = \frac{1 + v}{1 - v}

Step 3. Isolate x\frac{dv}{dx}.

x\frac{dv}{dx} = \frac{1 + v}{1 - v} - v = \frac{1 + v - v(1-v)}{1 - v} = \frac{1 + v - v + v^2}{1 - v} = \frac{1 + v^2}{1 - v}

Step 4. Separate.

\frac{1 - v}{1 + v^2}\, dv = \frac{dx}{x}

Split the left side:

\frac{1}{1 + v^2}\, dv - \frac{v}{1 + v^2}\, dv = \frac{dx}{x}

Step 5. Integrate.

\arctan v - \frac{1}{2}\ln(1 + v^2) = \ln|x| + C

Step 6. Substitute back v = y/x.

\arctan\frac{y}{x} - \frac{1}{2}\ln\!\left(1 + \frac{y^2}{x^2}\right) = \ln|x| + C

Simplify using 1 + y^2/x^2 = (x^2 + y^2)/x^2 and \ln\sqrt{(x^2+y^2)/x^2} = \frac{1}{2}\ln(x^2+y^2) - \ln|x|:

\arctan\frac{y}{x} = \frac{1}{2}\ln(x^2 + y^2) + C

This is the general solution — an implicit relation between x and y. The curves it describes are logarithmic spirals, which appear in nature everywhere from seashells to galaxy arms.

The solution curves of $\frac{dy}{dx} = \frac{x+y}{x-y}$ are logarithmic spirals centred at the origin. Every curve spirals outward, winding around the origin without ever reaching it. The dashed lines show two directions where the slope is particularly simple.

Equations reducible to homogeneous

Some equations look almost homogeneous but have constant terms that spoil the pattern:

\frac{dy}{dx} = \frac{ax + by + c}{dx + ey + f}

If c = f = 0, this is homogeneous. If c \neq 0 or f \neq 0, it is not — but you can often fix this by shifting coordinates.

Case 1: The lines ax + by + c = 0 and dx + ey + f = 0 intersect. Find the intersection point (h, k) and substitute X = x - h, Y = y - k. The constants vanish and the equation becomes homogeneous in X and Y.

Case 2: The lines are parallel, meaning \frac{a}{d} = \frac{b}{e} (but \neq \frac{c}{f}). In this case, write a/d = b/e = m, so ax + by = m(dx + ey). Substitute v = dx + ey to reduce the equation to separable form directly.

Here is Case 1 in action. Solve

\frac{dy}{dx} = \frac{x + y - 3}{x - y + 1}

The lines x + y - 3 = 0 and x - y + 1 = 0 intersect where x + y = 3 and x - y = -1. Adding: 2x = 2, so x = 1. Then y = 2. The intersection is (1, 2).

Substitute X = x - 1, Y = y - 2. Then \frac{dY}{dX} = \frac{dy}{dx} (since the shifts are constants), and:

x + y - 3 = (X+1) + (Y+2) - 3 = X + Y
x - y + 1 = (X+1) - (Y+2) + 1 = X - Y

So the equation becomes \frac{dY}{dX} = \frac{X + Y}{X - Y}, which is the homogeneous equation solved above. After solving in X and Y, substitute back X = x - 1, Y = y - 2.

The two lines $x + y - 3 = 0$ and $x - y + 1 = 0$ intersect at $(1, 2)$. Shifting the origin to this point eliminates the constant terms, turning the equation into a homogeneous one. The solution curves are the same logarithmic spirals as before, but centred at $(1, 2)$ instead of the origin.

Special substitutions

Beyond y = vx, other substitutions handle equations of specific forms.

The form \frac{dy}{dx} = f(ax + by + c)

This is not homogeneous, but the substitution v = ax + by + c works. Then

\frac{dv}{dx} = a + b\frac{dy}{dx} = a + b\,f(v)

which is separable in v and x: \frac{dv}{a + b\,f(v)} = dx.

Example: Solve \frac{dy}{dx} = (x + y)^2.

Set v = x + y. Then \frac{dv}{dx} = 1 + \frac{dy}{dx} = 1 + v^2. Separate:

\frac{dv}{1 + v^2} = dx
\arctan v = x + C
\arctan(x + y) = x + C
x + y = \tan(x + C)
y = \tan(x + C) - x

That is the complete general solution. The substitution collapsed a nonlinear equation into a standard integral.

The form \frac{dy}{dx} = f\!\left(\frac{y}{x}\right) where f has a specific structure

Sometimes the equation \frac{dy}{dx} = \frac{y}{x} + g\!\left(\frac{y}{x}\right) appears, where the y/x piece is already separated out. The substitution y = vx still works and simplifies faster because the v cancels from both sides immediately, leaving x\frac{dv}{dx} = g(v).

Worked examples

Example 1: Solve x dy − y dx = √(x² + y²) dx

Step 1. Rewrite the equation.

x\, dy - y\, dx = \sqrt{x^2 + y^2}\, dx
\frac{dy}{dx} = \frac{y + \sqrt{x^2 + y^2}}{x}

Why: divide both sides by dx, then divide by x to isolate \frac{dy}{dx}.

Step 2. Check homogeneity. Replace x by tx, y by ty:

\frac{ty + \sqrt{t^2x^2 + t^2y^2}}{tx} = \frac{ty + t\sqrt{x^2+y^2}}{tx} = \frac{y + \sqrt{x^2+y^2}}{x}

Homogeneous of degree 0. Good.

Why: every term has the same total degree in x and y (degree 1), so dividing numerator and denominator by x will give a function of v = y/x alone.

Step 3. Substitute y = vx.

v + x\frac{dv}{dx} = \frac{vx + \sqrt{x^2 + v^2x^2}}{x} = v + \sqrt{1 + v^2}

So x\frac{dv}{dx} = \sqrt{1 + v^2}.

Why: the v terms cancel on both sides, leaving a clean separable equation. This always happens when the equation has the structure \frac{dy}{dx} = \frac{y}{x} + h(y/x).

Step 4. Separate and integrate.

\frac{dv}{\sqrt{1 + v^2}} = \frac{dx}{x}
\sinh^{-1}(v) = \ln|x| + C

or equivalently, \ln(v + \sqrt{1+v^2}) = \ln|x| + C.

Why: \int \frac{dv}{\sqrt{1+v^2}} = \sinh^{-1}(v) = \ln(v + \sqrt{1+v^2}), a standard integral.

Step 5. Substitute back v = y/x.

\ln\!\left(\frac{y}{x} + \sqrt{1 + \frac{y^2}{x^2}}\right) = \ln|x| + C
\ln\!\left(\frac{y + \sqrt{x^2+y^2}}{x}\right) = \ln|x| + C
y + \sqrt{x^2+y^2} = Kx^2

where K = e^C.

Result: y + \sqrt{x^2 + y^2} = Kx^2.

The solution curves pass through the origin and spiral outward. The dotted circle $x^2 + y^2 = 4$ is shown for scale. Each solution curve corresponds to a different value of $K$.

Example 2: Solve dy/dx = (2x + 3y + 4)/(4x + 6y + 5)

Step 1. Check whether the lines 2x + 3y + 4 = 0 and 4x + 6y + 5 = 0 intersect.

The coefficients: \frac{2}{4} = \frac{1}{2} and \frac{3}{6} = \frac{1}{2}, but \frac{4}{5} \neq \frac{1}{2}. So the lines are parallel (same slope, different intercepts). This is Case 2.

Why: since a/d = b/e, the two lines have the same direction. They never meet, so the coordinate-shift trick will not work. Instead, use a direct substitution.

Step 2. Write 4x + 6y = 2(2x + 3y). Set v = 2x + 3y.

Then \frac{dv}{dx} = 2 + 3\frac{dy}{dx}.

Why: since both the numerator and denominator are linear in 2x + 3y, substituting v = 2x + 3y will collapse the equation into a function of v alone.

Step 3. Express \frac{dy}{dx} in terms of v:

\frac{dy}{dx} = \frac{v + 4}{2v + 5}

From \frac{dv}{dx} = 2 + 3 \cdot \frac{v+4}{2v+5} = \frac{2(2v+5) + 3(v+4)}{2v+5} = \frac{4v + 10 + 3v + 12}{2v+5} = \frac{7v + 22}{2v + 5}

Why: combining the terms over a common denominator gives a single rational function of v.

Step 4. Separate.

\frac{2v + 5}{7v + 22}\, dv = dx

To integrate the left side, write 2v + 5 = \frac{2}{7}(7v + 22) + 5 - \frac{44}{7} = \frac{2}{7}(7v+22) - \frac{9}{7}:

\left(\frac{2}{7} - \frac{9}{7(7v+22)}\right) dv = dx

Why: partial fractions — express the numerator as a multiple of the denominator plus a constant. This splits the integral into two standard parts.

Step 5. Integrate.

\frac{2v}{7} - \frac{9}{49}\ln|7v + 22| = x + C

Substitute back v = 2x + 3y:

\frac{2(2x+3y)}{7} - \frac{9}{49}\ln|7(2x+3y) + 22| = x + C
\frac{4x + 6y}{7} - \frac{9}{49}\ln|14x + 21y + 22| = x + C

Result: \dfrac{4x + 6y}{7} - \dfrac{9}{49}\ln|14x + 21y + 22| = x + C.

The two parallel lines $2x + 3y + 4 = 0$ and $4x + 6y + 5 = 0$ (dotted). Because they are parallel, the substitution $v = 2x + 3y$ collapses the equation to one variable. The solution curves fill the strip between and around these lines.

The result is not as clean as Example 1 — that is typical of the parallel-lines case. But the method still produces an explicit (if implicit) answer in a systematic way.

Common confusions

Going deeper

If you came here to learn how to solve homogeneous equations and the reducible-to-homogeneous types, you have it — you can stop here. The rest is for readers curious about the geometry and the broader picture.

The geometric meaning of homogeneity

A homogeneous equation \frac{dy}{dx} = \phi(y/x) has a remarkable geometric property: the slope at a point (x, y) depends only on the direction from the origin to that point, not on the distance. Every point on the ray from the origin through (1, v) — that is, every point (x, vx) — has the same slope \phi(v).

This means the solution curves are self-similar: if you scale a solution curve by any factor t (replacing x by tx and y by ty), you get another solution curve. Geometrically, the family of solutions is invariant under dilation from the origin. Logarithmic spirals have this property, which is why they appear so often as solutions of homogeneous equations.

Connection to scaling symmetry

The self-similarity is a symmetry of the differential equation. In the language of Lie groups — a subject you will meet in advanced mathematics — a homogeneous equation has a scaling symmetry, and the substitution y = vx is the change of variables that exploits that symmetry. Every solvable first-order ODE can be solved because it has some hidden symmetry, and the art of solving ODEs is largely the art of finding that symmetry. The variable-separable method uses translation symmetry; the homogeneous method uses scaling symmetry; the exact-equation method uses a different structural property altogether.

Where this leads next