You are on page 1of 40

17

Chapter 2: Some Techniques of Solving Ordi-


nary Differential Equations
Chapter Overview
This chapter focused on solving some differential equations. We also determine appro-
priate techniques in solving ordinary differential equations.

Learning Objectives
At the end of this chapter, the student is expected to

1. solve ordinary differential equations by separation of variables, if applicable

2. select an appropriate technique in solving ordinary differential equations of order


one

2.1 Separable Variables


We now begin solving differential equations with the simplest of all the differential equations:
first-order ordinary differential equations with separable variables. In this point forward,
the students are urged to refresh their knowledge in basic and advanced techniques of in-
tegration (integration by substitution, integration by parts, partial fraction decomposition,
etc.).

Definition 1: Separable Equation


A first-order differential equation of the form
dy
= g(x)h(y)
dx
is said to be separable or to have separable variables.

dy dy
For example, = y 2 xe3x+4y is separable, while = y + sin x is nonseparable.
dx dx
dy dy   dy
= y 2 xe3x+4y can be written as = y 2 xe3x e4y = xe3x y 2 e4y but for = y + sin x,
dx dx dx
there is no way that y + sin x can be written as a product of a function of x and a function
of y.
18

Example 1. Find the general solution of the following separable DE.


dy x2 + 2
1. − =0
dx y

Solution: By separating variables, and applying integral to each term, we have

y dy = (x2 + 2) dx
Z Z
y dy = (x2 + 2) dx
y2 x3
= + 2x + c1
2 3
Solve for y by multiplying both sides of the equation by 2 and then extracting square
roots of both sides.
2x3
y2 = + 4x + 2c1 but 2c1 can be written as C
3
r r
2x3 2x3 p
∴ |y| = + 4x + C or y = ± + 4x + C since y 2 = |y|
3 3

dy
2. x = (1 − 2x2 ) tan y
dx
Solution: By separating variables, we have

dy 1 − 2x2
= dx
tan y x
Z Z  
1
cot y dy = − 2x dx
x
ln |sin y| = ln |x| − x2 + c1 ←− take the exponential of both sides
2 +c
eln|sin y| = eln|x|−x 1

2 2
|sin y| = eln|x| · e−x · ec1 = |x| · e−x · ec1 ←− by rules of exponents
c1 −x2
sin y = ±e · x · e ←− definition of absolute value
−x2
sin y = Cxe ←− note that ± ec1 = C since ec1 is constant
 2

∴ y = sin−1 Cxe−x ←− general solution
19

3. sec2 x dy + csc y dx = 0

Solution: By separating the variables, we have


dy dx
+ =0
csc y sec2 x
Z Z Z
1 + cos 2θ
sin y dy + cos x dx = 0dx ←− Use identity cos2 θ =
2
2
Z Z   Z
1 + cos 2x
sin ydy + dx = 0dx
2
Z Z Z Z
1 cos 2x
sin ydy + dx + dx = 0dx
2 2
1 1 1
− cos y + x + · sin 2x = c1 ←− Multiply both sides by 4
2 2 2
∴ −4 cos y + 2x + sin 2x = 4c1 or 4 cos y = 2x + sin 2x + C where C = −4c1

dy xy + 3x − y − 3
4. =
dx xy − 2x + 4y − 8

Solution: Express the right side of the DE in factored form.

dy x(y + 3) − (y + 3)
=
dx x(y − 2) + 4(y − 2)
dy (y + 3)(x − 1)
=
dx (y − 2)(x + 4)
Separate the variables and then integrate both sides.
Z   Z  
y−2 x−1
dy = dx
y+3 x+4
Z   Z  
5 5
1− dy = 1− dx
y+3 x+4

y − 5 ln |y + 3| = x − 5 ln |x + 4| + C

We can also write the answer as


(y + 3)5

y − x = 5 ln |y + 3| − 5 ln |x + 4| + C =⇒ y − x = ln +C
(x + 4)5
(y + 3)5


ln +C
y−x (x + 4) 5
=⇒ e =e

 5
y−x y+3
=⇒ e =K ; K = eC
x+4
20

dP
5. = P − P2
dt
Solution: By separating the variables and applying integral on both sides, we have
Z Z
dP dP
= dt =⇒ = dt
P − P2 P (1 − P )
Z
dP
can be solved using partial fraction decomposition. That is,
P (1 − P )

1 A B
= +
P (1 − P ) P 1−P
1 = A(1 − P ) + B(P )
Let P = 0, 1 = A
Let P = 1, 1 = B

Hence, Z Z
dP
= dt
P (1 − P )
Z   Z
1 1
+ dP = dt
P 1−P
Z Z Z
dP dP
+ = dt
P 1−P
ln |P | − ln |1 − P | = t + c1
To solve for P in terms of t, apply some properties of exponents and logarithms.

P
ln |P | − ln |1 − P | = t + c1 =⇒ ln = t + c1
1−P

P

ln

1 − P

e = et+c1 = et · ec1
P
= Cet , C = ±ec1
1−P
P = Cet − P · Cet
P 1 + Cet = Cet


Cet
∴, P =
1 + Cet
21

dy
Remarks 1. To solve for a separable differential equation of the form = g(x)h(y), we
dx
dy
tend to write the equation as = g(x)dx. In this case, there is a possibility to have a
h(y)
variable divisor that could be zero. For an instance, if a is a zero of the function h(y), then
dy
y = a is a constant solution of the differential equation = g(x)h(y). Applying separation
dx
dy
of variables, the left-hand side of = g(x)dx is now undefined at a. As a result, y = a
h(y)
may not come up in the family of solutions obtained after applying integration and using
some simplifications. Such solution is called a singular solution (which have been mentioned
in Chapter 1).

Example 2. Solve the following IVP by separation of variables.


dy x
1. + = 0 ; y(4) = −3
dx y

Solution: By separating variables and taking the integral of both sides, we have

y dy + x dx = 0
Z Z Z
y dy + x dx = 0 dx
y 2 x2
+ = c1
2 2
x2 + y 2 = C ←− general solution

The general solution x2 + y 2 = C determines a solution which represents a family of


concentric circles centered at the origin.

Now, the initial condition y = −3 when


x = 4 implies C = (4)2 + (−3)2 = 25.
Thus a solution to the IVP is
x2 + y 2 = 25 (which is a circle with
radius 5 and centered at the origin). The

explicit solutions are y = ± 25 − x2
and the solution curve that satisfies the
condition is the lower semi-circle which
passes through (4, −3).
22

dy
2. (e2y − y) cos x = ey sin(2x) ; y(0) = 0
dx
Solution: By separating variables, we have

e2y − y sin(2x)
y
dy = dx
Z e Z cos x
2 sin x cos x
ey − ye−y dy =

dx ←− Use sin 2θ = 2 sin θ cos θ
cos x
Z Z Z
ey dy − ye−y dy = 2 sin x dx ←− use Integration by Parts

ey − −ye−y − (e−y ) = 2(− cos x) + C


 

ey + ye−y + e−y = −2 cos x + C ←− general solution

Now, the initial condition y = 0 when x = 0 implies C = e0 + (0)e0 + e0 + 2 cos(0) = 4.


Thus a solution to the IVP is ey + ye−y + e−y = 4 − 2 cos x .
Z
*For ye−y dy Z Z
−y
ye dy = −ye − −e−y dy
−y −y
Let u = y and dv = e dy
Then du = dy and v = −e−y = −ye−y − e−y + c1

Some Applications

I. Newton’s Law of Cooling/Warming: The rate at which the temperature of a body


changes is proportional to the difference between the temperature of the body and the tem-
perature of the surrounding medium, the so-called ambient temperature. If T (t) represents
the temperature of a body at time t > 0; Tm the temperature of the surrounding medium,
dT
and the rate at which the temperature of the body changes, then Newton’s law of cool-
dt
ing/warming translates into the separable differential equation

dT
= k(T − Tm ),
dt

where k is a constant of proportionality. In either case, cooling or warming, if Tm is a con-


stant, it stands to reason that k < 0.

Example 3. A copper ball is heated to 100◦ C. It is then placed in water that is maintained
at 30◦ C. After 3 minutes, the temperature of the ball is 60◦ C. Find the time at which the
temperature of the ball will be 31◦ C.
Solution: We identify Tm = 30◦ C and T (3) = 60. We set the IVP

