Kim’s Math NotesCourse index

Finding General Solutions Using Separation of Variables

How do I separate variables to get a general solution?

Find the general solution of a separable differential equation: separate, integrate each side, add one constant, and solve for y when you can.

Separate before you integrate

Common mistake dydx=xy, so y=x22y+C.

Correction 1ydy=xdx first; then ln|y|=x22+C.

e to a sum is a product

Common mistake ln|y|=x2+C, so y=ex2+C.

Correction |y|=ex2+C=eCex2, so y=Aex2.

The + C goes in at once

Common mistake y33=x33, y=x, then y=x+C.

Correction y33=x33+C, so y=x3+C3.

Idea 1: y with dy, x with dx

Here's d y d x equals x squared over y squared. To find y, we want to integrate. But y is sitting on the right side, and we don't know y yet. You can't integrate it like a constant. So how do we get past that?

One. Every y goes with d y, every x goes with d x.

Watch this part of the concept lesson

Read the rest of this scene

Think of the equal sign as a border. Multiply both sides by y squared d x. Now every y is on the left, with d y, and every x is on the right, with d x. Now each side has only one variable, so integrate the left with respect to y and the right with respect to x. That gives y cubed over three equals x cubed over three, plus C.

But you've heard it a hundred times: d y d x is not a fraction. So why are we allowed to split it? Let's check. Take the derivative with respect to x of y cubed over three. y depends on x, so the chain rule gives y squared times d y d x, and the equation says that's x squared. Both sides match.

The chain rule backs us up. Now test a real curve. With C equal to zero, y cubed equals x cubed, so y equals x. The equation divides by y, so y can't be zero: the origin is out. Check the point one, one: the line's slope is one, and the equation gives one squared over one squared, which is one.

At negative one, negative one, the line's slope is one again, and the equation gives one again. It works. Get each variable on its own side first, then integrate each side. That move is called separation of variables. On one 2023 AP free-response part worth four points, an answer that never separated the variables earned zero of the four. Not one point.

Idea 2: one + C, a family

Now, two. With the same equation, d y d x equals x squared over y squared, here's why we write only one plus C. Strictly, each integral brings its own constant: y cubed over three plus C one, equals x cubed over three plus C two. Two sides, two constants. Move C one over, and you get C two minus C one. An unknown minus an unknown is still just one unknown constant.

So write one C, on one side, the moment you integrate.

Watch this part of the concept lesson

Read the rest of this scene

Multiply by three: y cubed equals x cubed plus three C. Three times some constant is still some constant, so we keep calling it C. Take the cube root: y equals the cube root of x cubed plus C. With C still in it, it's called the general solution. Set C equal to zero and the curve is the line y equals x.

Set C equal to eight, and since the cube root of eight is two, the curve passes through zero comma two. Every value of C draws one curve. Put them all together, and you're looking at the whole family of solutions.

Idea 3: 1/y → ln

Alright, three. When separating leaves one over y, d y, the answer has a natural log. The equation is d y d x equals y cosine x. Divide by y, for y not zero, and multiply by d x: one over y, d y, equals cosine x, d x. Integrating gives the natural log of the absolute value of y equals sine x, plus C. Keep those absolute value bars.

Raise e to both sides. The sum in the exponent splits into a product: the absolute value of y is e to the C, times e to the sine x. Drop the bars, and you get plus or minus e to the C. That's a new nonzero constant, so give it a new name: A. We divided by y, so the case y equals zero dropped out.

Check it in the original equation.

Watch this part of the concept lesson

Read the rest of this scene

Left side, the derivative of zero is zero; right side, zero times cosine x is zero. They match, so y equals zero is a solution too. Now let A be zero in our answer: zero times e to the sine x is zero. So y equals A e to the sine x already has it. Nothing got left behind.

With A equals one, we get the basic wave. A equals two stretches it to twice the height, and A equals negative one flips it below the axis. Same three steps as before: separate, integrate, one constant. The natural log just comes from integrating one over y.

Idea 4: a product, not a sum

Four. Before you separate, look for a product. Take d y d x equals x y plus three x. Factor out the x: x times the quantity y plus three. Now it splits: d y over y plus three equals x d x, for y not negative three. But d y d x equals x plus y is a sum.

