Separable Equations

A first-order equation is separable when the two variables can be pulled apart so that everything involving x sits with d x and everything involving y sits with d y . Once separated, the equation is solved by integrating each side independently. This is the simplest and most widely used technique in the chapter, so it is always worth testing first.

Quick Reference

Item Statement
Separable form f ( x ) d x + g ( y ) d y = 0
Equivalent test d y d x = F ( x ) G ( y ) , a product of a function of x and a function of y
General solution f ( x ) d x + g ( y ) d y = c
Only one constant Combine the two constants of integration into a single c
Watch for lost solutions Dividing by G ( y ) discards the roots of G ( y ) = 0 , which are equilibrium solutions
Useful substitution t d t 1 t 2 = 1 t 2 , from u = 1 t 2
Interval of validity Runs from the initial point out to the nearest place where the solution loses differentiability

Definition and Method

Suppose we can rewrite the equation M ( x , y ) d x + N ( x , y ) d y = 0 in the form

f(x)\,dx + g(y)\,dy = 0 ; \tag{1}

that is, M ( x , y ) = f ( x ) is a function of x only and N ( x , y ) = g ( y ) is a function of y only.

An equation that can be written in the form f ( x ) d x + g ( y ) d y = 0 is called separable. Its general solution is

f ( x ) d x + g ( y ) d y = c

where c is an arbitrary constant.

The justification is short. Each term of (1) is an exact differential of a function of one variable, so the left-hand side is the total differential of F ( x ) + G ( y ) , where F' = f and G' = g. Setting a total differential to zero says the function is constant, giving F ( x ) + G ( y ) = c .

Only one arbitrary constant appears, even though two integrals were performed. Both integrations produce a constant, but their sum can be absorbed into a single c on the right. Carrying two constants would wrongly suggest a two-parameter family for a first-order equation.

Recognizing a Separable Equation

In standard form, an equation is separable exactly when the right-hand side factors as a product:

d y d x = F ( x ) G ( y ) .

Then dividing by G ( y ) and multiplying by d x gives d y G ( y ) = F ( x ) d x , which is form (1).

Some examples of the test in action:

  • y' = x^2 y^3 is separable: F ( x ) = x 2 , G ( y ) = y 3 .
  • y' = x + y is not separable. A sum does not factor into a product of a function of x and a function of y .
  • y' = e^{x+y} is separable, since e x + y = e x e y . Exponentials turn sums into products, so look for this.
  • y' = \dfrac{x^3 y - y}{y^4 - y^2 + 1} is separable after factoring the numerator as y ( x 3 1 ) .

Warning about lost solutions. The step of dividing by G ( y ) is legitimate only where G ( y ) 0 . If G ( k ) = 0 for some constant k , then y = k is an equilibrium solution of the original equation, and dividing throws it away. Always check the roots of G separately and add them back if they are genuine solutions.

Worked Examples

Find the general solution of the equation

x 1 y 2 d x + y 1 x 2 d y = 0 .
Solution

The equation is not yet separated, since each term mixes x and y . Dividing by 1 y 2 1 x 2 separates it:

x 1 x 2 d x + y 1 y 2 d y = 0

Therefore

x 1 x 2 d x + y 1 y 2 d y = c 1

To evaluate t 1 t 2 d t , make the substitution u = 1 t 2 , so that 2 t d t = d u and t d t = d u 2 :

\begin{aligned} \int \frac{t}{\sqrt{1-t^2}}\,dt &= \int \frac{-du/2}{\sqrt{u}} \\ &= -\frac{1}{2}\cdot 2\sqrt{u} \\ &= -\sqrt{1-t^2} \end{aligned}

Applying this to both integrals,

1 x 2 1 y 2 = c 1

Multiplying through by 1 and renaming the constant c = c 1 ,

1 x 2 + 1 y 2 = c

is the general solution.

Note the domain restriction inherited from the square roots: the solution lives where | x | 1 and | y | 1 . Also, the division at the start required 1 y 2 0 , so check y = ± 1 separately. Substituting the constant function y = 1 into the original equation gives x 0 d x + 1 1 x 2 0 = 0 , so y = 1 and y = 1 do satisfy the equation. Neither comes from the general solution for any constant c , since 1 x 2 + 0 = c cannot hold with c constant. They are singular solutions.

