AP Calculus AB · Topic 7.6 · Reading guide, about 4 min

Separating variables to find a family of solutions

Solve separable differential equations: move y and x to opposite sides, integrate once, and solve for y.

In one minute

Separation of variables is the main method for solving a differential equation by hand. When the right side is a product of a function of x and a function of y, you can move all the y terms to one side with dydy and all the x terms to the other with dxdx, then integrate each side.

The result is a family of solutions with one arbitrary constant. The method is short but has several places to slip, so learn the steps in order and respect each one.

Key terms

Separable equation
A differential equation that can be written dydx=g(x)h(y)\frac{dy}{dx}=g(x)h(y), a product of an x-only factor and a y-only factor.
Separating
Rewriting as 1h(y) dy=g(x) dx\frac{1}{h(y)}\,dy=g(x)\,dx so each variable sits on its own side with its own differential.
Integrate both sides
Take an antiderivative of each side with respect to its own variable.
Constant of integration
The single constant C. Two constants, one from each side, always combine into one.
General solution
The family of all solutions, with C unspecified, ideally written as y equals something.
Explicit solution
A solution written as y equals an expression in x.
Implicit solution
A relationship between x and y, such as x2+y2=Cx^2+y^2=C, where y is not isolated.
Absolute value in ln
The antiderivative of 1y\frac{1}{y} is ln⁡∣y∣\ln|y|, which is valid for negative y as well as positive.

The steps, in order

Step 1: write the equation as dydx=g(x)h(y)\frac{dy}{dx}=g(x)h(y). Step 2: divide by h(y)h(y) and multiply by dxdx so that dyh(y)=g(x) dx\frac{dy}{h(y)}=g(x)\,dx. Step 3: put an integral sign on each side. Step 4: integrate and add exactly one +C+C, normally on the x side. Step 5: solve for y if possible.

Treat dydy and dxdx as pieces you can move. This is an accepted shortcut that is justified by the chain rule: if you differentiate both sides of the integrated equation with respect to x you recover the original equation. That is a built-in check, and you can use it every time.

Separation fails when the variables are mixed by addition. dydx=x+y\frac{dy}{dx}=x+y cannot be written as a product of an x-factor and a y-factor, so this method does not apply. dydx=x+xy\frac{dy}{dx}=x+xy does work, because x+xy=x(1+y)x+xy=x(1+y) is a product.

Which equations separate
EquationSeparable?Reason
dydx=3x2y\frac{dy}{dx}=3x^2yYesg=3x2g=3x^2, h=yh=y
dydx=−xy\frac{dy}{dx}=-\frac{x}{y}Yesg=xg=x, h=−1yh=-\frac{1}{y}
dydx=x+xy\frac{dy}{dx}=x+xyYesFactor to x(1+y)x(1+y)
dydx=x+y\frac{dy}{dx}=x+yNoSum of an x term and a y term with no common factor

Logarithms and the constant

When the y side is ∫dyy\int\frac{dy}{y}, you get ln⁡∣y∣\ln|y|. To solve for y, exponentiate both sides: ∣y∣=e(x-stuff)+C=eCe(x-stuff)|y|=e^{(\text{x-stuff})+C}=e^{C}e^{(\text{x-stuff})}. Since eCe^{C} is just a positive number, and the absolute value allows either sign, you replace ±eC\pm e^{C} by a new constant, usually called A. Then y=Ae(x-stuff)y=Ae^{(\text{x-stuff})}.

Be careful in two ways. First, the constant must be added right after integrating, before you exponentiate, so that it becomes a multiplier. Adding it at the end, as in y=ex3+Cy=e^{x^3}+C, is wrong because that function does not satisfy the equation. Second, A can be any nonzero number, and the constant solution y=0y=0 also works for dydx=3x2y\frac{dy}{dx}=3x^2y, which is covered by allowing A=0A=0.

Sometimes you cannot solve for y neatly, or you do not need to. An implicit answer such as y2=−x2+2Cy^2=-x^2+2C is acceptable when it is correct. If you are asked for an explicit form, solve and note the sign of y from the given context.

Worked example: dy/dx = 3x^2 y

Find the general solution of dydx=3x2y\frac{dy}{dx}=3x^2y.

Step 1. The right side is a product of 3x23x^2 and y, so it separates. Divide by y (assume y≠0y\neq0) and multiply by dxdx: 1y dy=3x2 dx\frac{1}{y}\,dy=3x^2\,dx.

Step 2. Integrate: ∫1y dy=∫3x2 dx\int\frac{1}{y}\,dy=\int3x^2\,dx gives ln⁡∣y∣=x3+C\ln|y|=x^3+C.

Step 3. Exponentiate: ∣y∣=ex3+C=eCex3|y|=e^{x^3+C}=e^{C}e^{x^3}. Write A=±eCA=\pm e^{C} to get y=Aex3y=Ae^{x^3}.

Step 4. Check by differentiating: dydx=Aex3⋅3x2=3x2⋅y\frac{dy}{dx}=Ae^{x^3}\cdot3x^2=3x^2\cdot y. It matches. The constant solution y=0y=0 is included when A=0A=0.

For a second example, take dydx=−xy\frac{dy}{dx}=-\frac{x}{y}. Separate to y dy=−x dxy\,dy=-x\,dx, then integrate: y22=−x22+C\frac{y^2}{2}=-\frac{x^2}{2}+C. Multiply by 2 and move terms: x2+y2=2Cx^2+y^2=2C, which describes circles centered at the origin. Check by implicit differentiation: 2x+2ydydx=02x+2y\frac{dy}{dx}=0, so dydx=−xy\frac{dy}{dx}=-\frac{x}{y}.

How it connects

  • Back to 6.8 and 6.9: antiderivatives and u-substitution are the tools you use to integrate each side.
  • Back to 7.2: the answer here is the general solution you learned to verify.
  • Forward to 7.7: an initial condition turns this family into one particular solution.
  • Forward to 7.8: separating dydt=ky\frac{dy}{dt}=ky gives exponential growth and decay.

Common mistakes

  • Adding C at the wrong time. Add one +C+C right after integrating. Putting it on after exponentiating gives an incorrect solution.
  • Keeping two constants. One on each side is a pair of arbitrary numbers that combine into a single C.
  • Separating a sum. If the right side is a sum such as x+yx+y, the method does not apply.
  • Dropping the absolute value. ∫dyy=ln⁡∣y∣+C\int\frac{dy}{y}=\ln|y|+C, not ln⁡y\ln y.

How it shows up on the exam

  • A free-response part says to find the general or particular solution of a given equation using separation of variables, with all steps shown.
  • A multiple-choice item gives an equation and asks for the family of solutions, so you separate and integrate by hand or check the options.
  • Work is scored on the separation, the integration of both sides, and the constant, so show each step.

Check yourself

  1. Can dydx=xy2\frac{dy}{dx}=\frac{x}{y^2} be separated, and what does it become?
  2. Why does ∫dyy=ln⁡∣y∣+C\int\frac{dy}{y}=\ln|y|+C need the absolute value?
  3. If you integrate and get ln⁡∣y∣=2x+C\ln|y|=2x+C, what is y in terms of x?

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