Multiplying and dividing never gets y alone with d y, so it can't be separated.

Watch this part of the concept lesson

Read the rest of this scene

Moving y over with a minus sign isn't separating. And that's okay: not every differential equation separates.

Example 1: a general solution

Example one. Find the general solution of the differential equation d y d x equals two x over cosine y. You may leave it in implicit form. For this one: separate the variables, integrate each side, and write plus C on the line where the integral signs disappear. Multiply both sides by cosine y d x: cosine y d y equals two x d x. Check the border: only y on the left, only x on the right.

The left side is integrated with respect to y, and the right side with respect to x.

Watch this part of the concept lesson

Read the rest of this scene

That gives sine y equals x squared plus C. Each side could carry its own constant, but their difference is still one constant, so a single C does the job. So, sine y equals x squared plus C is the general solution, in implicit form. The question allows that, so we're done. Alright. Separate a few more in your workbook, and get each letter on its own side before you integrate anything.

Common mistake: no separation

Here's a common mistake: integrating with respect to x while cosine y is still on the right. As x changes, y changes too, so cosine y is not a constant. This answer leaves cosine y on the right and integrates with respect to x, as if y were a constant. But y changes as x changes. On that 2023 AP part, an answer with no separation earned zero points.

Do this instead: first write cosine y d y equals two x d x. Then integrate the left side with respect to y and the right side with respect to x.

Watch this part of the concept lesson

Example 2: which general solution?

Example two. Which is the general solution of d y d x equals e to the quantity x minus y? The plan: rewrite e to the x minus y as a quotient, separate, integrate, and then solve for y. e to the x minus y is e to the x over e to the y: subtracting exponents means dividing, so it's a hidden product. Multiply by e to the y d x: e to the y d y equals e to the x d x. Integrating gives e to the y equals e to the x plus C, and the C goes in now, before any natural log, so later it stays inside.

Take the natural log of the whole right side: y equals the natural log of the quantity e to the x plus C.

Watch this part of the concept lesson

Read the rest of this scene

The C stays trapped inside; you can't pull it out. So, the answer is B. Okay. The next one in your workbook starts the same way: split it, then separate.

Worked examples

Example 1

Find the general solution of dydx=2xcosy.
You may leave it in implicit form.
Hint

Multiply by cosydx so every y goes with dy.

Answer and solution

Answer siny=x2+C

  1. cosydy=2xdx
  2. siny=x2+C
  3. One + C, written the moment you integrate.

Example 2

Which is the general solution of dydx=ex−y?
  1. y=x+C
  2. y=ln(ex+C)
  3. y=−ln(C−ex)
  4. y=ex+C
Hint

Split the exponent: ex−y=exe−y.

Answer and solution

Answer B. y=ln(ex+C)

  1. ex−y=exe−y→eydy=exdx
  2. ey=ex+C→y=ln(ex+C)
  3. Answer B.

Workbook

Problem 1

Find the general solution of dydx=4x3y. You may leave it in implicit form.
Hint

Multiply both sides by ydx so y goes with dy.

Answer and solution

Answer y22=x4+C

  1. ydy=4x3dx→y22=x4+C
  2. One + C, written the moment you integrate. Implicit form is fine.

Common mistake Leaving y on the right side before integrating.

Watch the worked solution to Problem 1

Problem 2

Which is the general solution of dydx=ysec2x?
  1. y=Aetanx
  2. y=tanx+C
  3. y=etanx+C
  4. y=Atanx
Hint

Divide by y first. After the log, etanx+C=eCetanx.

Answer and solution

Answer A. y=Aetanx

  1. 1ydy=sec2xdx→ln|y|=tanx+C→y=Aetanx
  2. Answer A.

Common mistake Writing e^{tan x} + C instead of A e^{tan x}.

Watch the worked solution to Problem 2

Problem 3

Find the general solution of dydx=y+1x for x>0. Write y as a function of x.
Hint

Divide by y+1 and multiply by dx. After the logs, raise e to both sides.

Answer and solution