dT
= k(T − 30), T (0) = 100
dt
23

and determine the value of t so that T (t) = 31◦ C. By separating variables,

Z Z
dT dT
= k dt ⇐⇒ = k dt
T − 30 T − 30
ln |T − 30| = kt + C1 ←− take the exponential of both sides
T − 30 = ekt+C1 = ekt eC1
T = 30 + Cekt ←− note that eC1 = C is constant
When t = 0, then T = 100. So that, 100 = 30 + Cek(0) =⇒ C = 70.
Substitute C = 70 to T = 30 + Cekt . We have T = 30 + 70ekt .
Now, T = 60 when t = 3 (minutes). So that 60 = 30 + 70e3k ⇐⇒ 30 = 70e3k .
30
Solving for k we have e3k = ←− take the ln of both sides
  70
 
3 1 3
3k = ln =⇒ k = ln =⇒ k ≈ −0.2824.
7 3 7
Substitute k = −0.2824 to T = 30 + Cekt . We have T = 30 + 70e−0.2824t .
We want t when T = 31. Thus,
31 = 30 + 70e−0.2824t ⇐⇒ 1 = 70e−0.2824t
 
−0.2824t 1 1
e = ⇐⇒ −0.2824t = ln
70 70
 
1 1
t=− ln
0.2824 70
∴ t = 15.04 minutes

II. Water Tank Problem: Suppose that water is draining out from a large cylindrical
tank through a small hole or tap at the bottom. Then the depth of water remaining in the
tank is constantly changing, call it h(t) where t is time. From the theory of fluid mechanics
(Bernoulli’s equation), it can be shown that h(t) must satisfy the differential equation

dh √
= −k h ,
dt

where k is some constant depending on the tap radius at the bottom, the tank radius, and
the acceleration due to gravity.
Problem: Let H be the initial depth of the tank, so that h(0) = H. Determine the time t
so that the tank will be empty, that is, h(t) = 0.
24

Solution:
dh √
We set the IVP: = −k h , h(0) = H.
dt
By separating variables, we have
Z Z
dh −1/2
1/2
= −k dt ⇐⇒ h dh = −k dt ⇐⇒ 2h1/2 = −kt + C
h
Since h(0) = H, t = 0 and h = H, then 2H 1/2 = −k(0) + C =⇒ C = 2H 1/2 .
Substitute C = 2H 1/2 to 2h1/2 = −kt + C. We have,
2h1/2 = −kt + 2H 1/2 ←− solve for h
 1/2 2
1/2 1/2 2H − kt
2h = 2H − kt ⇐⇒ h =
2
Solve for t when h = 0. ←− this is the case where the tank is empty
 1/2 2
2H − kt
0= ⇐⇒ kt = 2H 1/2
2

2H 1/2 2 H
∴ t= or t =
k k

More examples on applications of differential equations will be discussed on a separate chap-


ter.

2.2 Linear First-Order Equation


From Chapter 1, we already discussed the linearity of ODEs. In this section, we focus on
finding solutions for the linear first-order ODEs.

Definition 2: Linear Equation


A first-order differential equation of the form
dy
a1 (x) + a0 (x)y = g(x) (1)
dx
is said to be a linear equation in the dependent variable y.
25

Remarks 2.

1. When g(x) = 0, the linear equation is said to be homogeneous; otherwise, it is called


nonhomogeneous.

2. By dividing both sides of (1) by the leading coefficient a1 (x), we obtain a more useful
form, the standard form, of a linear equation:
dy
+ P (x)y = f (x) (2)
dx
Our goal is to seek a solution of (2) for which both coefficient functions P (x) and f (x)
are continuous.

3. The differential equation (2) has the property that its solution is the sum of the two
solutions: y = yc + yp , where yc (called complementary solution) is a solution of
the associated homogeneous equation
dy
+ P (x)y = 0 (3)
dx
and yp is a particular solution of the nonhomogeneous equation (2).

Steps in Solving a Linear First-Order Differential Equations (Integrating Factor


Method)

1. Put a linear equation of form (1) into the standard form (2).

2. From
R the standard form identify P (x) and then find the integrating factor: I.F. =
e P (x)dx .

3. Multiply the standard form of the equation by the integrating factor. The left-hand
side of the resulting equation is automatically the derivative of the integrating factor
and y:
d h R P (x)dx i R
e y = e P (x)dx f (x) (4)
dx
4. Integrate both sides of this last equation (4).
26

Example 4. Find the solution of the following linear DE.


dy
1. − y = e2x
dx

Solution: TheR given is already in standard form. We now identify P (x) = −1.
Then I.F. = e (−1) dx = e−x . (Note: In the previous integral, we do not include +C
since this will be included in the general solution later.) Multiply I.F. = e−x to the
given DE (since the given DE is already in standard form), we have

dy
e−x − e−x y = e−x e2x

| dx{z }
d −x
e y = ex ←− refer to Step #3 and #4

dx
Z   Z
y
d x = ex dx ←− integration cancels out the derivative
e
y
= ex + C ←− solve for y
ex
∴ y = e2x + Cex ←− general solution on (−∞, ∞)

dy
2. x − 4y = x6 ex
dx
dy 4
Solution: Dividing both sides by x, we obtain the standard form: − y = x5 e x .
dx x
4 R
−4 dx/x −4 ln x ln x−4 1
We identify P (x) = − . Then I.F. = e =e =e = x−4 = 4
x x
1
Multiply I.F. = 4 to the standard form, we have
x
 
1 dy 4 1 5 x

− y = x e
x4 dx x x4
  
d 1
4
y = xex ←− refer to Step #3 and #4
dx x
Z    Z Z
1 x
d 4
y = xe dx ←− use Integration by Parts to xex dx
x
y
= xex − ex + C ←− solve for y
x4
∴ y = x5 ex − x4 ex + Cx4 ←− general solution on (0, ∞)
27

1 dy
3. · + y = 2 ; y(0) = 3
2x dx
dy
Solution: Multiplying both sides by 2x, we obtain the standard form: + 2xy = 4x
R 2
dx
We identify P (x) = 2x. Then I.F. = e 2xdx = ex .
2
Multiply I.F. = ex to the standard form, we have
 
x2 dy 2
e + 2xy = ex (4x)
dx
d  x2  2
e y = 4xex ←− refer to Step #3 and #4
Zdx   Z
x2 2
d e y = 4xex dx
Z
x2 2
ye = 2 ex (2xdx)
2 2
yex = 2ex + C ←− use u = x2 and du = 2xdx
C
y = 2 + x2 ←− general solution
e
C
Since y(0) = 3, substitute x = 0 and y = 3 to solve for C : 3 = 2 + 0 =⇒ C = 1.
e
1
∴ y = 2 + x2 ←− solution to the IVP
e
dy
4. + (tan x)y = sin(2x) ; y(0) = 1
dx

Solution: TheR given is already in standard form, so we identify P (x) = tan x.


Then I.F. = e tan x dx = eln sec x = sec x Multiply I.F. = sec x to the standard form, we
have
 
dy 1
sec x + (tan x)y = sec x [sin(2x)] ←− sec x = , sin(2x) = 2 sin x cos x
dx cos x
 
d 1
[(sec x)y] = (2 sin x cos x)
dx cos x
Z Z
d [(sec x)y] = 2 sin x dx

y sec x = −2 cos x + C
y
= −2 cos x + C
cos x
y = −2 cos2 x + C cos x ←− general solution
Since y(0) = 1, substitute x = 0 and y = 1 to solve for C :
1 = −2 (cos 0)2 + C cos 0 ⇐⇒ 1 = −2(1)2 + C(1) =⇒ C = 3.
∴ y = −2 cos2 x + 3 cos x ←− solution to the IVP
28

Example 5. Find a continuous solution satisfying



dy  1 if 0 ≤ x ≤ 3
+ 2y = f (x) wheref (x) = , y(0) = 0
dx  0 if x > 3

Solution Take note that f (x) has a discontinuity at x = 3.Consequently, we solve the
problem in two parts corresponding to the two intervals over which f is defined.
dy R
For 0 ≤ x ≤ 3, we have the standard form + 2y = 1 with I.F.: e 2dx = e2x .
dx Z Z
2x dy d 2x 
d e y = e2x dx.
2x
2x 2x 2x

