You are on page 1of 10

Separation of Variables

As mentioned before, a first-order differential equation can be written in the form

M (x, y) dx + N (x, y) dy = 0 (1)

where M and N ay both functions of x and y.

If an equation in the form of (1) can be written in the form

A (x) dx + B (y) dy = 0 (2)

then the equation is said be variable separable. The solution can be immediately obtained
by integrating both sides of (2).
Z Z
A (x) dx + B (y) dy = c

Another definition:
A first-order differential equation in the form
dy
= g(x)h(y)
dx
is said to have separable variable.
Example 1.

Solve the equation


(1 − x)y 0 = y 2
Solution:
The given equation can be written as

dy
(1 − x) = y2
dx
multiplying both sides by dx,

(1 − x)dy = y 2 dx

Dividing the entire equation by (1 − x)y 2 , yields to

dy dx
=
y2 1−x
Integrating both sides of the equation gives,
Z Z
dy dx
2
=
y 1−x
1
− = − ln |1 − x| + c
y
1
− = − ln |1 − x| + ln c
y
Simplifying gives the final result as

y ln |c(1 − x)| = 1
Example 2.

Solve the equation


sin x sin ydx + cos x cos ydy = 0
Solution:
Using separation of variables,

sin x sin y dx = − cos x cos y dy


sin x cos y
dx = − dy
cos x sin y
tan x dx = − cot y dy

Integrating both sides


Z Z
tan x dx + cot y dy = c

− ln | cos x| + ln | sin y| = ln |c|

Simplifying the results,

− ln | cos x| + ln | sin y| = ln |c|


ln | sin y| + ln | cos x| = ln |c|

sin y
ln = ln |c|
cos x
sin y
=c
cos x
sin y = c cos x
Example 3.

Solve the equation


2
xy 3 dx + ex dy = 0
Solution:
1
Multiply both sides by ex2 y 3
.

xdx dy
+ 3 =0
ex2 y
2 dy
xe−x dx + 3 = 0
y
Integrating both sides of the equation,
Z Z
−x2 dy
xe dx + =c
y3
1 2 1
− e−x − y −2 = c
2 2
2
e−x + y −2 = −2c
2
e−x + y −2 = c
Example 4.

Solve the equation


2y dx = 3x dy
Solution:
1
Multiply both sides of the equation by ,
xy

1 1
(2y dx) = (3x dy)
xy xy
2 dx 3 dy
=
x y
Integrating both sides,

2 dx 3 dy
=
x y
Z Z
dx dy
2 =3 +c
x y
2 ln |x| = 3 ln |y| + ln |c|
ln |x2 | = ln |y 3 | + ln |c|
ln |x2 | = ln |cy 3 |
x2 = cy 3
Example 5.

Solve the equation


ye2x dx = (4 + e2x )dy
Solution:
1
Multiply both sides of the equation by ,
y(4 + e2x )

1 2x
  2x
 1
2x
ye dx = (4 + e )dy
y(4 + e ) y(4 + e2x )
e2x dx dy
2x
=
4+e y
Integrating both sides, we have

e2x dx
Z Z
dy
= +c
4 + e2x y
1
ln |4 + e2x | = ln |y| + ln |c|
2
ln |4 + e2x | = 2 ln |y| + 2 ln |c|
ln |4 + e2x | = ln |y 2 | + ln |c2 |
ln |4 + e2x | = ln |c2 y 2 |
4 + e2x = c2 y 2

Notice that c2 can be written as just c, since they are both arbitrary, but we should
note that the left side of the equation is always greater than 0. Therefore, if we just write c,
we will be restricted to values of c ≥ 0.
Example 6.

Solve the equation


dr = b (cos θ dr + r sin θ dθ)
Solution:
Rewrite the given equation as

dr = b cos θ dr + br sin θ dθ
dr − b cos θ dr = br sin θ dθ
(1 − b cos θ) dr = br sin θ dθ

Divide the equation by (1 − b cos θ)r,

dr b sin θdθ
=
r 1 − b cos θ
Integrating both sides of the equation,
Z Z
dr b sin θdθ
= +c
r 1 − b cos θ
ln |r| = ln |1 − b cos θ| + ln |c|
ln |r| = ln |c(1 − b cos θ)|
r = c(1 − b cos θ)
Example 7.

Solve the equation


xydx − (x + 2)dy = 0
Solution:
Dividing the equation by y(x + 2)

x dx dy
− =0
x+2 y

Integrating both sides of the equation,


Z Z
x dx dy
− c
x+2 y
Z   Z
2 dy
1− dx − =c
x+2 y
x − 2 ln |x + 2| − ln |y| = ln |c|
x = ln |x + 2|2 + ln |y| + ln |c|
x = ln |cy(x + 2)2 |
2
ex = eln |cy(x+2) |
ex = cy(x + 2)2
Example 8.

Solve the equation


xy 3 dx + (y + 1)e−x dy = 0
Solution:
Divide the equation by y 3 e−x ,

xdx (y + 1)dy
− =0
e−x y3
xex dx − y −3 (y + 1)dy = 0

Integrating both sides,


Z Z
x
xe dx − y −3 (y + 1)dy = c
1 1
xex − ex − − 2 =c
y 2y
1 1
ex (x − 1) = + 2 + c
y 2y
Example 9.

Solve the particular solution given the initial condition equation 2xyy 0 = 1 + y 2 , when x = 2
and y = 3.

Solution:
Divide the given equation by x(1 + y 2 ),

2xyy 0 = 1 + y 2
dy
2xy = 1 + y2
dx
2y dy dx
2
=
1+y x
Integrate both sides of equation
Z Z
2ydy dx
2
=
1+y x
2
ln |1 + y | = ln |x| + ln |c|
ln |1 + y 2 | = ln c|x|
1 + y 2 = cx

When x = 2, and y = 3, then

1 + y 2 = cx
1 + 32 = c(2)
c=5

Therefore, the particular solution of the differential equation is

1 + y 2 = 5x

You might also like