Lably
Skip to content

Separation of variables

Technique for solving differential equations

  • 8 min read
  • 5 chapters
  • 2 labs on Lably

Learn it on Lably

Ordinary differential equations (ODE)

A differential equation for the unknown f(x) is separable if it can be written in the form

ddxf(x)=g(x)h(f(x))

where g and h are given functions. This is perhaps more transparent when written using y=f(x) as:

dydx=g(x)h(y).

So now as long as h(y) ≠ 0, we can rearrange terms to obtain:

dyh(y)=g(x)dx,

where the two variables x and y have been separated. Note dx (and dy) can be viewed, at a simple level, as just a convenient notation, which provides a handy mnemonic aid for assisting with manipulations. A formal definition of dx as a differential (infinitesimal) is somewhat advanced.

Alternative notation

Those who dislike differentials as separate entities may prefer to write this as

1h(y)dydx=g(x),

but that fails to make it quite as obvious why this is called "separation of variables". Integrating both sides of the equation with respect to x, we have

or equivalently,

∫1h(y)dy=∫g(x)dx

because of the substitution rule for integrals.

If one can evaluate the two integrals, one can find a solution to the differential equation. Observe that this process effectively allows us to treat the derivative dydx as a fraction which can be separated. This allows us to solve separable differential equations more conveniently, as demonstrated in the example below.

(Note that we do not need to use two constants of integration, in equation (A1) as in

∫1h(y)dy+C1=∫g(x)dx+C2,

because a single constant C=C2−C1 is equivalent.)

Example

Population growth is often modeled by the "logistic" differential equation

dPdt=kP(1−PK)

where P is the population with respect to time t, k is the rate of growth, and K is the carrying capacity of the environment. Separation of variables now leads to

∫dPP(1−P/K)=∫kdt

which is readily integrated using partial fractions on the left side yielding

P(t)=K1+Ae−kt

where A is the constant of integration. We can find A in terms of P(0)=P0 at t=0. Noting e0=1 we get

A=K−P0P0.

Generalization of separable ODEs to the nth order

Much like one can speak of a separable first-order ODE, one can speak of a separable second-order, third-order or nth-order ODE. Consider the separable first-order ODE:

dydx=f(y)g(x)

The derivative can alternatively be written the following way to underscore that it is an operator working on the unknown function, y:

dydx=ddx(y)

Thus, when one separates variables for first-order equations, one in fact moves the dx denominator of the operator to the side with the x variable, and the d(y) is left on the side with the y variable. The second-derivative operator, by analogy, breaks down as follows:

d2ydx2=ddx(dydx)=ddx(ddx(y))

The third-, fourth- and nth-derivative operators break down in the same way. Thus, much like a first-order separable ODE is reducible to the form

dydx=f(y)g(x)

a separable second-order ODE is reducible to the form

d2ydx2=f(y′)g(x)

and an nth-order separable ODE is reducible to

dnydxn=f(y(n−1))g(x)

Example

Consider the simple nonlinear second-order differential equation:y″=(y′)2.This equation is an equation only of y'' and y', meaning it is reducible to the general form described above and is, therefore, separable. Since it is a second-order separable equation, collect all x variables on one side and all y' variables on the other to get:d(y′)(y′)2=dx.Now, integrate the right side with respect to x and the left with respect to y':∫d(y′)(y′)2=∫dx.This gives−1y′=x+C1,which simplifies to:y′=−1x+C1.This is now a simple integral problem that gives the final answer:y=C2−ln⁡|x+C1|.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Calculus and analysis