Hence, e + 2e y = e =⇒ e y = e =⇒
dx dx
1 1
From the last equation, we have e2x y = e2x + c1 or y = + c1 e−2x . Since y(0) = 0, then
2 2
1 1 1 −2x
c1 = − . Therefore, y = − e if 0 ≤ x ≤ 3
2 2 2
dy R
For x > 3, we have the standard form + 2y = 0 with I.F.: e 2dx = e2x .
dx Z Z
2x dy 2x d 2x
 2x

Hence, e + 2e y = 0 =⇒ e y = 0 =⇒ d e y = 0 dx.
dx dx
From the last equation, we have e2x y = c2 or y = c2 e−2x .
We can now write
 1 − 1 e−2x if 0 ≤ x ≤ 3

y= 2 2
c2 e−2x

if x > 3
In order for y to be a continuous function, we definitely want lim− y(x) = lim+ y(x) = y(3).
x→3 x→3
1 1
Determining the value of c2 , we have c2 = e6 − .
2 2
Therefore,
1 1 −2x


 − e if 0 ≤ x ≤ 3
 2 2
y=  
1 6 1 −2x
e −


 e if x > 3
2 2
29

Example 6. Solve: ydx − 4(x + y 6 )dy = 0


Solution: Take note that the given differential equation is not linear in y because of the
term y 6 dy. Dividing both sides of the equation by ydy we have,
dx 4(x + y 6 ) dx 4
Standard Form: − = 0 =⇒ − x = y 5 (linear in x)
dy y dy y
ln y −4
R
−4dy/y −4 ln y −4 1
IF: e =e =e = y = y4
Multiply both sides of the standard form by the IF
1 dx 4
4
− 5x = y
y dy y
| {z }
 
d 1
x =y
dy y 4
Z   Z
1
d 4 x = ydy
y
1 y2
x = + c1 or 2x = y 6 + Cy 4 , y > 0
y4 2
dx
Remarks 3. If a differential equation is linear in x, then the standard form is + R(y)x =
 dy

R d R R
g(y) and IF is e R(y)dy which implies that we are going to have e R(y)dy · x = e R(y)dy ·
dy
g(y).

Some Applications

I. Series Circuits: For a series circuit containing only a resistor and an inductor,
 Kirch-

di
hoff?s second law states that the sum of the voltage drop across the inductor L and
dt
the voltage drop across the resistor (Ri) is the same as the impressed voltage (E(t)) on the
circuit.

Thus we obtain the linear differential equation for the current i(t),

di
L + Ri = E(t),
dt
where L and R are constants known as the inductance and the resistance, respectively.
The current i(t) is also called the response of the system.
30

1
Example 7. A 12-volt battery is connected to a series circuit in which the inductance is
2
henry and the resistance is 10 ohms. Determine the current i if the initial current is zero.
Solution:
1
We identify L = (henry), R = 10 (ohms), and E = 12 (volts). Then the IVP linear DE
2
will be
1 di
· + 10i = 12 ; i(0) = 0.
2 dt
di
Multiplying both sides by 2, we obtain the standard form: + 20i = 24. We identify
R R dt
P (t) = 20. Then I.F. = e P (t)dt = e 20dt = e20t .
Multiply I.F. = e20t to the standard form, we have
 
20t di
e + 20i = e20t (24)
dt
d 20t 
e i = 24e20t
Z dt Z
d e i = 24 e20t dt
20t


Z
20t 1
ie = 24 · e20t (20dt) ←− use u = 20t and du = 20dt
20
6
ie20t = e20t + C
5
6 C
i = + 20t ←− general solution
5 e
Since i(0) = 0, substitute t = 0 and i = 0 to solve for C :
6 C 6
0 = + 20(0) =⇒ C = − .
5 e 5
6 6
Therefore the current/response is i = − 20t
5 5e

II. Free Falling Body with Air Resistance: This concerns a body falling under gravity
with air resistance. Let x(t) be the downward displacement at time t from the point of
release, then the differential equation is
d2 x dx
2
=g−k ,
dt dt
dx
where k is the air resistance with constant k and g is the acceleration due to gravity.
dt
Problem: Determine the solution x(t) to the above differential equation subject to the
initial conditions: x(0) = 0 and x0 (0) = 0. [Note that x(0) = 0 implies that the particle is
initially at the point and release, and x0 (0) = 0 implies that the particle is released from
rest, so that the initial velocity is zero.]
31

dx
Solution: Let v = . Then the differential equation can be rewritten as
dt
dv dv
= g − kv ⇐⇒ + kv = g
dt dt
which isRnow a linear
R differential equation in standard form. We identify P (t) = k and
I.F. = e P (t)dt = e kdt = ekt . Multiply I.F. = ekt to the standard form, we have
 
kt dv
e + kv = ekt (g)
dt
d kt 
e v = gekt
Z dt Z
d e v = gekt dt
kt


Z
kt 1
ekt (kdt) ←− g, k are constants

ve = g ·
k
g
vekt = ekt + C1
k
g C1
v = + kt ←− general solution
k e
0
Since x (0) = 0, so v(0) = 0. Substitute t = 0 and v = 0 to solve for C1 :
g C1 g
0 = + k(0) =⇒ C1 = −
k e k
g g g g −kt
Hence, v = − kt ⇐⇒ v = − e
k ke k k
dx dx g g
But v = , so that = − e−kt
dt dt k k
Integrating with respect to t, we have
Z Z h
g g −kt i
dx = − e dt
k k
Z Z Z
g g
dx = dt − e−kt dt
k k
g
Z g   1 Z
x= dt − − e−kt (−kdt)
k k k
gt g
x= + 2 e−kt + C2
k k
Since x(0) = 0, substitute t = 0 and x = 0 to solve for C2 :
g(0) g g
0= + 2 e−k(0) + C2 =⇒ C2 = − 2
k k k
gt g g
Therefore the downward displacement is x = + 2 e−kt − 2
k k k
32

g g g g
Nice to know: From the equation v = − e−kt , if t → ∞, then v → . We call
k k k k
the terminal velocity. For a free falling parachutist, the terminal velocity is about 193
km/hour (before the parachute opened!).

Activity 1

A. Solve the following differential equations by separation of variables.


dy
1. = e3x+2y
dx
 2
dx y+1
2. y ln x =
dy x
2 3
3. ey + 1 e−y dx + ex + 1 e−x dy = 0
π
4. sin x cos2 y dx + cos2 x dy = 0, y(0) =
4

p √ 3
5. 1 − y 2 dx − 1 − x2 dy = 0, y(0) =
2
B. Find the general solution of the given differential equations and give the largest interval
over which the general solution is defined.
dy
1. x + 4y = x3 − x
dx
dy
2. (x + 1) + (x + 2)y = 2xe−x
dx
dr
3. + r sec θ = cos θ

4. cos2 x sin x dy + (y cos3 x − 1)dx = 0
dy
5. x + (3x + 1)y = e−3x
dx
C. Find a continuous solution satisfying

dy  x if 0 ≤ x < 1
+ 2xy = f (x) where f (x) = , y(0) = 2
dx  0 if x ≥ 1
33

2.3 Exact Equations


Recall from Calculus 1: If z = f (x, y) is a function of two variables with continuous first
partial derivatives in a region R of the xy-plane, then its differential is
∂f ∂f
dz = dx + dy (1)
∂x ∂y

In the special case when f (x, y) = c, where c is a constant, then (1) implies

∂f ∂f
dx + dy = 0 (2)
∂x ∂y

In other words, given a one-parameter family of functions f (x, y) = c, we can generate a


first-order differential equation by computing the differential of both sides of the equality.

Example 8. If f (x, y) = x2 − 5xy + y 3 = c, then (2) gives the first order DE:

∂f ∂f
dx + dy = 0
∂x ∂y
∂ 2 ∂ 2
(x − 5xy + y 3 ) dx + (x − 5xy + y 3 ) dy = 0
∂x ∂y
(2x − 5y)dx + (−5x + 3y 2 )dy = 0
[Note that in partial derivative with respect to x, we treat y as a constant (and vice versa).]

Notations:
∂f ∂f
We use the notation := M (x, y) and := N (x, y). Then (2) can be rewritten as
∂x ∂y

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

