Skip to main content

Unit 7 · Topic 7.6

7.6 Finding General Solutions Using Separation of Variables

A separable differential equation can be rearranged so all the y's (with dy) are on one side and all the x's (with dx) are on the other. Integrating both sides and adding a constant C gives the general solution, which describes a whole family of curves.

Key terms

  • separation of variables
  • separable differential equation
  • general solution
  • constant of integration

What “separable” means

A differential equation is separable if dydx\frac{dy}{dx} can be written as a function of x times a function of y: dydx=g(x)⋅h(y)\frac{dy}{dx} = g(x) \cdot h(y). Then you can move all the y-stuff to the left and all the x-stuff to the right:

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

Examples that are separable: dydx=x2y\frac{dy}{dx} = \frac{x^2}{y}, dydx=3x2y\frac{dy}{dx} = 3x^2 y, dydx=ex−y\frac{dy}{dx} = e^{x - y} (because ex−y=ex⋅e−ye^{x - y} = e^x \cdot e^{-y}), dydx=ycos⁡x\frac{dy}{dx} = y\cos x. Examples that aren't: dydx=x+y\frac{dy}{dx} = x + y, dydx=sin⁡(xy)\frac{dy}{dx} = \sin(xy). You can't split a sum like x + y into a product.

The steps

  • Separate: get every y and dy on one side, every x and dx on the other. Multiply or divide; never add or subtract a term across.
  • Integrate both sides.
  • Add one constant of integration, usually on the x side. (Constants from both sides combine into one.)
  • Solve for y if you can. If you can't, an implicit answer like y22=x33+C\frac{y^2}{2} = \frac{x^3}{3} + C is still a valid general solution.

Handling the constant

