Separation of Variables

Separation of variables is a method for solving a differential equation. I'll illustrate with some examples.

Example. Solve $\der y x = 2xy$ .

"Solve" usually means to find y in terms of x. In general, I'll be satisfied if I can eliminate the derivative by integration.

First, I rearrange the equation to get the x's on one side and the y's on the other (separation):

$$\dfrac{dy}{y} = 2x\,dx.$$

Next, I integrate both sides:

$$\int \dfrac{dy}{y} = \int 2x\,dx, \quad \ln |y| = x^2 + C.$$

I only need an arbitrary constant on one side of the equation. Finally, I solve for y in terms of x, if possible:

$$e^{\ln |y|} = e^{x^2+C}, \quad |y| = e^Ce^{x^2}.$$

Here's a convenient trick which I'll use in these situations. Think of $|y|$ as $\pm y$ . Move the $\pm$ to the other side:

$$y = \mp e^Ce^{x^2}.$$

Now define $C_0 = \mp e^C$ :

$$y = C_0 e^{x^2}.$$

The last step makes the equation nicer, and it's easier to solve for the arbitrary constant when you have an initial value problem.

Example. Solve $\der y x = \dfrac{x}{y} + \dfrac{1}{y}$ , where $y(2) = 4$ .


$$\der y x = \dfrac{1}{y}(x + 1), \quad y\,dy = (x + 1)\,dx.$$


$$\int y\,dy = \int (x + 1)\,dx, \quad \dfrac{1}{2}y^2 = \dfrac{1}{2}x^2 + x + C.$$

In this case, solving would produce plus and minus square roots, so I'll leave the equation as is.

Plug in the initial condition: When $x =
   2$ , $y = 4$ :

$$\dfrac{1}{2}4^2 = \dfrac{1}{2}2^2 + 2 + C, \quad 8 = 2 + 2 + C, \quad C = 4.$$

Hence, the solution is

$$\dfrac{1}{2}y^2 = \dfrac{1}{2}x^2 + x + 4.\quad\halmos$$

Contact information

Bruce Ikenaga's Home Page

Copyright 2005 by Bruce Ikenaga