∂f ∂f
We can see from Example 8 that = M (x, y) = 2x − 5y and = N (x, y) = −5x + 3y 2 .
∂x ∂y
Definition 3: Exact Equation

A differential expression M (x, y)dx + N (x, y)dy is an exact differential in a region


R of the xy-plane if it corresponds to the differential of some function f (x, y) defined
in R.
A first-order differential equation of the form

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

is said to be an exact equation if the expression on the left-hand side is an exact


differential.
34

Theorem 1: Criterion for an Exact Differential


Let M (x, y) and N (x, y) be continuous and have continuous first partial derivatives
in a rectangular region R defined by a < x < b, c < y < d. Then a necessary and
sufficient condition that M (x, y)dx + N (x, y)dy be an exact differential is

∂M ∂N
= (4)
∂y ∂x

Remarks 4. The idea of the previous theorem relies on the fact that

∂ 2f ∂ 2f
   
∂ ∂f ∂ ∂f
= = =
∂y ∂x ∂y ∂x ∂x ∂y ∂x ∂y

Therefore,    
∂M ∂ ∂f ∂ ∂f ∂N
= = =
∂y ∂y ∂x ∂x ∂y ∂x
Method of Solution: Given an equation in the differential form M (x, y)dx+N (x, y)dy = 0,
determine whether the equality in (4) holds. If it does, then there exists a function f for
which
∂f
= M (x, y).
∂x
We can find f by integrating M (x, y) with respect to x while holding y constant:
Z
f (x, y) = M (x, y)dx + g(y), (5)

where the arbitrary function g(y) is the constant of integration. Now differentiate (5) with
∂f
respect to y and assume that = N (x, y) :
∂y
Z
∂f ∂
= M (x, y) dx + g 0 (y) = N (x, y).
∂y ∂y
This gives Z
0 ∂
g (y) = N (x, y) − M (x, y) dx (6)
∂y
Finally, integrate (6) with respect to y and substitute the result in (5). The (implicit)
general solution of the exact DE is of the form f (x, y) = C.
∂f
We can also start the foregoing procedure with the assumption that = N (x, y). After
∂y
integrating N with respect to y and then differentiating that result, we would find the
analogues of (5) and (6) to be, respectively,
Z Z
0 ∂
f (x, y) = N (x, y) dy + h(x) and h (x) = M (x, y) − N (x, y) dy.
∂x
35

Example 9. Find the solution of the following exact DE.


1. 2xy dx + (x2 − 1) dy = 0

Solution: We identify M (x, y) = 2xy and N (x, y) = x2 − 1. Then


∂M ∂
= (2xy) = 2x
∂y ∂y
∂N ∂ 2
= (x − 1) = 2x
∂x ∂x
∂M ∂N
∴ =
∂y ∂x
Thus, the DE is exact. By Theorem 1, there exists a function f (x, y) such that
∂f ∂f
M (x, y) = = 2xy and N (x, y) = = x2 − 1.
∂x ∂y
∂f
Integrating M (x, y) = = 2xy with respect to x, we have
∂x
Z Z Z
∂f
dx = f (x, y) = 2xy dx = 2y x dx ←− y is treated as a constant
∂x
 2
x
f (x, y) = 2y + g(y) ←− g(y) is the constant of integration
2
f (x, y) = x2 y + g(y)
Taking the partial derivative of f (x, y) = x2 y + g(y) with respect to y and equating to
N (x, y), we have
∂ ∂ 2
f (x, y) = [x y + g(y)] = x2 + g 0 (y) = x2 − 1 = N (x, y)
∂y ∂y
It follows that g 0 (y) = −1. Integrating g 0 (y) with respect to y, we have
Z Z
0
g (y) dy = −dy ⇐⇒ g(y) = −y.

Take note that no arbitrary constant is needed in obtaining g(y) since there is one
already on the right side in the solution f (x, y) = C
Hence, f (x, y) = x2 y + g(y) = x2 y − y.
Therefore, the (implicit) general solution to the exact DE is
f (x, y) = C ⇐⇒ x2 y − y = C

∂f
Alternative Solution: In this case, we choose to integrate N (x, y) = = x2 − 1
∂y
with respect to y, we have
Z Z Z
∂f 2 2
dy = f (x, y) = (x − 1) dy = (x − 1) dy ←− x treated as constant
∂y
f (x, y) = (x2 − 1)y + h(x) ←− h(x) is the constant of integration
f (x, y) = x2 y − y + h(x)
36

Taking the partial derivative of f (x, y) = x2 y − y + h(x) with respect to x and equating
to M (x, y), we have

∂ ∂ 2
f (x, y) = [x y − y + h(x)] = 2xy + h0 (x) = 2xy = M (x, y)
∂x ∂x
It follows that h0 (x) = 0. Integrating h0 (x) = 0 with respect to x will give us h(x) = c1 .
Hence, f (x, y) = x2 y − y + h(x) = x2 y − y + c1 , where c1 is constant
Therefore, the (implicit) general solution to the exact DE is

f (x, y) = C ⇐⇒ x2 y − y = C

2. [e2y − y cos(xy)] dx + [2xe2y − x cos(xy) + 2y] dy = 0

Solution: We identify M (x, y) = e2y − y cos(xy) and N (x, y) = 2xe2y − x cos(xy) + 2y.
Then
∂M ∂ 2y
= [e − y cos(xy)] = 2e2y + xy sin(xy) − cos(xy)
∂y ∂y
∂N ∂
= [2xe2y − x cos(xy) + 2y] = 2e2y + xy sin(xy) − cos(xy)
∂x ∂x
∂M ∂N
∴ =
∂y ∂x

Thus, the DE is exact. By Theorem 1, there exists a function f (x, y) such that

∂f ∂f
M (x, y) = = e2y − y cos(xy) and N (x, y) = = 2xe2y − x cos(xy) + 2y
∂x ∂y

[Note: The choice between M (x, y) or N (x, y) in solving for f (x, y) is up to the reader.
But in this example, we choose N (x, y) as our working function.]
∂f
Integrating N (x, y) = = 2xe2y − x cos(xy) + 2y with respect to y (treat x as
∂x
constant), we have
Z Z
∂f
dy = f (x, y) = [2xe2y − x cos(xy) + 2y]dy
∂y
Z Z Z
2y
f (x, y) = 2x e dy − x cos(xy)dy + 2 y dy
Z Z Z
1 2y

f (x, y) = 2x · e (2dy) − [cos(xy)](x dy) + 2 y dy
2
f (x, y) = xe2y − sin(xy) + y 2 + h(x); h(x) is constant of integration
37

Taking the partial derivative of f (x, y) = xe2y − sin(xy) + y 2 + h(x) with respect to x
and equating to M (x, y), we have

∂ ∂
f (x, y) = [xe2y − sin(xy) + y 2 + h(x)]
∂x ∂x
= e2y − y cos(xy) + h0 (x)
= e2y − y cos(xy) = M (x, y)

It follows that h0 (x) = 0. Integrating h0 (x) = 0 with respect to x will give us h(x) = c1 .
Hence, f (x, y) = xe2y − sin(xy) + y 2 + c1
Therefore, the (implicit) general solution to the exact DE is

f (x, y) = C ⇐⇒ xe2y − sin(xy) + y 2 = C

3. (cos x sin x − xy 2 )dx + y(1 − x2 )dy = 0 ; y(0) = 2 ←− IVP Exact DE

Solution: We identify M (x, y) = cos x sin x − xy 2 and N (x, y) = y(1 − x2 ). Then

∂M ∂
= (cos x sin x − xy 2 ) = −2xy
∂y ∂y
∂N ∂
= [y(1 − x2 )] = −2xy
∂x ∂x
∂M ∂N
∴ =
∂y ∂x

Thus, the DE is exact. By Theorem 1, there exists a function f (x, y) such that

∂f ∂f
M (x, y) = = (cos x sin x − xy 2 ) and N (x, y) = = y(1 − x2 )dy
∂x ∂y

∂f
Integrating N (x, y) = = y(1 − x2 ) with respect to y, we have
∂y
Z Z
∂f
dy = f (x, y) = y(1 − x2 ) dy
∂y
Z
2
f (x, y) = (1 − x ) y dy ←− x is treated as a constant
y2
f (x, y) = (1 − x2 ) + h(x) ←− h(x) is the constant of integration
2
y2
Taking the partial derivative of f (x, y) = (1 − x2 ) + h(x) with respect to x and
2
equating to M (x, y), we have

