Separable Differential Equations

Each variable on its own side, then integrate.

A rate that depends on the quantity

An equation that contains a derivative is a differential equation, and a solution of one is a function. dy/dx = ky says that y changes at a rate proportional to y itself. With k > 0, the larger y is, the faster it grows: that is growth. With k < 0, y shrinks, and shrinks more slowly as it gets smaller: that is decay.

For dy/dx = 0.5y, the gradient at height 1 is 0.5, at height 2 it is 1, and at height 3 it is 1.5. The gradient depends only on the height, so a solution steepens as it climbs.

xy

Short segments at whole-number points, each drawn at the gradient dy/dx = 0.5y: 0.5 along the line y = 1, 1 along y = 2, 1.5 along y = 3, and flat along the x-axis. The gold curve y = e^(0.5x) passes through (0, 1) and runs along every segment it meets; at (2, e) its gradient is e/2 ≈ 1.36.

Separate, then integrate

Treat dy and dx as the two sides of a rate, and move every y to the side with dy and every x to the side with dx. Dividing dy/dx = ky by y gives (1/y) dy = k dx.

Now each side is in one letter, so each can be integrated in its own letter: ∫ (1/y) dy = ∫ k dx, which gives ln|y| = kx + c.

Each integral has its own constant, but two constants on opposite sides combine into one. Write a single c, on the side with x.

Undo the log

Take e to the power of both sides: |y| = e^(kx + c). A power of a sum splits into a product, so |y| = e^c · e^(kx). The number e^c is a constant like any other, so call it A, and drop the absolute value by letting A be negative as well as positive: y = Ae^(kx).

A = 0 gives y = 0, which also solves dy/dx = ky, since both sides are 0. Dividing by y at the start had quietly set that solution aside.

Check: Ae^(kx) differentiates to k × Ae^(kx), which is k times y.

A starting value fixes A

The equation alone has a whole family of solutions, one for each A. A known value, called an initial condition, picks one of them. Solve dy/dx = 2y with y = 6 when x = 0. Separating and integrating gives y = Ae^(2x). At x = 0, e^0 = 1, so 6 = A, and the solution is y = 6e^(2x).

Check it at a point. At x = 0.5, y = 6e ≈ 16.31. A difference quotient across a tiny step gives the derivative there as 32.62, which is 2 × 16.31, as the equation says it must be.

In the same way, P = 100 at t = 0 with dP/dt = (ln 2)P gives P = 100e^((ln 2)t) = 100 × 2ᵗ. It doubles each unit of time, and reaches 800 at t = 3.

Other separable equations

Solve dy/dx = xy with y = 1 when x = 0. Separating gives (1/y) dy = x dx, and integrating gives ln y = x²/2 + c. At x = 0, ln 1 = 0, so c = 0, and the solution is y = e^(x²/2). At x = 1 it is e^(0.5) ≈ 1.649, and the gradient there, measured by a difference quotient, is also 1.649, which is x times y with x = 1.

Solve dy/dx = x/y with y = 3 when x = 0. Separating gives y dy = x dx, and integrating gives y²/2 = x²/2 + c. At x = 0, 9/2 = c. Multiplying by 2, y² = x² + 9, and since y is positive at the start, y = √(x² + 9). At x = 4, y = 5, and the equation asks for a gradient of 4/5 = 0.8 there, which the curve has.

Use the condition after integrating, not before: the constant only exists once both sides have been integrated.

xy

The slope field of dy/dx = xy: flat along the y-axis, gradient 1 at (1, 1), 2 at (1, 2) and at (2, 1), and −1 at (−1, 1). The gold curve y = e^(x²/2) is the solution through (0, 1); the dashed curve y = 2e^(x²/2) is the one through (0, 2). Both run along the segments.

Decay

With a negative k the same steps give decay. dy/dx = −0.5y with y = 8 at x = 0 gives y = 8e^(−0.5x). Each 2 ln 2 ≈ 1.386 units of x halves y, whatever y is: at x = 2, y = 8e^(−1) ≈ 2.943, and the gradient there is −0.5 × 2.943 ≈ −1.472.

The usual mistakes

Integrating without separating. dy/dx = ky does not integrate to y = kx + c: that solves dy/dx = k, a constant rate, and ignores the y on the right.

Adding the constant after exponentiating. From ln y = kx + c the next line is y = e^(kx + c) = Ae^(kx), not e^(kx) + c.

Leaving A at 1. With y = 6 at x = 0, the solution of dy/dx = 2y is 6e^(2x), not e^(2x).

Swapping the rate and the starting value. dy/dx = 2y with y = 6 at x = 0 is 6e^(2x), not 2e^(6x): the rate goes in the exponent and the starting value in front.

A water butt emptying

In the application below, the depth of water falls at a rate proportional to its square root. Separating and integrating gives √h as a straight line in time, and two readings fix its two constants.

Worked example: A Water Butt Emptying Through Its Tap: A Sentence About a Rate Turned Into an Equation and Solved

