Lesson 5 of 7 · 22 min

Separation of variables

Solve dydx=g(y)\frac{dy}{dx} = g(y) and dydx=f(x)g(y)\frac{dy}{dx} = f(x)g(y) by separating the variables, integrating both sides and using an initial condition, handling ln⁡∣y∣\ln|y| and the arbitrary constant correctly.

What you will be able to do

  • Recognise when a differential equation is separable, dydx=f(x)g(y)\frac{dy}{dx} = f(x)g(y).
  • Separate the variables, ∫1g(y) dy=∫f(x) dx\int \frac{1}{g(y)}\,dy = \int f(x)\,dx, and integrate both sides with one arbitrary constant.
  • Rearrange to make yy the subject where possible, and find particular solutions from initial conditions.

For dydx=f(x)\frac{dy}{dx} = f(x) you just integrate. But dydx=2y\frac{dy}{dx} = 2y has yy on the right, and integrating 2y2y with respect to xx makes no sense when you don't know what yy is.

The trick is to gather everything involving yy on the left, with dydy, and everything involving xx on the right, with dxdx. Then each side can be integrated with respect to its own variable.

Interactive

The family of solutions of dy/dx = xy

Every curve is y=Aex22y = Ae^{\frac{x^2}{2}} for some constant AA. The row y=0y = 0 is flat: A=0A = 0 gives the equilibrium solution.

Key idea

Separation of variables

If dydx=f(x)g(y)\frac{dy}{dx} = f(x)g(y) and g(y)≠0g(y) \neq 0, then

∫1g(y) dy=∫f(x) dx\int \frac{1}{g(y)}\,dy = \int f(x)\,dx

Integrate both sides, writing one arbitrary constant (on the xx side), then rearrange. The case dydx=g(y)\frac{dy}{dx} = g(y) is the same with f(x)=1f(x) = 1, so the right-hand side is ∫1 dx=x+c\int 1\,dx = x + c.

Why separation works

Divide by g(y)g(y): 1g(y)dydx=f(x)\frac{1}{g(y)}\frac{dy}{dx} = f(x). Let H(y)H(y) be an antiderivative of 1g(y)\frac{1}{g(y)}. By the chain rule,

ddx(H(y))=1g(y)dydx=f(x)\frac{d}{dx}\big(H(y)\big) = \frac{1}{g(y)}\frac{dy}{dx} = f(x)

So H(y)H(y) is an antiderivative of f(x)f(x), which is exactly ∫1g(y) dy=∫f(x) dx\int \frac{1}{g(y)}\,dy = \int f(x)\,dx. "Multiplying by dxdx" is a shorthand for this argument, not a real operation on dxdx.

Which statement correctly separates the variables in dydx=x2y\frac{dy}{dx} = \frac{x^2}{y}?

Choose one answer

Worked example

Solve dydx=2y−6\frac{dy}{dx} = 2y - 6 with y(0)=5y(0) = 5

  • Simple familiar
  • Technology free

Solve the differential equation dydx=2y−6\frac{dy}{dx} = 2y - 6, given that y(0)=5y(0) = 5. Express yy in terms of xx.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Divide by g(y)g(y) and integrate both sides.

  2. Exponentiate, absorbing ±ec\pm e^{c} into one constant AA.

  3. Use the initial condition, then check by substitution.

Watch out for

  • Forgetting the 12\frac{1}{2} from ∫12y−6 dy\int \frac{1}{2y - 6}\,dy.

  • Writing y=3+e2x+cy = 3 + e^{2x} + c: the constant multiplies the exponential.

Common mistake

Exponentiate the whole right-hand side

From ln⁡∣y∣=4x+c\ln|y| = 4x + c,

∣y∣=e4x+c=ece4x|y| = e^{4x + c} = e^c e^{4x}

so y=Ae4xy = Ae^{4x}, where A=±ecA = \pm e^c is any constant (including 00, the equilibrium). It is not y=e4x+cy = e^{4x} + c: an added constant inside the exponent becomes a multiplied constant outside.

Determine the general solution of dydx=4y\frac{dy}{dx} = 4y. Use AA for the arbitrary constant.

y =
Reads asYour answer shows here as maths.

Worked example

Solve dydx=2xy2\frac{dy}{dx} = 2xy^2 with y(0)=1y(0) = 1

  • Complex familiar
  • Technology free

Determine the particular solution of dydx=2xy2\frac{dy}{dx} = 2xy^2 that satisfies y(0)=1y(0) = 1, and state the largest interval containing x=0x = 0 on which it is defined.

6 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Separate to ∫1g(y) dy=∫f(x) dx\int \frac{1}{g(y)}\,dy = \int f(x)\,dx.

  2. Integrate, find the constant from the initial condition, then rearrange.

  3. Note where the solution breaks down.

Watch out for

  • Integrating y−2y^{-2} to y−11\frac{y^{-1}}{1}: the new power is −1-1, so divide by −1-1.

  • Writing y=−1x2+cy = -\frac{1}{x^2} + c: rearrange the whole equation, constant included.

Solve dydx=ycos⁡(x)\frac{dy}{dx} = y\cos(x), given that y(0)=2y(0) = 2.

y =
Reads asYour answer shows here as maths.

Sometimes you cannot, or need not, make yy the subject. Leaving the solution in implicit form, such as y2=25−x2y^2 = 25 - x^2, is fine unless the question asks for yy explicitly. If you do take a square root, use the initial condition to choose the sign.

Worked example

Solve dydx=−xy\frac{dy}{dx} = -\frac{x}{y} with y(3)=4y(3) = 4

  • Complex familiar
  • Technology free

(a) Solve dydx=−xy\frac{dy}{dx} = -\frac{x}{y}, given y=4y = 4 when x=3x = 3. Give yy explicitly in terms of xx.

(b) Describe the solution curve.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Separate and integrate both sides.

  2. Use the initial condition to find the constant in the implicit solution.

  3. Take square roots, choosing the sign that matches the initial condition.

Watch out for

  • Giving y=±25−x2y = \pm\sqrt{25 - x^2}: a particular solution is one function, and y(3)=4y(3) = 4 picks the positive root.

Exam tip

Set out each line

Markers look for: the separated integrals, both antiderivatives with a constant, the substitution that finds the constant, and the final answer in the form asked for. Keep the modulus in ln⁡∣y∣\ln|y| until the initial condition tells you the sign of yy.

Summary

  • Separable means dydx=f(x)g(y)\frac{dy}{dx} = f(x)g(y): a product of an xx part and a yy part.

  • Separate to ∫1g(y) dy=∫f(x) dx\int \frac{1}{g(y)}\,dy = \int f(x)\,dx, integrate both sides and add one constant.

  • ln⁡∣y∣=F(x)+c\ln|y| = F(x) + c gives y=AeF(x)y = Ae^{F(x)}, with the constant multiplying.

  • Use the initial condition to find the constant, and to choose a sign after a square root.

  • Dividing by g(y)g(y) can lose constant solutions where g(y)=0g(y) = 0: check them separately.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 5 of 70% read

Save your progress with a free account