∂ y2
 

f (x, y) = (1 − x ) + h(x) = −xy 2 + h0 (x) = cos x sin x − xy 2 = M (x, y)
2
∂x ∂x 2
38

It follows that h0 (x) = cos x sin x. Integrating h0 (x) with respect to x will give us
Z
1
h(x) = − (cos x)(− sin x dx) = − cos2 x
2
y2 1
Hence, f (x, y) = (1 − x2 ) − cos2 x
2 2
Therefore, the (implicit) general solution to the exact DE is

y2 1
f (x, y) = C ⇐⇒ (1 − x2 ) − cos2 x = C1
2 2
f (x, y) = C ⇐⇒ y (1 − x ) − cos2 x = C ; 2C1 = C is constant
2 2

Since y(0) = 2, substitute x = 0 and y = 2 to solve for C :


(22 )(1 − 02 ) − (cos 0)2 = C ⇐⇒ 4 − 1 = C =⇒ C = 3.
∴ y 2 (1 − x2 ) − cos2 x = 3 ←− solution to the IVP

2.4 Differential Equations with Homogeneous Coefficients


Definition 4: Homogeneous Equations

If a function f satisfies the property f (λx, λy) = λα f (x, y) for some real number α,
then f is said to be a homogeneous function of degree α. A first-order DE

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

is said to be homogeneous* if both coefficient functions M and N are homogeneous


functions of the same degree. That is, (1) is homogeneous if

M (λx, λy) = λα M (x, y) and N (λx, λy) = λα N (x, y).

Note: *Here the word homogeneous does not mean the same as it did in Section 2.2. Recall
dy
that a linear first-order equation a1 (x) + a0 (x)y = g(x) is homogeneous when g(x) = 0.
dx
Example 10.

1. f (x, y) = x3 + y 3 is homogeneous of degree 3 since


f (λx, λy) = (λx)3 + (λy)3 = λ3 x3 + λ3 y 3 = λ3 (x3 + y 3 ) = λ3 f (x, y)

2. f (x, y) = x2 y 2 + xy is not homogeneous since


f (λx, λy) = (λx)2 (λy)2 + (λx)(λy) = λ4 (x2 y 2 ) + λ2 (xy) 6= λα f (x, y) for some α ∈ R.
39

Method of Solution: If M and N are homogeneous functions of degree α, we can write


y
M (x, y) = xα M (1, u) and N (x, y) = xα N (1, u), where u = , (2)
x
x
M (x, y) = y α M (v, 1) and N (x, y) = y α N (v, 1), where v = , (3)
y
The substitutions that can be used to solve a homogeneous differential equation. Specifically,
either of the substitutions y = ux or x = vy, where u and v are new dependent variables,
will reduce a homogeneous equation to a separable first-order differential equation.

Example 11.
1. Show that (x2 + y 2 )dx + (x2 − xy)dy = 0 is a homogeneous DE and then find its
solution.
Solution: We identify M (x, y) = x2 + y 2 and N (x, y) = x2 − xy. Observe that
M and N are both homogeneous of degree 2 since
M (λx, λy) = (λx)2 + (λy)2 = λ2 (x2 + y 2 ) = λ2 M (x, y)
N (λx, λy) = (λx)2 − (λx)(λy) = λ2 (x2 − xy) = λ2 N (x, y)
Let y = ux, then dy = udx + xdu. Substitute these to the given DE, we have
 2
x + (ux)2 dx + [x2 − x(ux)](udx + xdu) = 0


(x2 + u2 x2 ) dx + (x2 − ux2 )(udx + xdu) = 0


(x2 + u2 x2 ) dx + (ux2 − u2 x2 ) dx + (x3 − ux3 ) du = 0
x2 (1 + u) dx + x3 (1 − u)du = 0
 
dx 1−u
+ du = 0 ←− by separating variables
x 1+u
 
dx 2
+ −1 + du = 0 ←− by long division
x 1+u
Z Z   Z
dx 2
+ −1 + du = 0 dx ←− integrate both sides
x 1+u
y
ln |x| − u + 2 ln |1 + u| = C ←− back substitute u =
x

y y
∴ ln |x| − + 2 ln 1 + = C ←− (implicit) general solution
x x

Note: It will be tedious to solve for the explicit general solution for y so we skip that
part. The reader can also verify that the general solution may be written as
(x + y)2 y

ln = or (x + y)2 = Cxey/x
Cx x
using the properties of logarithms. We can also use the substitution x = vy whenever
the function M (x, y) is simpler than N (x, y).
40

2. Show that (x3 − y 3 )dx + xy 2 dy = 0 is a homogeneous DE and solve the IVP: y(1) = 2.

Solution: We identify M (x, y) = x3 − y 3 and N (x, y) = xy 2 . Observe that M and N


are both homogeneous of degree 3 since

M (λx, λy) = (λx)3 − (λy)3 = λ3 (x3 − y 3 ) = λ3 M (x, y)


N (λx, λy) = (λx)(λy)2 = λ3 (xy 2 ) = λ3 N (x, y)

Let x = vy, then dx = vdy + ydv. Substitute these to the given DE, we have

(vy)3 − y 3 (vdy + ydv) + (vy)y 2 dy = 0


 

(v 3 y 3 − y 3 )(vdy + ydv) + vy 3 dy = 0
v 4 y 3 dy + v 3 y 4 dv −  3
dy − y 4 dv +  3
 
vy vy dy = 0
 
4 3 4 3
v y dy + y (v − 1)dv = 0
 3 
dy v −1
+ dv = 0 ←− by separating variables
y v4
Z Z Z Z
dy dv −4
+ − v dv = 0 dx ←− integrate both sides
y v
 −3 
v
ln |y| + ln |v| − =C
−3
1 x
ln |y| + ln |v| + 3 = C ←− back substitute v =
3v y

x 1
ln |y| + ln +  3 = C
y x
3
y
3
ln|y|
 + ln |x| − ln + y = C
|y|
  3x3
y3
ln |x| + 3 = C ←− (implicit) general solution
3x
Since y(1) = 2, substitute x = 1 and y = 2 to solve for C :
(2)3 8 8
ln |1| + 3
= C ⇐⇒ 0 + = C =⇒ C = .
3(1) 3 3
y3 8
∴ ln |x| + 3
= or 3x3 ln |x| + y 3 = 8x3 ←− (implicit) solution to the IVP
3x 3
41

Activity 2

A. Determine the value of k so that the given differential equation is exact.


 
1. y 3 + kxy 3 − 2x dx + 3xy 2 + 20x2 y 3 dy = 0
 
2. 6xy 3 + cos y dx + 2kx2 y 2 − x sin y dy = 0

B. Determine whether the given differential equation is exact. If exact, solve it.
 
1. 2xy 2 − 3 dx + 2x2 y + 4 dy = 0
dy
2. x = 2xex − y + 6x2
dx
 
3. 4t3 y − 15t2 − y dt + t4 + 3y 2 − t dy = 0

C. Solve the given differential equations with homogeneous coefficients using appropriate
substitutions.
√ 
1. −ydx + x + xy dy = 0

2. x + yey/x dx − xey/x dy = 0

D. Solve the following initial-value problems.

1. (4y + 2t − 5)dt + (6y + 4t − 1)dy = 0, y(−1) = 2


 
2. y 2 cos x − 3x2 y − 2x dx + 2y sin x − x3 + ln y dy = 0, y(0) = e
dy
3. xy 2 = y 3 − x3 , y(1) = 2
dx
42

2.5 Other Methods for First-Order ODE


Reduction to Separation of Variables

A differential equation of the form

dy
= f (Ax + By + C)
dx

can always be reduced to a differential equation with separable variables by using the sub-
stitution

u = Ax + By + C, B 6= 0.

Example 12. Solve the following differential equations.

dy
1. = (x + y + 1)2
dx
Solution:
du dy dy du
Let u = x + y + 1. Then =1+ =⇒ = − 1.
dx dx dx dx
The differential equation now becomes

du du
− 1 = u2 =⇒ = u2 + 1.
dx dx