Question A water butt with straight sides empties through a tap at its foot. Torricelli's law says that the depth of water falls at a rate proportional to the square root of the depth. The depth is 64 centimeters when the tap is opened, and 49 centimeters five minutes later. (a) Find the depth after 20 minutes. (b) Find when the butt is empty.

  1. 1.Let h be the depth in centimeters and n the number of minutes since the tap was opened. The depth falls at a rate proportional to √h, so dhdn = −k√h with k > 0, the minus sign because the depth is falling.

    0164964052040n, minutesdepth h, cm0478052040n, minutesthe root of hdh/dn = −k√h, the minus because the depth falls
    0164964052040n, minutesdepth h, cm0478052040n, minutesthe root of hdh/dn = −k√h, the minus because the depth falls
    The depth falls at a rate proportional to √h, so dhdn = −k√h, the minus sign because it falls.
  2. 2.Separate the variables and integrate: ∫ h−12dh = −k∫ dn, so 2√h = −kn + C, which is tidier written as √h = A − k2n.

    0164964052040n, minutesdepth h, cm0478052040n, minutesthe root of hdh/dn = −k√h, the minus because the depth fallsseparate:√h = A − 0.5kn, a straight line
    0164964052040n, minutesdepth h, cm0478052040n, minutesthe root of hdh/dn = −k√h, the minus because the depth fallsseparate:√h = A − 0.5kn, a straight line
    Separating gives 2√h = −kn + C, so √h is a straight line in n: that is the right thing to plot.
  3. 3.At n = 0 the depth is 64, so √64 = 8 = A. At n = 5 the depth is 49, so 7 = 8 − 5k2, giving k2 = 0.2. Hence √h = 8 − 0.2n, that is h = (8 − 0.2n)2.

    0164964052040n, minutesdepth h, cm0478052040n, minutesthe root of ha straight linedh/dn = −k√h, the minus because the depth fallsseparate:√h = A − 0.5kn, a straight lineA = 8, and 7 = 8 − 2.5k, so√h = 8 − 0.2n
    0164964052040n, minutesdepth h, cm0478052040n, minutesthe root of ha straight linedh/dn = −k√h, the minus because the depth fallsseparate:√h = A − 0.5kn, a straight lineA = 8, and 7 = 8 − 2.5k, so√h = 8 − 0.2n
    At n = 0, √h = 8; at n = 5, √h = 7. So the line is √h = 8 − 0.2n and h = (8 − 0.2n)2.
  4. 4.(a) At n = 20, √h = 8 − 4 = 4, so the depth is h = 42 = 16 centimeters.

    0164964052040n, minutesdepth h, cm0478052040n, minutesthe root of ha straight line16 cm at 20 mindh/dn = −k√h, the minus because the depth fallsseparate:√h = A − 0.5kn, a straight lineA = 8, and 7 = 8 − 2.5k, so√h = 8 − 0.2n(a) at n = 20,√h = 4, so h = 16 cm
    0164964052040n, minutesdepth h, cm0478052040n, minutesthe root of ha straight line16 cm at 20 mindh/dn = −k√h, the minus because the depth fallsseparate:√h = A − 0.5kn, a straight lineA = 8, and 7 = 8 − 2.5k, so√h = 8 − 0.2n(a) at n = 20,√h = 4, so h = 16 cm
    (a) At n = 20, √h = 8 − 4 = 4, so the depth is 42 = 16 centimeters.
  5. 5.(b) The butt is empty when h = 0, that is when 8 − 0.2n = 0, so n = 40 minutes. Check: the rule gives (8 − 1)2 = 49 at n = 5, as it must, and the emptying slows down as it should, losing 15 centimeters in the first five minutes and only 1 centimeter in the last five.

    0164964052040n, minutesdepth h, cm0478052040n, minutesthe root of ha straight line16 cm at 20 minempty at 40dh/dn = −k√h, the minus because the depth fallsseparate:√h = A − 0.5kn, a straight lineA = 8, and 7 = 8 − 2.5k, so√h = 8 − 0.2n(a) at n = 20,√h = 4, so h = 16 cm(b)√h = 0 at n = 40 minutes
    0164964052040n, minutesdepth h, cm0478052040n, minutesthe root of ha straight line16 cm at 20 minempty at 40dh/dn = −k√h, the minus because the depth fallsseparate:√h = A − 0.5kn, a straight lineA = 8, and 7 = 8 − 2.5k, so√h = 8 − 0.2n(a) at n = 20,√h = 4, so h = 16 cm(b)√h = 0 at n = 40 minutes
    (b) The butt is empty when √h = 0, that is 40 minutes after the tap was opened.

Answer: (a) the depth is 16 centimeters; (b) the butt is empty 40 minutes after the tap was opened

Common mistakes

  • Reading the sentence as ordinary decay, dhdn = −kh, and solving it as h = 64e−kn. The rate is proportional to the square root of the depth, not to the depth, and the difference is not a detail: an exponential never reaches zero, so that model says the butt never empties, while the real one is dry after 40 minutes.
  • Reading √h = 8 − 0.2n at n = 20 as h = 4. The 4 is the square root of the depth, so the depth is 42 = 16 centimeters. Squaring is the last step and it is easy to leave out when the number that comes out looks like an answer.

More using integration problems, worked step by step →

Practice Separable Differential Equations in the app