Achievable logoAchievable logo
AP Calculus AB
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. Limits
2. Derivative basics
3. Advanced differentiation
4. Contextual uses
5. Analytical uses
6. Integration
7. Differential equations
7.1 Intro to differential equations
7.2 Slope fields
7.3 Separation of variables
7.4 Exponential models
8. Applications of integrals
Wrapping up
Achievable logoAchievable logo
7.3 Separation of variables
Achievable AP Calculus AB
7. Differential equations
Our AP Calculus AB course is now in "early access" - get 50% off for a limited time.

Separation of variables

7 min read
Font
Discuss
Share
Feedback

What you’ll learn

  • Separation of variables: Group variables and integrate to find a general solution.
  • Particular solutions: Use an initial condition to solve for the constant C.

So far, you’ve seen differential equations like dxdy​=2x, which can be solved by integrating both sides with respect to x.

When the derivative depends on both x and y, a common method is separation of variables.

The idea is to rewrite the equation so that:

  • All y-terms (and dy) are on one side.
  • All x-terms (and dx) are on the other side.

This works when the differential equation can be written in the form

dxdy​=f(x)⋅g(y)

and rearranged into

g(y)1​dy=f(x)dx

If the equation can’t be rewritten as a product of a function of x and a function of y, then separation of variables won’t apply.

General vs. particular solutions

To analyze a differential equation, check if you are given an initial starting point.

  1. General solution: No initial condition is given. Your goal is to isolate y, and the final answer will always contain +C.

  2. Particular Solution: An initial condition (x,y) is given. Use this point to solve for the exact value of C.

AP tip:

Always substitute your initial condition to find C immediately after integrating. Finding C early keeps the algebra cleaner.

Case 1: General solutions (keeping +C)

Find the general solution to each differential equation:

1a)  dxdy​=2xy

1b)  dxdy​=xy2

Solutions

1a)  dxdy​=2xy

(spoiler)

1. Separate the variables:

Multiply by dx and divide by y:

y1​dy=2xdx

2. Integrate both sides:

∫y1​dyln∣y∣​=∫2xdx=x2+C​

Because the integral is indefinite, add the constant of integration C.

Conventionally, it’s added to the side with the independent variable (in this case, x), or the right hand-side.

3. Isolate y:

Exponentiate both sides to undo the natural log:

∣y∣=ex2+C

Using the product rule of exponents (eA+B=eA⋅eB), rewrite the right side:

∣y∣=eC⋅ex2

Since eC is just a constant, we can absorb the absolute value bars and replace eC with a new arbitrary constant, C:

y=Cex2​

1b)  dxdy​=xy2

(spoiler)

1. Separate the variables:

y21​dy=xdx

2. Integrate both sides:

∫y21​dy−y1​​=∫xdx=2x2​+C​

3. Isolate y:

Multiply by −1 and take the reciprocal of both sides. The constant stays locked in the denominator:

y1​=−21​x2−Cy=21​x2+C−1​​

Case 2: Particular solutions (solving for C)

Find the particular solution to each differential equation given the initial condition.

2a)  dxdy​=yx​ with initial condition y(0)=−3

2b)  dxdy​=1−y with initial condition (2,0).

Solutions

2a)  dxdy​=yx​ with initial condition y(0)=−3

(spoiler)

1. Separate the variables:

ydy=xdx

2. Integrate both sides:

∫ydy21​y2​=∫xdx=21​x2+C​

3. Plug in the initial condition y(0)=−3 to find C:

21​(−3)229​​=21​(0)2+C=C​

4. Substitute C back into the equation and solve for y:

21​y2y2y​=21​x2+29​=x2+9=±x2+9​​

Note: The initial condition states that y=−3 (a negative value) when x=0. Therefore, select the negative root branch:

y=−x2+9​​

2b)  dxdy​=1−y with initial condition (2,0).

(spoiler)

1. Separate the variables:

1−y1​dy=dx

2. Integrate both sides:

On the left, u-substitution with u=1−y is used.

∫1−y1​dy−ln∣1−y∣​=∫1dx=x+C​