Separate the variables and take the integral of both sides


Z Z
du
= dx
u2 + 1
tan−1 u = x + c1 ←− but u = x + y + 1
tan−1 (x + y + 1) = x + C

Solving the last equation for y: x + y + 1 = tan(x + C) =⇒ y = tan(x + C) − x − 1

dy
2. = tan2 (x + y)
dx
Solution:
du dy dy du
Let u = x + y. Then =1+ =⇒ = − 1.
dx dx dx dx
The differential equation now becomes

du du
− 1 = tan2 u =⇒ = tan2 u + 1.
dx dx
43

Separate the variables and take the integral of both sides


Z Z
du 1
2
= dx ←− use identities tan2 u + 1 = sec2 u ; cos2 u =
tan u + 1 sec2 u
Z Z
1 + cos 2u
cos2 udu = dx ←− use the identity cos2 u =
2
Z Z
1 + cos 2u
du = dx
2
Z   Z
1 cos 2u
+ du = dx
2 2
1 1
u + sin 2u = x + c1
2 4

Multiply both sides of the last equation by 4 and substitute u = x + y. Hence, we


have
2(x + y) + sin 2(x + y) = 4x + C or 2y − 2x + sin 2(x + y) = C

Coefficients Linear in Two Variables

Consider a differential equation of the form


 
a1 x + b1 y + c1 dx + a2 x + b2 y + c2 dy = 0 (1)

where a, b, c are constants. If c1 and c2 are both 0, then (1) becomes a differential equation
with homogeneous coefficient.
Now, consider the lines formed by the coefficients of dx and dy,

a1 x + b1 y + c1 = 0
(2)
a2 x + b 2 y + c 2 = 0

a1 b1
• If the lines in (2) are parallel, that is,
= , then (1) can be solved by reduction
a2 b2
to separation of variables. In this case, we use the substitution u = a1 x + b1 y or
u = a2 x + b2 y.
a1 b1
• If the lines in (2) are intersecting, that is,
6= , then (1) can be solved by reduction
a2 b2
to differential equation with homogeneous coefficients. In this case, we use the
substitutions x = u + h and y = v + k, where (h, k) is the intersection point (2).
44

Example 13.
1. Solve: (x + 2y − 1)dx + (3x + 6y)dy = 0
Solution: From the given differential equation, the linear coefficients are parallel, that
1 3
is, = .
3 6
Let u = x + 2y. Then du = dx + 2dy =⇒ dx = du − 2dy. We now have,
(x + 2y − 1)dx + 3(x + 2y)dy = 0
(u − 1)(du − 2dy) + 3udy = 0
(u − 1)du − 2(u − 1)dy + 3udy = 0
(u − 1)du + (u + 2)dy = 0 ←− separate the variables
u−1
Z Z
du = − dy ←− integrate both sides
u+2
Z   Z
3
1− du = − dy ←− by long division
u+2
u − 3 ln |u + 2| = −y + C ←− but u = x + 2y
x + 2y − 3 ln |x + 2y + 2| = −y + C or x + 3y − 3 ln |x + 2y + 2| = C

dy 3x + 2y
2. Solve: = , y(−1) = −1
dx 3x + 2y + 2
a1 b1
Solution: It can be clearly seen from the given that = .
a2 b2
du + 3dx
Let u = 3x + 2y. Then du = 3dx + 2dy =⇒ dy = .
2
(Note: From the substitution, we can choose to solve for either dx or dy.)
We now have,
(3x + 2y + 2)dy = (3x + 2y)dx
 
du + 3dx
(u + 2) = udx ←− multiply both sides by 2
2
(u + 2)(du + 3dx) = 2udx
(u + 2)du + (3u + 6)dx = 2udx
(u + 2)du + (u + 6)dx = 0 ←− separate the variables
Z Z
u+2
du = − dx ←− integrate both sides
u+6
Z   Z
4
1− du = − dx ←− by long division
u+6
u − 4 ln |u + 6| = −x + c1 ←− but u = 3x + 2y
3x + 2y − 4 ln |3x + 2y + 6| = −x + c1 or 2x + y − 2 ln |3x + 2y + 6| = C
Since y(−1) = −1, substitute x = −1 and y = −1 to solve for C:
2(−1) + (−1) − 2 ln |3(−1) + 2(−1) + 6| = C =⇒ C = −3
∴ 2x + y − 2 ln |3x + 2y + 6| = −3 ←− solution to IVP
45

3. Solve: (2x − y)dx + (4x + y − 6)dy = 0

Solution: The lines 2x − y = 0 and 4x + y − 6 = 0 intersect at (1, 2).


Let x = u + 1 and y = v + 2.
Then dx = du and dy = dv.
We now have, [2(u + 1) − (v + 2)]du + [4(u + 1) + (v + 2) − 6]dv = 0
Simplify the coefficients of du and dv: (2u − v)du + (4u + v)dv = 0
From the last equation, we use the substitution, u = wv and du = (wdv + vdw).

(2wv − v)(wdv + vdw) + (4wv + v)dv =0


2w vdv + 2wv 2 dw − vwdv − v 2 dw + 4wvdv + vdv
2
=0
(2w2 v + 3wv + v)dv + (2wv 2 − v 2 )dw =0
v(2w2 + 3w + 1)dv + v 2 (2w − 1)dw = 0 ←− use separation of variables
2w − 1
Z Z Z
dv
+ dw = 0 dv
v 2w2 + 3w + 1
By partial fraction decomposition, we have,
Z  
−4
Z Z
dv 3
+ + dw = 0 dv
v 2w + 1 w + 1
1
ln |v| − 4 · ln |2w + 1| + 3 ln |w + 1| = c1
2
u
Replace w = , u = x − 1, and v = y − 2. Hence, we have
v
 
x−1 x − 1
ln |y − 2| − 2 ln 2 + 1 + 3 ln + 1 = c1
y−2 y−2

Applying some properties of logarithms, we can write the solution as

(x+y-3)3 = C(2x + y − 4)3 .

Bernoulli’s Equation

Sometimes it is possible to solve a nonlinear equation by making a change of the dependent


variable that converts it into a linear equation. In this case, we can solve such equation by
means of integrating factor method. The most important such equation has the form
dy
+ R(x)y = S(x)y n (3)
dx
where n ∈ R, called the Bernoulli’s equation or Bernoulli DE. If n = 0 or n = 1, then
(3) is linear.
46

Method of Solution: For n 6= 1


If we multiply both sides of (3) by y −n , it becomes
dy
y −n + y 1−n R(x) = S(x) (4)
dx
du dy
Let u = y 1−n . Then = (1 − n)y −n .
dx dx
Multiply both sides of (4) by (1 − n).
dy
(1 − n)y −n + (1 − n)y 1−n R(x) = (1 − n)S(x)
dx
The Bernoulli differential equation is now transformed into the form
du
+ (1 − n)R(x) u = (1 − n)S(x) (5)
dx
The above equation is now linear in u and can be solved by integrating factor method.
du
+ P (x) u = f (x) (6)
dx
Example 14. Find the solution of the following Bernoulli DE.
dy y y −2
1. + =
dx x x
dy y y −2
+ = ←− multiply both sides by y 2
dx x x
3
dy y 1
y2 + = (1)
dx x x
du dy
Let u = y 3 . Then = 3y 2 . Multiply both sides of (1) by 3.
dx dx
2 dy 3y 3 3
3y + =
dx x x
du 3 3
+ u= ←− standard form, linear in u
dx x x
3
R
3dx/x
IF: e = e3 ln x = eln x = x3
du
x3 + 3ux2 = 3x2 ←− multiply both sides of standard form by IF: x3
| dx {z }
 
d
x3 u = 3x2
dx
Z   Z
d x u = 3x2 dx
3

x3 u = x3 + C ←− but u = y 3
x3 y 3 = x3 + C or y 3 = 1 + Cx3
47

dy
2. x + y = x2 y 2 ln x
dx
Solution: Dividing by x we obtain the Bernoulli DE:
dy 1
+ y = (x ln x)y 2
dx x
1 1
We identify R(x) = , S(x) = x ln x, and n = 2, so that u = y 1−n = y −1 = .
x y
The linear equation form of the Bernoulli DE, from (5), will be