Solve \displaystyle{y' = \frac{x^3 y - y}{y^4 - y^2 + 1}} subject to y ( 0 ) = 1 .

Solution

Factor y out of the numerator. The differential equation can be rewritten as

( y 4 y 2 + 1 ) d y d x = ( x 3 1 ) y

Dividing by y , which is legitimate near the initial point since y ( 0 ) = 1 0 ,

( y 3 y + 1 y ) d y = ( x 3 1 ) d x

Note how dividing y 4 y 2 + 1 by y term by term produced y 3 y + 1 y , and the last term is what will generate a logarithm.

Integration gives

y 4 4 y 2 2 + ln | y | = x 4 4 x + c

Impose the initial condition y = 1 at x = 0 . The left side becomes 1 4 1 2 + 0 = 1 4 and the right side becomes c , so c = 1 4 .

Multiplying through by 4 to clear the fractions,

y 4 2 y 2 + 4 ln | y | = x 4 4 x 1

is the implicit solution of this initial value problem. There is no way to solve this for y in closed form, and none is needed.

Solve x d y d x y = 3 x 3 y .

Solution

Multiplying both sides by d x ,

x d y = ( y + 3 x 3 y ) d x

or, factoring y on the right,

x d y = y ( 1 + 3 x 3 ) d x

Dividing both sides by x y separates the variables:

d y y = ( 1 x + 3 x 2 ) d x

Note that 1 + 3 x 3 x = 1 x + 3 x 2 ; splitting the fraction this way is what makes the right side integrable term by term.

Thus

d y y = ( 1 x + 3 x 2 ) d x + c ln | y | = ln | x | + x 3 + c

Move the logarithms together using ln | y | ln | x | = ln | y x | :

ln | y x | = x 3 + c

Exponentiating both sides,

| y x | = e x 3 + c = e c e x 3 y x = ± e c e x 3

Finally

y = C x e x 3

where C = ± e c is a constant. You can verify by substitution that y = C x e x 3 satisfies the differential equation.

Two remarks. First, absorbing ± e c into a single constant C is standard practice; since c ranges over all reals, ± e c ranges over all nonzero reals. Second, dividing by y discarded the solution y = 0 , which does satisfy the original equation. Allowing C = 0 in the final formula restores it, so y = C x e x 3 with C any real number is the complete answer.

Find the general solution of

d y d x = 2 x 5 x 3 1 + y 3

and describe several integral curves. Determine the solution that passes through ( 0 , 1 ) and find its interval of validity.

Solution

The equation is separable. It can be rewritten as

( 1 + y 3 ) d y = ( 2 x 5 x 3 ) d x

Integrating both sides,

y + y 4 4 = x 2 5 4 x 4 + c

where the two constants of integration have been combined into a single c .

Multiplying both sides by 4 to clear the fractions and rearranging,

4y + y^4 - 4x^2 + 5x^4 = C \tag{*}

where C = 4 c is another constant. Any differentiable function y = ϕ ( x ) satisfying (*) is a solution of the differential equation.

To determine the particular solution passing through ( 0 , 1 ) , substitute x = 0 and y = 1 into (*):

4 ( 1 ) + 1 0 + 0 = 5 ,

so C = 5 . Hence the solution through ( 0 , 1 ) is given implicitly by

4y + y^4 - 4x^2 + 5x^4 = 5 \tag{**}

Interval of validity. The interval extends left and right from the point ( 0 , 1 ) to wherever the solution stops being differentiable. At such a point the tangent line becomes vertical, that is, y' \to \pm\infty. From the differential equation, y' \to \pm\infty happens exactly when the denominator vanishes:

1 + y 3 = 0 y = 1 .

So find where the curve () reaches the height y = 1 . Substituting y = 1 into (),

4 + 1 4 x 2 + 5 x 4 = 5 5 x 4 4 x 2 8 = 0 .

This is a quartic, but it is quadratic in u = x 2 :

5 u 2 4 u 8 = 0 u = 4 ± 16 + 160 10 = 4 ± 176 10 = 2 5 ( 1 ± 11 ) .

Because u = x 2 0 , the root 2 5 ( 1 11 ) < 0 is rejected. Hence the values of x corresponding to y = 1 are

x = ± 2 5 ( 1 + 11 ) ± 1.3 .

The interval of validity of the solution through ( 0 , 1 ) is therefore approximately 1.3 < x < 1.3 .

Contour plot of the family 4y + y^4 - 4x^2 + 5x^4 = C for several values of C, with the curve for C = 5 drawn as a heavy red line.
The integral curves for different values of C , with the value of C written on each curve. The solution passing through ( 0 , 1 ) , the case C = 5 , is shown as the heavy red curve. Its endpoints at x ± 1.3 are exactly where it reaches the level y = 1 and the tangent turns vertical.

Exercises

Solve d y d x = x 2 y with y ( 0 ) = 2 .

Solution

Separating, y d y = x 2 d x . Integrating,

y 2 2 = x 3 3 + c .

At x = 0 , y = 2 gives 2 = c . Multiplying by 2 ,

y 2 = 2 x 3 3 + 4 .

Since y ( 0 ) = 2 > 0 , take the positive square root:

y = 2 x 3 3 + 4 .

The solution is valid while the radicand is positive, that is, for x > 6 3 .

Solve y' = y^2 - 4 and identify any equilibrium solutions that the separation step loses.

Solution

The right side factors as ( y 2 ) ( y + 2 ) , so y = 2 and y = 2 are equilibrium solutions. Dividing by y 2 4 in the next step will discard both, so note them now.

For y ± 2 , separate and use partial fractions:

d y ( y 2 ) ( y + 2 ) = d x , 1 ( y 2 ) ( y + 2 ) = 1 4 ( 1 y 2 1 y + 2 ) .

Integrating,

1 4 ln | y 2 y + 2 | = x + c y 2 y + 2 = A e 4 x

where A = ± e 4 c . Solving for y ,

y = 2 ( 1 + A e 4 x ) 1 A e 4 x .

Taking A = 0 recovers y = 2 , but no value of A gives y = 2 , so that equilibrium must be stated separately.

Solve d y d x = e x y .

Solution

Write e x y = e x e y , so the equation separates as

e y d y = e x d x .

Integrating, e y = e x + c , so

y = ln ( e x + c ) .

For c 0 this is defined for all x ; for c < 0 it requires x > ln ( c ) .

Frequently Asked Questions

How do I tell whether an equation is separable?

Put it in standard form and ask whether the right side factors as F ( x ) G ( y ) , a function of x times a function of y . Products and quotients usually separate; sums usually do not. The exception worth remembering is the exponential, since e x + y = e x e y turns a sum into a product.


Why is there only one arbitrary constant when I integrated twice?

Both integrations do produce constants, say c 1 on the left and c 2 on the right, but only their difference matters. Writing c = c 2 c 1 collapses them into one. This is the right count: a first-order equation must have a one-parameter family of solutions.


What solutions can separation lose?

Any constant solution y = k with G ( k ) = 0 , because separating required dividing by G ( y ) . These are the equilibrium solutions. Before dividing, note the roots of G ; after solving, check whether the general formula happens to recover them for some value of the constant. If not, list them separately.


Should I solve the implicit answer for y ?

Only if it comes out cleanly. An answer like y 4 2 y 2 + 4 ln | y | = x 4 4 x 1 simply cannot be solved for y , and forcing it would be a waste of effort. The implicit relation defines the solution curves perfectly well, and an initial condition still picks out a single one.


How do I find the interval of validity?

Start at the initial point and move outward until the solution stops being differentiable. Two things typically end it: the denominator of y' = f(x,y) vanishing, which makes the tangent vertical, or the solution formula becoming undefined, as when a radicand goes negative or a logarithm's argument reaches zero. Solve for where that first happens on each side of the initial point.


Is it legitimate to treat d y and d x as separate quantities?

The manipulation is a shorthand that can be justified rigorously. Writing g ( y ) d y d x = f ( x ) and integrating both sides with respect to x , the chain rule turns the left side into g ( y ) d y . So separating the differentials is a legitimate bookkeeping device for the substitution rule, not a sleight of hand.