Answer y=Ax−1

  1. 1y+1dy=1xdx→ln|y+1|=lnx+C
  2. |y+1|=eCx→y=Ax−1
  3. ±e^C is a new constant, A.

Common mistake Splitting e^{ln x + C} as x + e^C.

Watch the worked solution to Problem 3

Problem 4

Which is the general solution of dydx=y2sinx?
  1. y=1cosx+C
  2. y=−1cosx+C
  3. y=1C−cosx
  4. y=y33sinx+C
Hint

Divide by y2: y−2dy=sinxdx. Keep every minus sign.

Answer and solution

Answer A. y=1cosx+C

  1. y−2dy=sinxdx→−1y=−cosx+C→y=1cosx+C
  2. Answer A.

Common mistake Losing a minus sign from the integral of y^{-2}.

Watch the worked solution to Problem 4

Problem 5

Which is the general solution of dydx=2xey?
  1. y=−ln(C−x2)
  2. y=ln(x2+C)
  3. y=−ln(x2)+C
  4. y=x2ey+C
Hint

Move ey: e−ydy=2xdx. The integral of e−y is −e−y.

Answer and solution

Answer A. y=−ln(C−x2)

  1. e−ydy=2xdx→−e−y=x2+C→e−y=C−x2→y=−ln(C−x2)
  2. Answer A.

Common mistake Integrating e^{-y} as e^{-y}.

Watch the worked solution to Problem 5

Problem 6

Consider dydx=x+1xy2 for x>0.
  1. Separate the variables and find the general solution in implicit form.
  2. Write y as a function of x.
Hint

Write x+1x=1+1x before you integrate.

Answer and solution
  1. y33=x+lnx+C
  2. y=3x+3lnx+C3
  1. y2dy=(1+1x)dx→y33=x+lnx+C
  2. y=3x+3lnx+C3

Common mistake Integrating (x + 1)/x without splitting it.

Watch the worked solution to Problem 6

Problem 7

Consider the differential equation dydx=2xy+4x.
  1. Find the general solution. Write y as a function of x.
  2. To separate, you divided by y+2. Is the constant function y=−2 a solution? If so, which value of the constant in (a) gives it?
Hint

The right side is a sum. Factor out 2x first; then every y can go with dy.

Answer and solution
  1. y=Aex2−2
  2. yes: dydx=0 and 2x(−2)+4x=0; it is A=0
  1. dydx=2x(y+2)→1y+2dy=2xdx,y≠−2
  2. ln|y+2|=x2+C→|y+2|=eCex2→y=Aex2−2
  3. (b) y = -2: dy/dx = 0 and 2x(-2) + 4x = 0, so it is a solution. It is A = 0 in the general solution.

Common mistake Trying to separate the sum 2xy + 4x without factoring; losing y = -2.

Watch the worked solution to Problem 7

Problem 8

Which is the general solution of the differential equation dydx=e2x+y?
  1. y=−ln(C−12e2x)
  2. y=ln(12e2x+C)
  3. y=−ln(C−e2x)
  4. y=12e2x+y+C
Hint

Split the exponent: e2x+y=e2xey. Then separate.

Answer and solution

Answer A. y=−ln(C−12e2x)

  1. e2x+y=e2xey→e−ydy=e2xdx
  2. −e−y=12e2x+C→e−y=C−12e2x
  3. y=−ln(C−12e2x)
  4. Answer A. (The constant -C is renamed C.)

Common mistake Not splitting e^{2x + y}; losing the 1/2 or the minus.

Watch the worked solution to Problem 8

Problem 9

Which of the following differential equations can NOT be solved by separation of variables?
  1. dydx=ex+y
  2. dydx=x+y2
  3. dydx=yx
  4. dydx=xy+x
Hint

Separable means the right side is (a function of x) times (a function of y). Factor or split first.

Answer and solution

Answer B. dydx=x+y2

  1. ex+y=exey,yx=1x⋅y,xy+x=x(y+1)
  2. x + y^2 is a sum of an x-part and a y-part, not a product. Answer B.

Common mistake Calling e^{x + y} or xy + x not separable.

Watch the worked solution to Problem 9