du 1 du 1
+ (1 − 2) u = (1 − 2) x ln x ⇐⇒ − u = −x ln x
dx x dx x
We can now solve this by integrating factor method.
1 R −1 1
We identify P (x) = − and I.F. = e (−1/x)dx = e− ln x = eln x = x−1 = .
x x
1
Multiply I.F. = to the standard form, we have
x
 
1 du 1 1
− u = (−x ln x)
x dx x x
1 du 1 1
− 2 u = (−x ln x)
|x dx {z x } x
 
d 1
u = − ln x ←− refer to Step #3 and #4 in Section 2.2
dx x
Z   Z Z
u
d = − ln x dx ←− use Integration by Parts to ln x dx
x
u
= −(x ln x − x) + C = −x ln x + x + C
x
1
u = −x2 ln x + x2 + Cx ←− back substitute u =
y
1
= −x2 ln x + x2 + Cx
y
1
∴ y= ←− general solution
−x ln x + x2 + Cx
2

R
*For ln x dx
Z Z
Let u = ln x and dv = dx ln x dx = x ln x − dx
dx
Then du = and v = x = x ln x − x + c1
x
48

dy
3. + y = xy 4 ; y(0) = 1
dx
1
Solution: We identify R(x) = 1, S(x) = x, and n = 4. So that u = y 1−n = y −3 = .
y3
The linear equation form of the Bernoulli DE will be
du du
+ (1 − 4)(1)u = (1 − 4)x ⇐⇒ − 3u = −3x
dx dx
We can now solve this by integrating factor
R method.
−3 dx
We identify P (x) = −3 and I.F. = e = e−3x .
Multiply I.F. = e−3x to the standard form, we have
 
−3x du
e − 3u = e−3x (−3x)
dx
d −3x 
e u = −3xe−3x ←− refer to Step #3 and #4 in Section 2.2
Zdx Z Z
−3x −3x
xe−3x dx

d ue = −3 xe dx ←− use Integration by Parts to
 
−3x 1 −3x 1 −3x
ue = −3 − xe − e + C1
3 9
u −3x 1 −3x
= xe + e + C1
e3x 3
1 1
u = x + + C1 e3x ←− back substitute u = 3
3 y
1 3x + 1 + 3C1 e3x
= ←− take the reciprocal ; 3C1 = C
y3 3
3
y3 = ←− general solution
3x + 1 + Ce3x
Since y(0) = 1, substitute x = 0 and y = 1 to solve for C :
3
(1)3 = ⇐⇒ 1 + C = 3 =⇒ C = 2
3(0) + 1 + Ce3(0)
r
3 3 3 3
∴ y = or y = ←− (explicit) solution to the IVP
3x + 1 + 2e3x 3x + 1 + 2e3x
*For xe−3x dx
R

Let u = x and dv = e−3x dx


1
Then du = dx and v = − e−3x
3
Z Z  
−3x 1 −3x 1 −3x
xe dx = − xe − − e dx
3 3
 
1 −3x 1 1 −3x
= − xe + − e + c1
3 3 3
1 1
= − xe−3x − e−3x + c1
3 9
49

Integrating Factors Found by Inspection

Recall from Lesson 2.2 that we can solve a linear differential equation with the aid of an
integrating factor. The same idea sometimes can be applied for a non exact differential
equation M (x, y)dx + N (x, y)dy = 0. For now, we will deal with equations that are simple
enough to determine the integrating factors by inspection. To do this, we have to be familiar
and be able to recognize such exact common differentials (and sometimes, it depends upon
experience). The following are exact differentials that frequently appear.
d(xy) = xdy + ydx d exy = exy (xdy + ydx)


 
x ydx − xdy  
y xdy − ydx
d = d =
y y2 x x2
 
−1 x ydx − xdy  
xdy − ydx
d tan = −1 y
y x2 + y 2 d tan =
x x2 + y 2

xdy + ydx  
d(ln xy) = −1 xdy + ydx
xy d n−1
=
(n − 1)(xy) (xy)n

Most likely, when we regroup terms with exact differentials, we will be regrouping terms
with dx and dy. In addition, a differential involving only one variable, like x dx, is an exact
differential.

Example 15. Solve the following differential equations by regrouping exact differentials.

1. xdy + ydx = 3x2 dx


Solution:
Observe that the terms on the right side of the given equation is an exact differential
and the right side is a function of x alone. We have,

xdy + ydx = 3x2 dx


| {z }
d(xy) = 3x2 dx ←− take integral of both sides
Z Z
d(xy) = 3x2 dx

xy = x3 + C
50

2. xdy − ydx − x2 + y 2 dx = 0
Solution:
xdy − ydx − x2 + y 2 dx = 0 ←− divide by x2 + y 2


xdy − ydx
−dx = 0
x2 + y 2
| {z }
Z   Z Z
−1 y
d tan − dx = 0dx ←− take integral of both sides
x
y
tan−1 − x = C
x

3. [1 + y tan(xy)]dx + x tan(xy)dy = 0
Solution:
dx + x tan(xy)dy = 0 ←− distribute the terms
dx + y tan(xy)dx + x tan(xy)dy = 0 ←− regroup terms with tan(xy)
dx + [y tan(xy)dx + x tan(xy)dy] = 0
dx + tan(xy) (ydx + xdy) = 0
Z Z Z
dx + tan(xy) d(xy) = 0dx ←− take integral of both sides

x + sec2 (xy) = C
 
4. y x3 exy − y dx + x y + x3 exy dy = 0
Solution:
y x3 exy − y dx + x y + x3 exy dy = 0
 
←− distribute the terms
yx3 exy dx − y 2 dx + xydy + x4 exy dy = 0 ←− regroup terms with exy
x3 exy (ydx + xdy) + y(xdy − ydx) = 0 ←− divide by x3
  
xy y xdy − ydx
e (ydx + xdy) + =0
x x2
Z Z     Z
xy y y
e d(xy) + d = 0dx ←− take integral of both sides
x x
 2
xy 1 y
e + = c1 or 2x2 exy + y 2 = Cx2 , C = 2c1
2 x
51

Determination of Integrating Factor

We have already mentioned in the previous lesson the aid of integrating factor in solving a
first-order linear differential equation and that the same idea sometimes works for a nonexact
differential equation

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

We mean to say that it is sometimes possible to determine an integrating factor u(x, y)


such that after multiplying it to a given nonexact equation (1), the left side of the resulting
equation
u(x, y)M (x, y)dx + u(x, y)N (x, y)dy = 0 (2)
becomes an exact differential.
To determine such integrating factor u(x, y), recall the criterion for exactness. Equation (2)
is exact if and only if

∂ ∂
(uM ) = (uN )
∂y ∂x
∂M ∂u ∂N ∂u
u +M =u +N
∂y ∂y ∂x ∂x
 
∂M ∂N ∂u ∂u
or u − =N −M (3)
∂y ∂x ∂x ∂y

∂M ∂N
If u satisfies (3), then u is an integrating factor for (1). Note that M, N, , and are
∂y ∂x
known functions of x and y. To determine such function u, from (3), we have to solve for
a partial differential equation, but were not yet ready to do that. Thus, we first make an
assumption that u is a function of only one variable.
∂u du ∂u
Let us first assume that u depends on x alone. Then, = and = 0. Hence, (3)
∂x dx ∂y
becomes  
∂M ∂N du
u − =N
∂y ∂x dx
 
du 1 ∂M ∂N
= − dx (4)
u N ∂y ∂x
It is still not easy to determine u even after taking the integral of both sides of (4) if its
right side dependson both x and
 y. However, if after some algebraic simplications are made,
1 ∂M ∂N
the expression − turns out to be dependent alone on the variable y, then (4)
N ∂y ∂x
is now a first-order ordinary differential equation and we can finally solved for u in (4) by
separation of variables. That is,
Z Z  
du 1 ∂M ∂N
= − dx
u N ∂y ∂x
52
Z  
∂M 1 ∂N
− dx
Solving for u, we have u(x) = e ∂y N ∂x .
Similarly, if u depends on y alone, then we will have,
 
∂M ∂N du
u − = −M
∂y ∂x dy
 