When you solve for y, the constant changes form. If ln⁡∣y∣=x3+C\ln\lvert y \rvert = x^3 + C, then ∣y∣=ex3+C=eC⋅ex3\lvert y \rvert = e^{x^3 + C} = e^C \cdot e^{x^3}. Since eCe^C is just some positive constant, you can write y=A⋅ex3y = A \cdot e^{x^3}, where A can be positive or negative. A = 0 also works here, because y = 0 is a solution of dydx=3x2y\frac{dy}{dx} = 3x^2 y. (That zero solution gets lost when you divide by y, so it's worth checking for.)

This step is why you add C right after integrating, not at the very end. Adding it later, as in y=ex3+Cy = e^{x^3} + C, gives the wrong family.

Integrals that come up again and again

  • ∫1y dy=ln⁡∣y∣+C\int \frac{1}{y}\,dy = \ln\lvert y \rvert + C
  • ∫y−2 dy=−1y+C\int y^{-2}\,dy = -\frac{1}{y} + C
  • ∫y dy=y22+C\int y\,dy = \frac{y^2}{2} + C
  • ∫ey dy=ey+C\int e^y\,dy = e^y + C, and ∫e−y dy=−e−y+C\int e^{-y}\,dy = -e^{-y} + C
  • ∫11+y2 dy=arctan⁡y+C\int \frac{1}{1 + y^2}\,dy = \arctan y + C
  • ∫cos⁡y dy=sin⁡y+C\int \cos y\,dy = \sin y + C

Why it matters

Separation of variables is the main method for solving differential equations in this course. Exponential growth and decay (7.8) and the logistic model (7.9, BC only) both come from separable equations. Separable equations are a regular part of AP free response, and the next topic (7.7) adds the initial condition.

Worked examples

Try each one yourself first, then open the solution.

  1. Example 1

    Implicit general solution

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

    Show the solution
    1. Step 1: Separate: y dy=x2 dxy\,dy = x^2\,dx.
    2. Step 2: Integrate: ∫y dy=∫x2 dx\int y\,dy = \int x^2\,dx, so y22=x33+C\frac{y^2}{2} = \frac{x^3}{3} + C.
    3. Step 3: You can leave it like this, or write y2=23x3+Ky^2 = \frac{2}{3}x^3 + K, where K = 2C.

    Answer: y22=x33+C\frac{y^2}{2} = \frac{x^3}{3} + C (or y2=23x3+Ky^2 = \frac{2}{3}x^3 + K)

  2. Example 2

    Exponential form

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

    Show the solution
    1. Step 1: Separate (for y ≠ 0): 1y dy=3x2 dx\frac{1}{y}\,dy = 3x^2\,dx.
    2. Step 2: Integrate: ln⁡∣y∣=x3+C\ln\lvert y \rvert = x^3 + C.
    3. Step 3: Exponentiate: ∣y∣=eC⋅ex3\lvert y \rvert = e^C \cdot e^{x^3}, so y=A⋅ex3y = A \cdot e^{x^3}, where A=±eCA = \pm e^C.
    4. Step 4: Check the lost case: y = 0 gives 0 = 0 in the original equation, so A = 0 is allowed too.
    5. Step 5: Check: if y=Aex3y = Ae^{x^3}, dydx=3x2⋅Aex3=3x2y\frac{dy}{dx} = 3x^2 \cdot Ae^{x^3} = 3x^2 y.

    Answer: y=A⋅ex3y = A \cdot e^{x^3}, for any constant A

  3. Example 3

    Trap: exponents with a difference

    Find the general solution of dydx=ex−y\frac{dy}{dx} = e^{x - y}.

    Show the solution
    1. Step 1: It looks unseparable, but ex−y=ex⋅e−ye^{x - y} = e^x \cdot e^{-y}.
    2. Step 2: Separate: dye−y=ex dx\frac{dy}{e^{-y}} = e^x\,dx, which is ey dy=ex dxe^y\,dy = e^x\,dx.
    3. Step 3: Integrate: eʸ = eˣ + C.
    4. Step 4: Solve: y = ln(eˣ + C), valid where eˣ + C > 0.

    Answer: y = ln(eˣ + C)

Common mistakes

  • Leaving a y on the x side (or an x on the y side) and integrating anyway. Both sides must be in one variable each.
  • Forgetting the + C, or adding it only after solving for y. On the AP exam, leaving out the constant of integration can cost you most of the points on that part.
  • Writing ln⁡∣y∣=x3+C\ln\lvert y \rvert = x^3 + C and then y=ex3+Cy = e^{x^3} + C. Exponentiating turns the added constant into a multiplier.
  • Separating dydx=x+y\frac{dy}{dx} = x + y as dy − y = x dx. That isn't separation.

On the exam

  • AP scorers check that you separated correctly before anything else. If the separation is wrong, little else can earn credit, so double-check it.
  • Show the integrals with the constant: “ln⁡∣y∣=x3+C\ln\lvert y \rvert = x^3 + C.”

Connected topics

Videos

  • Calculus AB/BC – 7.6 General Solutions Using Separation of Variables

    The AlgebrosWatch on YouTube (opens in a new tab)

  • Separable differential equations introduction | First order differential equations | Khan Academy

    Khan AcademyWatch on YouTube (opens in a new tab)

  • Separable First-Order Differential Equations

    Professor Dave ExplainsWatch on YouTube (opens in a new tab)

  • AP Calculus AB TOPIC 7.6 Finding General Solutions Using Separation of Variables

    Math Teacher GOATWatch on YouTube (opens in a new tab)

  • Separation of Variables // Differential Equations

    Dr. Trefor BazettWatch on YouTube (opens in a new tab)

  • Separable First Order Differential Equations - Basic Introduction

    The Organic Chemistry TutorWatch on YouTube (opens in a new tab)

Check yourself: 7.6 Finding General Solutions Using Separation of Variables

4 questions on 7.6 Finding General Solutions Using Separation of Variables. Pick an answer to see if you got it, and why.

Question 1 of 4

Which of the following is the general solution to the differential equation dydx=ycos⁡x\frac{dy}{dx} = y\cos x?

Question 2 of 4

Which of the following is the general solution to the differential equation dydx=ex−y\frac{dy}{dx} = e^{x - y}?

Question 3 of 4

Which of the following is the general solution to the differential equation dydx=1+y2x\frac{dy}{dx} = \frac{1 + y^2}{x} for x > 0?

Question 4 of 4

The temperature y of an object satisfies dydt=k(M−y)\frac{dy}{dt} = k(M - y), where M is the constant room temperature and k is a positive constant. Which of the following is the general solution of this differential equation?

0 of 4 answered

Something wrong or out of date here?

Something wrong with this page?

What's wrong?

Please don't include personal details.