impera Open Impera

AP Calculus AB · Differential equations

Separation of variables

1Separable equations

A differential equation is separable if it can be written as

$$\frac{dy}{dx} = g(x)\,h(y)$$

so the $x$-part and the $y$-part are multiplied. Then we can move all the $y$'s to one side and all the $x$'s to the other.

  • $\frac{dy}{dx} = xy$ is separable: $g(x) = x$, $h(y) = y$.
  • $\frac{dy}{dx} = \frac{x^2}{y}$ is separable.
  • $\frac{dy}{dx} = x + y$ is not separable (a sum, not a product).
Check yourself

Which differential equation is separable?

  • dy/dx = x + y

  • dy/dx = x − y²

  • dy/dx = x²y³

  • dy/dx = sin(x + y)

Show the answer

dy/dx = x²y³

It is a product of an x-part and a y-part.

2The method

  1. Separate: get all $y$ terms with $dy$ on one side, all $x$ terms with $dx$ on the other.
  2. Integrate both sides. Put a single constant $C$ on the $x$ side.
  3. Use the initial condition to find $C$ (do this as soon as you can).
  4. Solve for $y$ explicitly, if asked.
Worked example

$\frac{dy}{dx} = \frac{x}{y}$, with $y(0) = 3$

  1. Separate: $y\,dy = x\,dx$.
  2. Integrate: $\frac{y^2}{2} = \frac{x^2}{2} + C$.
  3. Initial condition: $\frac{9}{2} = 0 + C$, so $C = \frac{9}{2}$.
  4. $y^2 = x^2 + 9$. Since $y(0) = 3 > 0$, take the positive root: $y = \sqrt{x^2 + 9}$.
Check yourself

After separating dy/dx = 2x/y², you get:

  • y² dy = 2x dx

  • dy = 2xy² dx

  • y² dx = 2x dy

  • dy/y² = 2x dx

Show the answer

y² dy = 2x dx

Multiply both sides by y² dx.

3Exponential solutions

Worked example

$\frac{dy}{dx} = 2xy$, with $y(0) = 5$

  1. Separate: $\frac{1}{y}\,dy = 2x\,dx$.
  2. Integrate: $\ln|y| = x^2 + C$.
  3. Initial condition: $\ln 5 = 0 + C$, so $C = \ln 5$.
  4. $|y| = e^{x^2 + \ln 5} = 5e^{x^2}$. Since $y(0) = 5 > 0$, $y = 5e^{x^2}$.

Note how $e^{x^2 + C} = e^C \cdot e^{x^2}$: the constant becomes a multiplier.

Check yourself

Integrating (1/y) dy gives:

  • y

  • 1/y²

  • −1/y²

  • ln|y|

Show the answer

ln|y|

The log rule.

4Common mistakes

  • Forgetting $C$: without it, you cannot fit the initial condition. On the AP exam, a solution without a constant of integration earns very little credit.
  • Adding $C$ too late: write $C$ when you integrate, before solving for $y$. Adding "+C" after exponentiating gives the wrong family.
  • Not separating fully: $\frac{dy}{dx} = x(y + 1)$ separates as $\frac{dy}{y + 1} = x\,dx$, not $dy = x(y + 1)\,dx$.
  • Choosing the wrong sign after a square root: use the initial condition to decide.

Add the constant when you integrate, then use the initial condition before solving for y

Check yourself

When should the constant C be added?

  • Immediately when integrating, before solving for y

  • After substituting the initial condition

  • Only if the problem asks for it

  • After solving for y

Show the answer

Immediately when integrating, before solving for y

Adding it later gives the wrong family.

5Domain and checking

After solving, check that your solution satisfies the initial condition and makes sense on its domain.

Worked example

$\frac{dy}{dx} = y^2$, with $y(0) = 1$

  1. Separate: $y^{-2}\,dy = dx$.
  2. Integrate: $-\frac{1}{y} = x + C$.
  3. $y(0) = 1$: $-1 = C$.
  4. $-\frac{1}{y} = x - 1$, so $y = \frac{1}{1 - x}$.
  5. The solution is valid only for $x < 1$ (the interval containing $x = 0$), because it blows up at $x = 1$.
Check yourself

For y = 1/(1 − x) with y(0) = 1, the solution is valid on:

  • x < 1

  • x > 1

  • x > 0

  • All real numbers

Show the answer

x < 1

The interval containing the initial x-value.