du 1 ∂M ∂N
=− − dy
u M ∂y ∂x
Z  
1 ∂M ∂N
− − dy
Solving for u, u(y) = e M ∂y ∂x
To summarize, given a nonexact differential equation

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


 
1 ∂M ∂N
• If − is a function of x alone, then an integrating factor for (1) is
N ∂y ∂x
Z  
1 ∂M ∂N
− dx
u(x) = e N ∂y ∂x (5)
 
1 ∂M ∂N
• If − − is a function of y alone, then an integrating factor of (1) is
M ∂y ∂x
Z  
1 ∂M ∂N
− − dy
u(y) = e M ∂y ∂x (6)

Remarks 5. If neither of the two works, we can only say that (1) does not have an integrating
factor that is a function of x or y alone.
53

Example 16. Solve the following differential equation or IVP by finding an appropriate
integrating factor.

1. 2y 2 + 3x dx + 2xydy = 0

Solution: We identify M = 2y 2 + 3x and N = 2xy. Then


∂M ∂ ∂N ∂
= [2y 2 + 3x] = 4y and = [2xy] = 2y
∂y ∂y ∂x ∂x
∂M ∂N
− = 4y − 2y = 2y
∂y ∂x
Notice that the difference between the partial derivatives has only one term as well as
N . (It could be a deciding factor, whether to try to divide it by N or M .)
 
1 ∂M ∂N 1 1 R
− = (2y) = =⇒ IF: u(x) = e dx/x = eln x = x
N ∂y ∂x 2xy x
Multiply the original DE by IF = x

New differential equation: 2xy 2 + 3x2 dx + 2x2 ydy = 0
∂ ∂
Test for Exactness: [2xy 2 + 3x2 ] = 4xy and [2x2 y] = 4xy
∂y ∂x
Hence, the resulting equation is now exact. We now determine a solution f (x, y) = C
∂f ∂f
for the exact differential equation such that = 2xy 2 + 3x2 and = 2x2 y.
∂x ∂y
∂f
Let us start with = 2xy 2 + 3x2 . Integrate this last equation with respect to x.
∂x
Z Z
∂f
dx = f (x, y) = (2xy 2 + 3x2 ) dx ←− treat y as constant
∂x
Z Z
2
f (x, y) = y 2x dx + 3x2 dx

f (x, y) = y 2 (x2 ) + x3 + g(y) ←− g(y) is the constant of integration


f (x, y) = x2 y 2 + x3 + g(y)

Take the partial derivative of the last equation with respect to y


∂ ∂  2 2
x y + x3 + g(y)

f (x, y) =
∂y ∂y
∂ ∂f
f (x, y) = 2x2 y + g 0 (y) ←− but = 2x2 y
∂y ∂y
2x2 y + g 0 (y) = 2x2 y =⇒ g 0 (y) = 0 =⇒ g(y) = c1

Therefore, f (x, y) = x2 y 2 + x3 + c1 ⇐⇒ x2 y 2 + x3 = C .
54

2. 10 − 6y + e−3x dx − 2dy = 0


Solution: We identify M = 10 − 6y + e−3x and N = −2. Then


∂M ∂ ∂N ∂
= [10 − 6y + e−3x ] = −6 and = [−2] = 0
∂y ∂y ∂x ∂x
∂M ∂N
− = −6 − 0 = −6
∂y ∂x
 
1 ∂M ∂N 1 R
− = (−6) = 3 =⇒ IF: u(x) = e 3dx = e3x
N ∂y ∂x −2
Multiply the original DE by IF = e3x

New differential equation: 10e3x − 6ye3x + 1 dx − 2e3x dy = 0
∂ ∂
Test for Exactness: [10e3x − 6ye3x + 1] = −6e3x and [−2e3x ] = −6e3x
∂y ∂x
Hence, the resulting equation is now exact. We now determine a solution f (x, y) = C
∂f ∂f
for the exact differential equation such that = 10e3x − 6ye3x + 1 and = −2e3x .
∂x ∂y
∂f
Let us start with = −2e3x . Integrate this last equation with respect to y.
∂y
Z Z
∂f
− 2e3x dy ←− treat x as constant

dy = f (x, y) =
∂y
Z
3x
f (x, y) = −2e dy

f (x, y) = −2e3x y + h(x) ←− h(x) is the constant of integration


f (x, y) = −2e3x y + h(x)

Take the partial derivative of the last equation with respect to x


∂ ∂ 
− 2e3x y + h(x)

f (x, y) =
∂x ∂x
∂ ∂f
f (x, y) = −6e3x y + h0 (x) ←− but = 10e3x − 6ye3x + 1
∂x ∂x
−6e3x y + h0 (x) = 10e3x − 6ye3x + 1 =⇒ h0 (x) = 10e3x + 1
Z
10
10e3x + 1 dx = e3x + x + c1

h(x) =
3

10 3x 10 3x
Therefore, f (x, y) = −2e3x y + e + x + c1 ⇐⇒ -2e3x y + e +x=C .
3 3
55

3. y(x + y + 1)dx + x(x + 3y + 2)dy = 0

Solution: We identify M = y(x + y + 1) and N = x(x + 3y + 2). Then


∂M ∂ ∂N ∂
= [y(x + y + 1)] = x + 2y + 1 and = [x(x + 3y + 2)] = 2x + 3y + 2
∂y ∂y ∂x ∂x
∂M ∂N
− = (x + 2y + 1) − (2x + 3y + 2) = −x − y − 1
∂y ∂x
 
1 ∂M ∂N −x − y − 1
Notice that − = is not a function of x alone, but
N ∂y ∂x x(x + 3y + 2)
 
1 ∂M ∂N −x − y − 1 −(x + y + 1) 1
− − = = = is a function of y alone.
M ∂y ∂x −y(x + y + 1) −y(x + y + 1) y
R
Hence, IF=u(y) = e dy/y = eln y = y
Multiply the original DE by IF = y
 
New differential equation: xy 2 + y 3 + y 2 dx + x2 y + 3xy 2 + 2xy dy = 0
∂ ∂ 2
Test for Exactness: [xy 2 + y 3 + y 2 ] = 2xy + 3y 2 + 2y and [x y + 3xy 2 + 2xy] =
∂y ∂x
2xy + 3y 2 + 2y
Hence, the resulting equation is now exact. We now determine a solution f (x, y) = C
∂f ∂f
for the exact differential equation such that = xy 2 + y 3 + y 2 and = x2 y + 3xy 2 +
∂x ∂y
2xy.
∂f
Let us start with = xy 2 + y 3 + y 2 . Integrate this last equation with respect to x.
∂x
Z Z
∂f
dx = f (x, y) = (xy 2 + y 3 + y 2 ) dx ←− treat y as constant
∂x
Z Z Z
2 3 2
f (x, y) = y x dx + y dx + y dx
 2
x
f (x, y) = y 2 + y 3 x + y 2 x + g(y) ; g(y) is the constant of integration
2
1 2 2
f (x, y) = x y + xy 3 + xy 2 + g(y)
2
Take the partial derivative of the last equation with respect to y
 
∂ ∂ 1 2 2 3 2
f (x, y) = x y + xy + xy + g(y)
∂y ∂y 2
∂ ∂f
f (x, y) = x2 y + 3xy 2 + 2xy + g 0 (y) ←− but = x2 y + 3xy 2 + 2xy
∂y ∂y
x2 y + 3xy 2 + 2xy + g 0 (y) = x2 y + 3xy 2 + 2xy =⇒ g 0 (y) = 0 =⇒ g(y) = c1

1 1 2 2
Therefore, f (x, y) = x2 y 2 + xy 3 + xy 2 + c1 ⇐⇒ x y + xy 3 + xy 2 = C .
2 2
56

Activity 3

A. Solve the following differential equation by the indicated method.


dy √
1. = 2 + y − 2x + 3 (reduction to separation of variables)
dx
2. (6x − 3y + 2)dx − (2x − y − 1)dy = 0 (coefficients linear in two variables)

3. (y − 2)dx − (x − y − 1)dy = 0 (coefficients linear in two variables)


dy
4. x2 + y 2 = xy (Bernoulli DE)
dx
5. y(x + y)dx + (x + 2y − 1)dy = 0 (determination of integrating factor)

B. Solve the following initial-value problems.


dy π
1. = cos(x + y) y(0) =
dx 4

2. 4xy + 3x2 dx + 2y + 2x2 ) = 0, y(0) = −2

You might also like