Separation of Variables
Separation of Variables
Separation of Variables
2. Separation of Variables
Some differential equations can be solved by the method of separation of variables (or "variables separable") . This
method is only possible if we can write the differential equation in the form
A(x) dx + B(y) dy = 0,
Once we can write it in the above form, all we do is integrate throughout, to obtain our general solution.
NOTE: In this variables separable section we only deal with first order, first degree differential equations.
dy y
ln x − = 0
dx x
dy y
ln x − = 0
dx x
y dx
dy ln x − =0
x
y dx
dy − =0
x ln x
dy dx
− =0
y x ln x
1 1
dy − dx = 0
y x ln x
1 1
Here, A(x) = − and B (y ) = .
x ln x y
b) The following differential equation cannot be expressed in the required form, so it cannot be solved using
separation of variables:
dy 3(x + y )
=
dx x(y − 2)
Example 2
Solve the differential equation:
Answer
This is already in the required form (since the x-terms are together with dx terms, and y-terms are together
with dy terms), so we simply integrate:
∫ y 2 dy + ∫ x3 dx = 0
https://www.intmath.com/differential-equations/2-separation-variables.php 1/14
23.10.22, 19:29 2. Separation of Variables
Giving:
y 3 x4
+ =K
3 4
3 x4
y = 3(K − )
4
3 x4
y= 3(K − )
4
y
4
3
2
1 x
-10 -5 -1 5 10
-2
-3
-4
-5
-6
-7
-8
-9
-10
3 x4
Typical solution graph y = 3(5 − ) .
4
Example 3
dy y (x + 1)
Solve the differential equation: 2 =
dx x
Answer
2 dy (x + 1) dx
=
y x
2 dy 1
This gives us: = (1 + ) dx
y x
We now integrate:
2 dy 1
∫ = ∫ (1 + ) dx
y x
2 ln y = x + ln x + K
Go back to Integration: Basic Logarithm Form if you are rusty on this integration.
We could continue with our solution and express y as an explicit function of x, as follows:
https://www.intmath.com/differential-equations/2-separation-variables.php 2/14
23.10.22, 19:29 2. Separation of Variables
x + ln x + K
ln y =
2
y
10
9
8
7
6
5
4
3
2
1 x
-1 1 2 3 4
-1
(x+ln x+1)/2
Typical solution graph y = e .
Example 4
dx
Solve t −x=3
dt
Answer
dx
t −x=3
dt
We want all x's on one side, all the terms in t on the other.
dx
t =x+3
dt
dx
t = dt
x+3
dx dt
=
x+3 t
dx dt
∫ =∫
x+3 t
ln∣x + 3∣ = ln∣t∣ + C
x + 3 = eln∣t∣+C = eln∣t∣ eC = Kt
So x = Kt − 3.
x
30
25
20
15
10
5
t
1 2 3 4 5
-5
Typical solution graph x = 7t − 3.
Example 5
Solve 1 + 4x2 dy = y 3 x dx
Answer
dy x dx
=
y3 1 + 4x2
dy x dx
∫ =∫
y3 1 + 4x2
We now proceed to integrate the 2 sides separately. That is, we integrate the left side in y only (since after
separating the variables we have terms in y and a dy on the left) and we work on the right side in x only (since we
have terms in x and a dx only on the right).
For the right hand side involving x, let u = (1 + 4x 2), so du = 8x dx and du/8 = x dx.
dy 1 du
∫ 3 = ∫
y 8 u
−1
=
2y 2
1
= (2)u1/2 + K
8
1
= 1 + 4x2 + K
4
https://www.intmath.com/differential-equations/2-separation-variables.php 4/14
23.10.22, 19:29 2. Separation of Variables
1 1
2
=− 1 + 4x2 − 2K
y 2
K1
For convenience, introduce a new variable K 1 = −4K , so that we'll have −2K = . Our solution becomes:
2
1 1 K1 K 1 − 1 + 4x2
=− 1 + 4x2 + =
y2 2 2 2
± 2
y=
K1 − 1 + 4x2
Here is the graph of a typical solution for Example 5 where we have taken K = 50:
-1
± 2
Typical solution graph y = .
50 − 1 + 4x2
Particular Solutions
Our examples so far in this section have involved some constant of integration, K.
We now move on to see particular solutions, where we know some boundary conditions and we substitute those into
our general solution to give a particular solution.
Example 6
Find the particular solution for
dy
+ 2y = 6
dx
Answer
https://www.intmath.com/differential-equations/2-separation-variables.php 5/14
23.10.22, 19:29 2. Separation of Variables
We solve as before, and then use the given information to find the value of the unknown K.
Separating variables:
dy
+ 2y = 6
dx
dy
= 6 − 2y
dx
dy = (6 − 2y ) dx
dy
= dx
6 − 2y
Integrating gives:
dy
∫ = ∫ dx
6 − 2y
−1
ln∣6 − 2y ∣ = x + K
2
1
[For the integral involving y , we put u = 6 − 2y giving du = −2 dy . This means we'll replace dy with (− )du and
2
1
integrate ( )du giving ln u.]
u
−1
ln∣6 − 2(1)∣ = 0 + K
2
−1
K= ln∣4∣
2
So, on substituting this back into our previous equation and doing some algebra, we obtain:
−1 −1
ln∣6 − 2y ∣ = x + ln∣4∣
2 2
−1
[ln∣6 − 2y ∣ − ln 4] = x
2
ln (6 − 2y )
= −2x
4
6 − 2y
= e−2x
4
6 − 2y = 4e−2x
y = 3 − 2e−2x
dy
Checking our solution: = 4e−2x and so
dx
dy
LHS = + 2y
dx
=6
= RHS
https://www.intmath.com/differential-equations/2-separation-variables.php 6/14
23.10.22, 19:29 2. Separation of Variables
0
Also, when x = 0, y = 3 − 2e = 1.
−2x
So the particular solution is given by: y = 3 − 2e
x
5
4
3
2
1
t
-3 -2 -1 1 2 3 4 5
-1
-2
-3
-4
-5
Solution graph y = 3 − 2e−2x , showing the curve passing through (0, 1).
Example 7
Solve
x dy = y ln y dx ,
given
x = 2 when y = e.
Answer
Separating variables:
x dy = y ln y dx
dy dx
=
y ln y x
dy dx
∫ =∫
y ln y x
ln (ln y ) = ln x + K
Substituting x = 2 when y = e gives:
ln (ln e) = ln 2 + K
ln (1) = ln 2 + K
0 = ln 2 + K
K = − ln 2
Substituting this in our general solution:
x
ln (ln y ) = ln x − ln 2 = ln
2
https://www.intmath.com/differential-equations/2-separation-variables.php 7/14
23.10.22, 19:29 2. Separation of Variables
y = ex/2
x
5
1
t
-5 5
-1
-2
x/2
Solution graph y = e , showing the curve passes through (2, e).
di
Ri + L =V
dt
Answer
di
10i + 3 = 50
dt
di
3 = 50 − 10i
dt
https://www.intmath.com/differential-equations/2-separation-variables.php 8/14
23.10.22, 19:29 2. Separation of Variables
di dt
=
(50 − 10i) 3
Integrate.
1 di 1
∫ = ∫ dt
10 5 − i 3
1 t
− ln (5 − i) = + K
10 3
Since i(0) = 0,
1
− ln (5 − 0) = 0 + K
10
− ln 5
K=
10
1 t ln 5
− ln (5 − i) = −
10 3 10
t 1 ln 5
− = ln (5 − i) −
3 10 10
10t 5−i
− = ln
3 5
5−i
e−10t/3 =
5
5e−10t/3 = 5 − i
The graph shows that the current builds up and levels out at a maximum value of 5 A.
i
6
1
t
1 2 3 4
-1
NOTE: We could have solved this for i another way. Here it is - you may find it easier.
https://www.intmath.com/differential-equations/2-separation-variables.php 9/14
23.10.22, 19:29 2. Separation of Variables
1 t ln 5
− ln (5 − i) = −
10 3 10
10t
ln (5 − i) = − + ln 5
3
Air resistance depends on the size and shape of the item that is dropping through the air.
We use the constant k to represent the amount of air resistance. It is called the coefficient
of drag.
The air resistance is proportional to the square of the velocity, so the upwards resistance
force due to air resistance can be represented by
Fair = kv 2.
Dividing throughout by m gives us a good model for the velocity v of an object falling through the air:
k 2
a= v −g
m
dv k
= v2 − g
dt m
Image source.
Questions
https://www.intmath.com/differential-equations/2-separation-variables.php 10/14
23.10.22, 19:29 2. Separation of Variables
b. Find the velocity after 5 seconds for a sky diver of mass m = 80 kg and k = 0.2
c. Find the terminal velocity for any object for general values of g and k.
d. Find the terminal velocity our skydiver with mass m = 80 kg and k = 0.2.
Answer
dv k
= v2 − g
dt m
dv k 2
= g( v − 1)
dt mg
mg
c=
k
So:
1 k
=
c2 mg
dv v2
= g ( 2 − 1)
dt c
dv v 2 − c2
= g( )
dt c2
c2 dv
= g dt
v 2 − c2
dv
c2 ∫ = ∫ g dt
v2 − c2
We multiply the fraction by −1, thus reversing the order of (v 2 − c2 ), and also at the front to compensate, so the
substitution step coming up later is possible. (Otherwise, we would be trying to find the log of a negative number
when finding K .)
dv
−c2 ∫ = ∫ g dt
c2 − v2
1. Factor the denominator, use partial fractions and then integrate (it needs the logarithm form), or
2. Use a table of integrals (integral #13), (easier); or
3. Use a computer algebra system, like Scientific Notebook. (easiest)
https://www.intmath.com/differential-equations/2-separation-variables.php 11/14
23.10.22, 19:29 2. Separation of Variables
1 c+v
(−c2 ) ln ( ) = gt + K
2c c−v
c c+v
− ln ( ) = gt
2 c−v
c+v 2gt
ln ( )=−
c−v c
c + v = (c − v )e−2gt/c
c + v = ce−2gt/c − ve−2gt/c
ve−2gt/c + v = ce−2gt/c − c
e−2gt/c − 1
v=c
e−2gt/c + 1
First, we find c for our given situation. This was the expression for c:
mg
c=
k
We use the given mass and the coefficient of drag for the skydiver.
mass = m = 80 kg
So
mg
c=
k
80 × 9.8
=
0.2
= 62.6
Next, we substitute the given time value (t = 5) and c = 62.6 to find the required velocity:
e−2gt/c − 1
v=c
e−2gt/c + 1
https://www.intmath.com/differential-equations/2-separation-variables.php 12/14
23.10.22, 19:29 2. Separation of Variables
−2(9.8)(5)/62.6
e −1
= 62.6 −2(9.8)(5)/62.6
e +1
= −40.9580
The units are ms -1, so the velocity at time t = 5 s is approximately 147 km/h (1 ms -1 = 3.6 km/h), in the downward
direction.
c. Terminal velocity
e−2gt/c − 1
v=c
e−2gt/c + 1
As t → ∞, the value of the fraction approaches −1, since e -2gt/c → 0, giving us the terminal velocity v = −c.
So
mg
c=
k
Note: We could have obtained the above expression without knowing the expression for velocity at time t, by simply
noting the velocity of the object reaches terminal velocity when the acceleration is 0.
That is, solving the following acceleration expression to find the velocity:
k 2
a= v −g =0
m
mg
v=
k
We already found the expression for c (which is the terminal velocity) in Part (b)
mg
c=
k
80 × 9.8
=
0.2
= 62.6
The graph of the velocity against time shows that it takes around 15 seconds to reach (or "get very close to") the
terminal velocity:
https://www.intmath.com/differential-equations/2-separation-variables.php 13/14
23.10.22, 19:29 2. Separation of Variables
v t
-20 5 10 15 20 25
-40
-60
-80
-100
-120
-140
-160
-180
-200
-220
-240
e−2(9.8)t/62.6 − 1
Velocity graph v = 225 , showing the point (5, −147).
e−2(9.8)t/62.6 + 1
Note:
1. The graph shows that the terminal velocity is never actually reached - the skydiver's velocity just gets closer
and closer to that velocity.
2. The graph includes the point representing the velocity at time t = 5, found earlier.
3. Actually, the air resistance increases as the air gets more dense nearer the Earth's surface. We have
assumed it remains constant for this problem.
4. The human sky diver can change k easily by either spreading their arms and legs (which will slow them
down), or diving down with arms and legs tightly together (which will increase their speed)
https://www.intmath.com/differential-equations/2-separation-variables.php 14/14