3. Use the initial condition (x,y)=(2,0) to find C:

−ln(1−0)0C​=2+C=2+C=−2​

4. Substitute C=−2 and solve for y:

−ln∣1−y∣ln∣1−y∣eln∣1−y∣1−y​=x−2=2−x=e2−x=e2−x​

y=1−e2−x​

Method: Pre-separation algebra

You may have to factor or apply exponent rules before the variables can be separated.

Find the general solution to each differential equation:

3a)  dxdy​=x+xy2

3b)  dxdy​=ex−y

Solutions

3a)  dxdy​=x+xy2

(spoiler)

1. Factor the right-hand side:

dxdy​=x(1+y2)

2. Separate the variables:

1+y21​dy=xdx

3. Integrate both sides:

∫1+y21​dytan(y)​=∫xdx=21​x2+C​

4. Isolate y:

y=arctan(21​x2+C)

3b)  dxdy​=ex−y

(spoiler)

1. Rewrite the expression

By applying exponent rules,

dxdy​=ex−y=eyex​

2. Separate the variables:

eydy=exdx

3. Integrate both sides:

∫eydyey​=∫exdx=ex+C​

4. Isolate y:

Take the natural log of both sides.

y=ln(ex+C)​

Finding a value from a particular solution

If

dtdy​=y2t+1​

and y=2 when t=0, find y when t=1.

Solution

(spoiler)

In this case, t is the independent variable (instead of x).

1. Separate the variables:

ydy=(2t+1)dt

2. Integrate both sides:

∫ydy2y2​​=∫(2t+1)dt=t2+t+C​

3. Use the initial condition y=2 when t=0 to find C:

222​2​=02+0+C=C​

*4. Solve for y:

2y2​y2y​=t2+t+2=2t2+2t+4=±2t2+2t+4​​

Note: The initial condition y(0)=2 tells you y is positive at t=0, so take the positive branch:

y=2t2+2t+4​

Now evaluate at t=1:

y=2(1)2+2(1)+4​=2+2+4​=22​

Separation of variables

  • Used for first-order differential equations of the form dxdy​=f(x)g(y)
  • Rearrange to isolate y-terms with dy and x-terms with dx
  • Integrate both sides to solve

Applying initial conditions

  • Substitute given (x,y) values after integrating to solve for the constant C
  • Plug C back into the general solution for the particular solution

Example 1: dxdy​=ex−y, y(0)=ln(5)

  • Separate: eydy=exdx
  • Integrate: ey=ex+C
  • Apply initial condition: C=4
  • Solution: y=ln(ex+4)

Example 2: dxdy​=y+yx2

  • Factor: y(1+x2)
  • Separate: y1​dy=(1+x2)dx
  • Integrate: ln∣y∣=x+3x3​+C
  • General solution: y=Cex+x3/3

Example 3: dxdy​=xy2, y(0)=1

  • Separate: y21​dy=xdx
  • Integrate: −y1​=2x2​+C
  • Apply initial condition: C=−1
  • Solution: y=−x2−22​

Example 4: dxdy​=y+1, y(2)=0

  • Separate: y+11​dy=dx
  • Integrate: ln(y+1)=x+C
  • Apply initial condition: C=−2
  • Solution: y=ex−2−1

Example 5: dtdy​=y2t+1​, y(0)=2

  • Separate: ydy=(2t+1)dt
  • Integrate: 2y2​=t2+t+C
  • Apply initial condition: C=2
  • Solution: y=2t2+2t+4​
  • At t=1: y=22​

Tangent line approximation and concavity

  • Tangent line at (x0​,y0​): y−y0​=f′(x0​)(x−x0​)
  • If f′′(x)<0, function is concave down
    • Tangent line overestimates function near x0​

Example 6: dxdy​=πcos(πx)y​, f(1)=4

  • Tangent line at (1,4): y−4=−2π(x−1)
  • Approximate f(0.9): f(0.9)≈0.2π+4
  • Concavity: f′′(x)<0 implies tangent overestimates f(0.9)
  • Separate: y​1​dy=πcos(πx)dx
  • Integrate: 2y1/2=sin(πx)+C
  • Apply initial condition: C=4
  • Solution: y=(21​sin(πx)+2)2

