AP Calculus AB · Lesson 2

Solving by separating variables

Know Know it

An equation is separable when dydx\frac{dy}{dx} is a function of x times a function of y. Move every y to the side with dy and every x to the side with dx, then integrate both sides.

One constant of integration C is enough. Use the initial condition to find C, then solve for y. The answer is a particular solution: one function, not a family.

When a step gives ln⁡∣y∣\ln|y| or y2y^2, the initial condition decides the sign. If y(0)y(0) is negative, the solution takes the negative branch.

The four steps of separation of variables
StepWhat to doQuick check
SeparateGet all of y with dy and all of x with dxNo x is left on the dy side
IntegrateAntidifferentiate both sides and add one constant COnly one C appears
Use the conditionSubstitute the given point to find CC is a number now
Solve for yIsolate y and keep the branch that fits the pointThe curve passes through the point

Trap Put C in before you solve for y

For dydx=2xy\frac{dy}{dx} = 2xy, separating gives ln⁡∣y∣=x2+C\ln|y| = x^2 + C, so y=Aex2y = Ae^{x^2} with A a constant. Writing y=ex2+Cy = e^{x^2} + C instead is wrong: its derivative is 2xex22xe^{x^2}, while 2xy=2xex2+2Cx2xy = 2xe^{x^2} + 2Cx, so the two match for every x only when C=0C = 0. Add C right after integrating, not at the end.

Worked example Easy

Which of these correctly separates the variables in dydx=ycos⁡x\frac{dy}{dx} = y\cos x?

  1. dyy=cos⁡x dx\frac{dy}{y} = \cos x\,dxAnswer
  2. y dy=cos⁡x dxy\,dy = \cos x\,dx
  3. dycos⁡x=y dx\frac{dy}{\cos x} = y\,dx
  4. dy−y=cos⁡x dxdy - y = \cos x\,dx

How to solve it

  1. Multiply both sides by dx: dy=ycos⁡x dxdy = y\cos x\,dx.
  2. Divide both sides by y: dyy=cos⁡x dx\frac{dy}{y} = \cos x\,dx. Now each side holds one variable.

Why each choice is right or wrong

  • A. Correct. Dividing both sides by y and multiplying by dx puts all of y with dy and all of x with dx.
  • B. Incorrect. y dy=cos⁡x dxy\,dy = \cos x\,dx multiplies by y instead of dividing, so it is not the same equation.
  • C. Incorrect. dycos⁡x=y dx\frac{dy}{\cos x} = y\,dx leaves x on the dy side and y on the dx side, so it is not separated.
  • D. Incorrect. dy−y=cos⁡x dxdy - y = \cos x\,dx subtracts y instead of dividing by it, which changes the equation.

Worked example Medium

Which function is the solution of dydx=xy\frac{dy}{dx} = \frac{x}{y} with y(1)=−2y(1) = -2?

  1. y=x2+3y = \sqrt{x^2 + 3}
  2. y=−x2+32y = -\sqrt{x^2 + \frac{3}{2}}
  3. y=−x−1y = -x - 1
  4. y=−x2+3y = -\sqrt{x^2 + 3}Answer

How to solve it

  1. Separate: y dy=x dxy\,dy = x\,dx. Integrate: y22=x22+C\frac{y^2}{2} = \frac{x^2}{2} + C.
  2. Use (1,−2)(1, -2): 2=12+C2 = \frac{1}{2} + C, so C=32C = \frac{3}{2} and y2=x2+3y^2 = x^2 + 3.
  3. Since y(1)=−2y(1) = -2 is negative, y=−x2+3y = -\sqrt{x^2 + 3}.

