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 dy/dx can be written as a function of x times a function of y: dy/dx = g(x)·h(y). Then you can move all the y-stuff to the left and all the x-stuff to the right:

(1/h(y)) dy = g(x) dx.

Examples that are separable: dy/dx = x²/y, dy/dx = 3x²y, dy/dx = e^(x − y) (because e^(x − y) = eˣ · e^(−y)), dy/dx = y cos x. Examples that aren't: dy/dx = x + y, 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 y²/2 = x³/3 + C is still a valid general solution.

Handling the constant

When you solve for y, the constant changes form. If ln|y| = x³ + C, then |y| = e^(x³ + C) = e^(C) · e^(x³). Since e^(C) is just some positive constant, you can write y = A·e^(x³), where A can be positive or negative. A = 0 also works here, because y = 0 is a solution of dy/dx = 3x²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 = e^(x³) + C, gives the wrong family.

Integrals that come up again and again

  • ∫ (1/y) dy = ln|y| + C
  • ∫ y⁻² dy = −1/y + C
  • ∫ y dy = y²/2 + C
  • ∫ eʸ dy = eʸ + C, and ∫ e^(−y) dy = −e^(−y) + C
  • ∫ 1/(1 + y²) dy = arctan y + C
  • ∫ 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 dy/dx = x²/y.

    Show the solution
    1. Step 1: Separate: y dy = x² dx.
    2. Step 2: Integrate: ∫ y dy = ∫ x² dx, so y²/2 = x³/3 + C.
    3. Step 3: You can leave it like this, or write y² = (2/3)x³ + K, where K = 2C.

    Answer: y²/2 = x³/3 + C (or y² = (2/3)x³ + K)

  2. Example 2

    Exponential form

    Find the general solution of dy/dx = 3x²y.

    Show the solution
    1. Step 1: Separate (for y ≠ 0): (1/y) dy = 3x² dx.
    2. Step 2: Integrate: ln|y| = x³ + C.
    3. Step 3: Exponentiate: |y| = e^(C) · e^(x³), so y = A·e^(x³), where A = ±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 = Ae^(x³), dy/dx = 3x²·Ae^(x³) = 3x²y.

    Answer: y = A·e^(x³), for any constant A

  3. Example 3

    Trap: exponents with a difference

    Find the general solution of dy/dx = e^(x − y).

    Show the solution
    1. Step 1: It looks unseparable, but e^(x − y) = eˣ · e^(−y).
    2. Step 2: Separate: dy/e^(−y) = eˣ dx, which is eʸ dy = eˣ 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| = x³ + C and then y = e^(x³) + C. Exponentiating turns the added constant into a multiplier.
  • Separating 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| = x³ + 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

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 dy/dx = y cos x?

Question 2 of 4

Which of the following is the general solution to the differential equation dy/dx = e^(x − y)?

Question 3 of 4

Which of the following is the general solution to the differential equation dy/dx = (1 + y²)/x for x > 0?

Question 4 of 4

The temperature y of an object satisfies 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