Sign up for free to take 11 quiz questions on this topic

All rights reserved ©2016 - 2026 Achievable, Inc.

Separation of variables

What you’ll learn

  • Separation of variables: Group variables and integrate to find a general solution.
  • Particular solutions: Use an initial condition to solve for the constant C.

So far, you’ve seen differential equations like dxdy​=2x, which can be solved by integrating both sides with respect to x.

When the derivative depends on both x and y, a common method is separation of variables.

The idea is to rewrite the equation so that:

  • All y-terms (and dy) are on one side.
  • All x-terms (and dx) are on the other side.

This works when the differential equation can be written in the form

dxdy​=f(x)⋅g(y)

and rearranged into

g(y)1​dy=f(x)dx

If the equation can’t be rewritten as a product of a function of x and a function of y, then separation of variables won’t apply.

General vs. particular solutions

To analyze a differential equation, check if you are given an initial starting point.

  1. General solution: No initial condition is given. Your goal is to isolate y, and the final answer will always contain +C.

  2. Particular Solution: An initial condition (x,y) is given. Use this point to solve for the exact value of C.

AP tip:

Always substitute your initial condition to find C immediately after integrating. Finding C early keeps the algebra cleaner.

Case 1: General solutions (keeping +C)

Find the general solution to each differential equation:

1a)  dxdy​=2xy

1b)  dxdy​=xy2

Solutions

1a)  dxdy​=2xy

(spoiler)

1. Separate the variables:

Multiply by dx and divide by y:

y1​dy=2xdx

2. Integrate both sides:

∫y1​dyln∣y∣​=∫2xdx=x2+C​

Because the integral is indefinite, add the constant of integration C.

Conventionally, it’s added to the side with the independent variable (in this case, x), or the right hand-side.

3. Isolate y:

Exponentiate both sides to undo the natural log:

∣y∣=ex2+C

Using the product rule of exponents (eA+B=eA⋅eB), rewrite the right side:

∣y∣=eC⋅ex2

Since eC is just a constant, we can absorb the absolute value bars and replace eC with a new arbitrary constant, C:

y=Cex2​

1b)  dxdy​=xy2

(spoiler)

1. Separate the variables:

y21​dy=xdx

2. Integrate both sides:

∫y21​dy−y1​​=∫xdx=2x2​+C​

3. Isolate y:

Multiply by −1 and take the reciprocal of both sides. The constant stays locked in the denominator:

y1​=−21​x2−Cy=21​x2+C−1​​

Case 2: Particular solutions (solving for C)

Find the particular solution to each differential equation given the initial condition.

2a)  dxdy​=yx​ with initial condition y(0)=−3

2b)  dxdy​=1−y with initial condition (2,0).

Solutions

2a)  dxdy​=yx​ with initial condition y(0)=−3

(spoiler)

1. Separate the variables:

ydy=xdx

2. Integrate both sides:

∫ydy21​y2​=∫xdx=21​x2+C​

3. Plug in the initial condition y(0)=−3 to find C:

21​(−3)229​​=21​(0)2+C=C​

4. Substitute C back into the equation and solve for y:

21​y2y2y​=21​x2+29​=x2+9=±x2+9​​

Note: The initial condition states that y=−3 (a negative value) when x=0. Therefore, select the negative root branch:

y=−x2+9​​

2b)  dxdy​=1−y with initial condition (2,0).

(spoiler)

1. Separate the variables:

1−y1​dy=dx

2. Integrate both sides:

On the left, u-substitution with u=1−y is used.

∫1−y1​dy−ln∣1−y∣​=∫1dx=x+C​

3. Use the initial condition (x,y)=(2,0) to find C:

−ln(1−0)0C​=2+C=2+C=−2​

4. Substitute C=−2 and solve for y:

−ln∣1−y∣ln∣1−y∣eln∣1−y∣1−y​=x−2=2−x=e2−x=e2−x​

