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 Modeling & verifying solutions
7.2 Slope fields
7.3 Separation of variables
7.4 Exponential models
8. Applications of integrals
9. Testing details tag
10. test
Wrapping up
Achievable logoAchievable logo
7.3 Separation of variables
Achievable AP Calculus AB
7. Differential equations
Our AP Calculus AB course is currently in development and is a work-in-progress.

Separation of variables

7 min read
Font
Discuss
Share
Feedback

What you’ll learn:

  • How to solve first-order differential equations using separation of variables
  • How to apply initial conditions to find a particular solution

So far, you’ve seen differential equations like

dxdy​=2x

which are easy to solve by directly integrating. But if the right-hand side depends on both x and y, we use a technique called separation of variables. This method works by rearranging the equation so that all terms involving y are on one side and all terms involving x are on the other, allowing us to integrate with respect to a single variable. In order to separate the variables, the differential equation must be written in the form

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

If the equation can’t be written this way, then separation of variables won’t work.

Find the particular solution to the differential equation

dxdy​=ex−y

With initial condition: y(0)=ln(5)

Step 1: Rewrite the equation to separate the variables

dxdy​=eyex​

Generally, the easiest way to separate the variables is to multiply both sides by dx and then rearrange so that the portion with y goes to the other side with dy - in this case, by multiplying both sides by ey.

eydy=exdx

Step 2: Integrate both sides

∫eydy=∫exdx

ey=ex+C

Step 3: Apply the initial condition if given

If no initial condition is given, then just solve the equation for y to obtain the general solution.

In this case, there is an initial condition (x,y)=(0,ln(5)) so plug it in to find C:

eln(5)=e0+C

5=1+C

C=4

Then

ey=ex+4

Solving for y,

ln(ey)=ln(ex+4)

y=ln(ex+4)​

Examples

1. Find the general solution to

dxdy​=y+yx2

Solution

(spoiler)

First, factor so that the equation is written as a product:

dxdy​=y(1+x2)

Next, separate the variables by multiplying both sides by dx and then dividing by y:

y1​dy=(1+x2)dx

Integrate both sides

∫y1​dy=∫(1+x2)dx

ln∣y∣=x+3x3​+C

Solve for y:

eln∣y∣=ex+x3/3+C

y=ex+x3/3+C

Using the product law of exponents,

y=e(x+x3/3)⋅eC

Since eC is also a constant, we can change it to C, which is any real number rather than a specific value. So the general solution to the differential equation is

y=Cex+x3/3​

2. Find the particular solution to

dxdy​=xy2

with y(0)=1.

Solution

(spoiler)

Separate the variables:

y21​dy=xdx

Integrate both sides:

∫y21​dy=∫xdx

−y1​=2x2​+C

Plug in initial condition (x,y)=(0,1):

−11​=202​+C

C=−1

Lastly, solve for y to find the particular solution after substituting C=−1:

−y1​=2x2​−1

−1=(2x2​−22​)y

−2x2−2​1​=y

y=−x2−22​​

3. Find the particular solution to

dxdy​=y+1

with y(2)=0

Solution

(spoiler)

Separate the variables:

y+11​dy=dx

Integrate both sides (use u-substitution with u=y+1 for the left-hand side):

∫y+11​dy=∫1dx

ln(y+1)=x+C

Plug in the initial condition (x,y)=(2,0) to find C:

ln(0+1)=2+C

0=2+C

C=−2

Solve for y to find the particular solution after substituting C=−2:

ln(y+1)=x−2

eln(y+1)=ex−2

y+1=ex−2

y=ex−2−1​

4. If

dtdy​=y2t+1​

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

Solution

(spoiler)

Although the variables this time are y and t, separation of variables works the same way:

ydy=(2t+1)dt

Integrate both sides:

∫ydy=∫(2t+1)dt

2y2​=t2+t+C

Solve for C given initial condition y=2 and t=0:

222​=02+0+C

2=0+C

C=2

Then

2y2​=t2+t+2

y2=2t2+2t+4

y=±2t2+2t+4​

Note: The initial condition y(0)=2 tells us that y is positive; therefore, the positive branch y=2t2+2t+4​ is the only solution.

Solving for y when t=1,

y=2t2+2t+4​

=2+2+4​

=22​

Lastly, here is a problem similar to a multi-part free-response question from the 2022 AB exam:

Consider the differential equation

dxdy​=πcos(πx)y​

Let y=f(x) be the particular solution to the differential equation with initial condition f(1)=4.

a) Write an equation for the line tangent to the solution curve at the point (1,4) and use it to approximate f(0.9).

b) Given f′′(x)<0 for −1≤x≤1, is the approximation from part a) an overestimate or underestimate for f(0.9)?

c) Use separation of variables to find the particular solution to the differential equation with initial condition f(1)=4.

Solutions

a) Equation of tangent line at (1,4)

(spoiler)

The equation of a tangent line at a point (a,f(a)) is

y−f(a)=f′(a)(x−a)

(a,f(a)) was given as (1,4). To find f′(a), or the slope of the tangent line, evaluate the differential equation at the point:

dxdy​​x=1,y=4​=πcos(π⋅1)4​

=−2π

Then the equation of the tangent line is

y−4=−2π(x−1)​

The linear approximation of f(0.9) can be found by plugging in x=0.9 into the tangent line equation:

y−4=−2π(0.9−1)

y=−2π(−0.1)+4

f(0.9)≈0.2π+4​

b) Underapproximate or overapproximate?

(spoiler)

Since f′′(x)<0, the graph of the function is concave down on that interval.

When a function is concave down, the tangent line lies above the curve, so the linear approximation from the tangent line is an overestimate of the actual value.

c) Particular solution with f(1)=4

(spoiler)

Separate the variables:

y​1​dy=πcos(πx)dx

Integrate both sides:

∫y​1​dy=∫πcos(πx)dx

∫y−1/2dy=sin(πx)+C

2y1/2=sin(πx)+C

Plug in initial condition (1,4) to solve for C:

24​=sin(π⋅1)+C

4=0+C

C=4

Lastly, solve for y:

2y1/2=sin(πx)+4

y1/2=21​sin(πx)+2

y=(21​sin(πx)+2)2​

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

All rights reserved ©2016 - 2026 Achievable, Inc.