Why each choice is right or wrong

  • A. Incorrect. y=x2+3y = \sqrt{x^2 + 3} gives y(1)=2y(1) = 2, not −2-2; the initial condition calls for the negative root.
  • B. Incorrect. y=−x2+32y = -\sqrt{x^2 + \frac{3}{2}} forgets to double C when multiplying y22=x22+32\frac{y^2}{2} = \frac{x^2}{2} + \frac{3}{2} by 2, so it misses the point.
  • C. Incorrect. y=−x−1y = -x - 1 passes through (1,−2)(1, -2), but its slope is −1-1 while xy=−12\frac{x}{y} = -\frac{1}{2} there, so it does not solve the equation.
  • D. Correct. Separating gives y22=x22+C\frac{y^2}{2} = \frac{x^2}{2} + C; the point gives C=32C = \frac{3}{2}, so y2=x2+3y^2 = x^2 + 3, and y(1)=−2y(1) = -2 picks the negative root.

Explain Explain it

Task verbs: calculate, justify

Show each step: the separated form, both antiderivatives with C, the value of C from the point, and the final solution. Graders look for the separation and the use of the condition, not just the answer.

To justify that a function solves an equation, substitute it. Find its derivative, rewrite the right side using the function, and show the two sides agree. Then check the initial condition by evaluating at the given input.

Worked example Hard

The function y=f(x)y = f(x) is the solution of dydx=2xy2\frac{dy}{dx} = 2xy^2 with f(0)=1f(0) = 1. What is f(12)f\left(\frac{1}{2}\right)?

  1. 45\frac{4}{5}
  2. 43\frac{4}{3}Answer
  3. −45-\frac{4}{5}
  4. 54\frac{5}{4}

How to solve it

  1. Separate: y−2 dy=2x dxy^{-2}\,dy = 2x\,dx. Integrate: −1y=x2+C-\frac{1}{y} = x^2 + C.
  2. Use f(0)=1f(0) = 1: −1=0+C-1 = 0 + C, so C=−1C = -1 and 1y=1−x2\frac{1}{y} = 1 - x^2.
  3. So f(x)=11−x2f(x) = \frac{1}{1 - x^2} for −1<x<1-1 < x < 1, and f(12)=43f\left(\frac{1}{2}\right) = \frac{4}{3}.

Why each choice is right or wrong

  • A. Incorrect. The value 45\frac{4}{5} comes from 11+x2\frac{1}{1 + x^2}, which loses the minus sign from the antiderivative of y−2y^{-2}.
  • B. Correct. Separating gives −1y=x2+C-\frac{1}{y} = x^2 + C with C=−1C = -1, so f(x)=11−x2f(x) = \frac{1}{1 - x^2} and f(12)=13/4=43f\left(\frac{1}{2}\right) = \frac{1}{3/4} = \frac{4}{3}.
  • C. Incorrect. The value −45-\frac{4}{5} comes from taking C=1C = 1 instead of −1-1, which gives y=−1x2+1y = -\frac{1}{x^2 + 1} and misses f(0)=1f(0) = 1.
  • D. Incorrect. The value 54\frac{5}{4} treats y as the constant 1, giving y=x2+1y = x^2 + 1, which does not solve the equation.

Justify Your turn

Substitute y=5−3e−2xy = 5 - 3e^{-2x} into the differential equation dydx=2(5−y)\frac{dy}{dx} = 2(5 - y) to show that it is a solution. Then show that it passes through the point (0,2)(0, 2).

Write it, then compare. Nothing you type here is saved or graded.

Compare with a model answer

A full answer does this

  • Finds the derivative dydx=6e−2x\frac{dy}{dx} = 6e^{-2x}
  • Shows that the right side 2(5−y)2(5 - y) also equals 6e−2x6e^{-2x}, so the two sides agree
  • Shows that the function gives y=2y = 2 at x=0x = 0

Model answer

The derivative is dydx=−3e−2x⋅(−2)=6e−2x\frac{dy}{dx} = -3e^{-2x} \cdot (-2) = 6e^{-2x}. The right side is 2(5−y)=2(5−(5−3e−2x))=2(3e−2x)=6e−2x2(5 - y) = 2\left(5 - (5 - 3e^{-2x})\right) = 2(3e^{-2x}) = 6e^{-2x}. Both sides equal 6e−2x6e^{-2x}, so the function solves the equation. At x=0x = 0, y=5−3e0=5−3=2y = 5 - 3e^{0} = 5 - 3 = 2, so the curve passes through (0,2)(0, 2).

Apply Apply it

Practice these topics. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.