y=1−e2−x​

Method: Pre-separation algebra

You may have to factor or apply exponent rules before the variables can be separated.

Find the general solution to each differential equation:

3a)  dxdy​=x+xy2

3b)  dxdy​=ex−y

Solutions

3a)  dxdy​=x+xy2

(spoiler)

1. Factor the right-hand side:

dxdy​=x(1+y2)

2. Separate the variables:

1+y21​dy=xdx

3. Integrate both sides:

∫1+y21​dytan(y)​=∫xdx=21​x2+C​

4. Isolate y:

y=arctan(21​x2+C)

3b)  dxdy​=ex−y

(spoiler)

1. Rewrite the expression

By applying exponent rules,

dxdy​=ex−y=eyex​

2. Separate the variables:

eydy=exdx

3. Integrate both sides:

∫eydyey​=∫exdx=ex+C​

4. Isolate y:

Take the natural log of both sides.

y=ln(ex+C)​

Finding a value from a particular solution

If

dtdy​=y2t+1​

and y=2 when t=0, find y when t=1.

Solution

(spoiler)

In this case, t is the independent variable (instead of x).

1. Separate the variables:

ydy=(2t+1)dt

2. Integrate both sides:

∫ydy2y2​​=∫(2t+1)dt=t2+t+C​

3. Use the initial condition y=2 when t=0 to find C:

222​2​=02+0+C=C​

*4. Solve for y:

2y2​y2y​=t2+t+2=2t2+2t+4=±2t2+2t+4​​

Note: The initial condition y(0)=2 tells you y is positive at t=0, so take the positive branch:

y=2t2+2t+4​

Now evaluate at t=1:

y=2(1)2+2(1)+4​=2+2+4​=22​

Key points

Separation of variables

  • Used for first-order differential equations of the form dxdy​=f(x)g(y)
  • Rearrange to isolate y-terms with dy and x-terms with dx
  • Integrate both sides to solve

Applying initial conditions

  • Substitute given (x,y) values after integrating to solve for the constant C
  • Plug C back into the general solution for the particular solution

Example 1: dxdy​=ex−y, y(0)=ln(5)

  • Separate: eydy=exdx
  • Integrate: ey=ex+C
  • Apply initial condition: C=4
  • Solution: y=ln(ex+4)

Example 2: dxdy​=y+yx2

  • Factor: y(1+x2)
  • Separate: y1​dy=(1+x2)dx
  • Integrate: ln∣y∣=x+3x3​+C
  • General solution: y=Cex+x3/3

Example 3: dxdy​=xy2, y(0)=1

  • Separate: y21​dy=xdx
  • Integrate: −y1​=2x2​+C
  • Apply initial condition: C=−1
  • Solution: y=−x2−22​

Example 4: dxdy​=y+1, y(2)=0

  • Separate: y+11​dy=dx
  • Integrate: ln(y+1)=x+C
  • Apply initial condition: C=−2
  • Solution: y=ex−2−1

Example 5: dtdy​=y2t+1​, y(0)=2

  • Separate: ydy=(2t+1)dt
  • Integrate: 2y2​=t2+t+C
  • Apply initial condition: C=2
  • Solution: y=2t2+2t+4​
  • At t=1: y=22​

Tangent line approximation and concavity

  • Tangent line at (x0​,y0​): y−y0​=f′(x0​)(x−x0​)
  • If f′′(x)<0, function is concave down
    • Tangent line overestimates function near x0​

Example 6: dxdy​=πcos(πx)y​, f(1)=4

  • Tangent line at (1,4): y−4=−2π(x−1)
  • Approximate f(0.9): f(0.9)≈0.2π+4
  • Concavity: f′′(x)<0 implies tangent overestimates f(0.9)
  • Separate: y​1​dy=πcos(πx)dx
  • Integrate: 2y1/2=sin(πx)+C
  • Apply initial condition: C=4
  • Solution: y=(21​sin(πx)+2)2

More from Differential equations

  • Intro to differential equations
  • Slope fields
  • Exponential models