6Going deeper: the full procedure, with the steps that earn each mark

A differential equation is separable if it can be written $\frac{dy}{dx} = g(x)\,h(y)$.

Procedure

  1. Separate: all y terms with dy on one side; all x terms with dx on the other.
  2. Integrate both sides.
  3. Add + C (on one side) immediately.
  4. Use the initial condition to find C.
  5. Solve for y.
  6. Choose the branch (the sign) that fits the initial condition, and note the domain.

On the exam, no separation means almost no credit, and a missing constant of integration loses most of the remaining marks.

Worked example

$\frac{dy}{dx} = xy$, y(0) = 2.

  1. $\frac{dy}{y} = x\,dx$.
  2. $\ln|y| = \frac{x^2}{2} + C$.
  3. At (0, 2): ln 2 = C.
  4. $|y| = e^{x^2/2 + \ln 2} = 2e^{x^2/2}$.
  5. y is positive at the initial point: $y = 2e^{x^2/2}$.

Worked example (choosing the sign): $\frac{dy}{dx} = \frac{x}{y}$, y(0) = −3.

  1. y dy = x dx.
  2. $\frac{y^2}{2} = \frac{x^2}{2} + C$.
  3. At (0, −3): C = $\frac{9}{2}$.
  4. $y^2 = x^2 + 9$.
  5. The initial value is negative: $y = -\sqrt{x^2 + 9}$.

Worked example (shifted): $\frac{dy}{dx} = 2x(y - 1)$, y(0) = 3.

  1. $\frac{dy}{y - 1} = 2x\,dx$.
  2. $\ln|y - 1| = x^2 + C$.
  3. C = ln 2.
  4. $y - 1 = 2e^{x^2}$, so $y = 1 + 2e^{x^2}$.

Worked example (a power of y): $\frac{dy}{dx} = y^2$, y(0) = 1.

  1. $y^{-2}\,dy = dx$.
  2. $-\frac{1}{y} = x + C$; C = −1.
  3. $y = \frac{1}{1 - x}$, valid for x < 1 (the solution blows up at x = 1).

Exponential growth and decay: $\frac{dy}{dt} = ky$ gives $y = y_0e^{kt}$.

Worked example (Newton's law of cooling): $\frac{dT}{dt} = -0.1(T - 20)$, T(0) = 90.

  1. $\frac{dT}{T - 20} = -0.1\,dt$.
  2. $\ln|T - 20| = -0.1t + C$; C = ln 70.
  3. $T = 20 + 70e^{-0.1t}$.
  4. As t → ∞, T → 20, the room temperature.

Particular and general solutions: the general solution contains C; the particular solution satisfies the initial condition.

Checking: differentiate the answer and confirm it satisfies both the equation and the initial condition.

Not every equation separates: $\frac{dy}{dx} = x + y$ cannot be written as g(x)h(y).

Domain of the solution: the largest interval containing the initial x-value on which the solution is defined and differentiable.

Common mistakes

  • Not separating (leaving y on the x side).
  • Forgetting + C, or adding it after solving for y (so that it is in the wrong place).
  • Writing $e^{x^2/2 + C}$ as $e^{x^2/2} + C$.
  • Choosing the wrong sign for a square root.
  • Dropping the absolute value too early without checking the sign.
  • Integrating $\frac{1}{y^2}$ as ln(y²).
Check yourself

Solve dy/dx = 3y with y(0) = 5.

  • y = 3e^(5x)

  • y = 5e^(3x)

  • y = 5 + e^(3x)

  • y = e^(3x) + 5x

Show the answer

y = 5e^(3x)

Separating gives ln|y| = 3x + C, and the initial condition makes the constant factor 5.

7For top marks

AP scoring for separation of variables usually gives points for:

  1. Separating the variables correctly.
  2. Antiderivatives of both sides.
  3. The constant of integration and using the initial condition.
  4. Solving for $y$.

Show each step on its own line.

Example

"$\frac{dy}{y - 2} = 3\,dx$; $\ln|y - 2| = 3x + C$; with $y(0) = 5$, $C = \ln 3$; so $y = 2 + 3e^{3x}$."

Check yourself

dy/dx = 3(y − 2) and y(0) = 5. Then y =

  • 5e^(3x)

  • 3e^(3x)

  • 2 + 5e^(3x)

  • 2 + 3e^(3x)

Show the answer

2 + 3e^(3x)

|y − 2| = 3e^(3x), and y − 2 > 0.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera