ENGINEERING ANALYSIS
Faculty of Engineering
Petroleum Engineering
Fourth year
seven semesters
Engineering analysis Lecture 3
2.3 Inexact equations: integrating factors
Equations that may be written in the form
𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 ………………… (1)
but for which
𝜕𝑀(𝑥,𝑦) 𝜕𝑁(𝑥,𝑦)
≠ ……………… (2)
𝜕𝑦 𝜕𝑥
are known as non-exact equations.
That is, it is sometimes possible to find an integrating factor 𝝁(𝑥, 𝑦) so that after
multiplying, the left-hand side of
𝝁(𝑥, 𝑦)𝑀(𝑥, 𝑦)𝑑𝑥 + 𝝁(𝑥, 𝑦)𝑁(𝑥, 𝑦)𝑑𝑦 = 0 …………… (3)
is an exact differential. Equation (3) is exact if and only if (𝜇𝑀)𝑦 = (𝜇𝑁 )𝑥, By
the Product Rule of differentiation, the last equation is the same as
𝝁𝑀𝑦 + 𝜇𝑦 M = μ𝑁𝑥 + 𝝁𝒙 𝑁
or
𝝁(𝑀𝑦 + 𝑁𝑥 ) = 𝜇𝑦 M + 𝝁𝒙 𝑁 ….……... (4)
Where 𝑀, 𝑁, 𝑁𝑥 , and 𝑀𝑦 are known functions of 𝑥 and 𝑦.
Suppose 𝝁(𝑥, 𝑦) is a function of one variable;
𝒅𝝁
If 𝝁 depends only on x. In this case, 𝝁𝒙 = and 𝜇𝑦 = 0, so (4) can be written as
𝒅𝒙
𝑑𝜇 𝑀𝑦 −𝑁𝑥
= 𝜇
𝑑𝑥 𝑁
Or
𝑑𝜇 𝑀𝑦 −𝑁𝑥
= 𝑑𝑥 = 𝑓(𝑥)𝑑𝑥
𝜇 𝑁
where we require 𝑓(𝑥) also to be a function of 𝑥 only. The integrating factor is
then given by
𝜇 = 𝑒 ∫ 𝑓(𝑥)𝑑𝑥
𝒅𝝁
If 𝝁 depends only on y. Then, 𝝁𝒚 = and 𝜇𝑥 = 0, so (4) can be written as
𝒅𝒚
13
Engineering analysis Lecture 3
𝑑𝜇 −(𝑀𝑦 −𝑁𝑥 )
= 𝜇
𝑑𝑦 𝑀
Or
𝑑𝜇 −(𝑀𝑦 −𝑁𝑥 )
= 𝑑𝑦 = −𝑔(𝑦)𝑑𝑦
𝜇 𝑀
where 𝑔(𝑦) is a function of 𝑦 only. The integrating factor is then given by
𝜇 = 𝑒 − ∫ 𝑔(𝑦)𝑑𝑦 .
Example(1): Solve 3𝑥 2 𝑦 𝑑𝑥 + 2𝑥 3 𝑑𝑦 = 0.
𝜕𝑁
𝑁(𝑥, 𝑦) = 2𝑥 3 ⇒ = 6𝑥 2
𝜕𝑥
𝜕𝑀
𝑀(𝑥, 𝑦) = 3𝑥 2 𝑦 ⇒ = 3𝑥 2
𝜕𝑦
𝜕𝑀(𝑥,𝑦) 𝜕𝑁(𝑥,𝑦)
≠
𝜕𝑦 𝜕𝑥
∴the equation is not exact
𝜕𝑀 𝜕𝑁
− = 3𝑥 2 − 6𝑥 2 = −3𝑥 2
𝜕𝑦 𝜕𝑥
1 𝜕𝑀 𝜕𝑁 −3𝑥 2 3
𝑓(𝑥) = ( − ) = =−
𝑁 𝜕𝑦 𝜕𝑥 2𝑥 3 2𝑥
3 −3
𝜇 = 𝑒 ∫ 𝑓(𝑥)𝑑𝑥 = 𝑒 ∫ −2𝑥 𝑑𝑥 = 𝑥 2
1 3
3𝑥 2 𝑦 𝑑𝑥 + 2𝑥 2 𝑑𝑦 = 0
1
𝜕𝑀 𝜕𝑁
= 3𝑥 2 =
𝜕𝑦 𝜕𝑥
𝜕𝑢
= 𝑁(𝑥, 𝑦)
𝜕𝑦
3
∫ 𝑑𝑢 = ∫ (2𝑥 ) 𝑑𝑦 2
3
𝑢(𝑥, 𝑦) = 2𝑥 2 𝑦 + 𝑔(𝑥). . . . . . . . . (∗)
1 1
𝜕𝑢
= 3𝑥 2 + 𝑔′ (𝑥) = 𝑀(𝑥, 𝑦) = 3𝑥 2 𝑦
𝜕𝑥
𝑔′ (𝑥) = 0
𝑔′ (𝑥) = 0
14
Engineering analysis Lecture 3
Sub h(y) in eq (*), we get
3
𝑢(𝑥, 𝑦) = 2𝑥 2 𝑦 = 𝑐 which is general solution.
𝑑𝑦 𝑥𝑦
Example(2): Find the general solution of = .
𝑑𝑥 −2𝑥 2 −3𝑦 2 +20
Solution:
𝑥𝑦 𝑑𝑥 + (2𝑥 2 + 3𝑦 2 − 20)𝑑𝑦 = 0
𝜕𝑀
𝑀(𝑥, 𝑦) = 𝑥𝑦 ⇒ =𝑥
𝜕𝑦
𝜕𝑁
𝑁(𝑥, 𝑦) = 2𝑥 2 + 3𝑦 2 − 20 ⇒ = 4𝑥
𝜕𝑥
𝜕𝑀(𝑥,𝑦) 𝜕𝑁(𝑥,𝑦)
≠
𝜕𝑦 𝜕𝑥
∴ the equation is not exact
𝜕𝑀 𝜕𝑁
− = 𝑥 − 4𝑥 = −3𝑥
𝜕𝑦 𝜕𝑥
1 𝜕𝑀 𝜕𝑁 −3𝑥 3
𝑔(𝑦) = ( − 𝜕𝑥 ) = =−
𝑀 𝜕𝑦 𝑥𝑦 𝑦
3
− ∫ − 𝑑𝑦
𝜇 = 𝑒 − ∫ 𝑔(𝑦)𝑑𝑦 = 𝑒 𝑦 = 𝑦3
𝑥𝑦 4 𝑑𝑥 + (2𝑥 2 𝑦 3 + 3𝑦 5 − 20𝑦 3 )𝑑𝑦 = 0
𝜕𝑀 𝜕𝑁
= 4𝑥 2 𝑦 3 =
𝜕𝑦 𝜕𝑥
𝜕𝑢
= 𝑀(𝑥, 𝑦)
𝜕𝑥
∫ 𝑑𝑢 = ∫(𝑥𝑦 4 )𝑑𝑥
𝑥2
𝑢(𝑥, 𝑦) = 𝑦 4 + ℎ(𝑦). . . . . . . . . (∗)
2
𝜕𝑢
= 2𝑥 𝑦 + ℎ′ (𝑦) = 𝑁(𝑥, 𝑦)
2 3
𝜕𝑦
ℎ′ (𝑦) = 3𝑦 5 − 20𝑦 3
1
ℎ(𝑦) = 𝑦 6 − 5𝑦 4
2
Sub h(y) in eq (*), we get
𝑥2 1
𝑢(𝑥, 𝑦) = 𝑦 4 + 𝑦 6 − 5𝑦 4 = 𝑐 which is general solution.
2 2
15
Engineering analysis Lecture 3
Example (3): verify that the given differential equation is not exact. Multiply the
given differential equation by the indicated integrating factor 𝜇(𝑥, 𝑦) and verify that
the new equation is exact. Solve it.
𝑦𝑠𝑖𝑛(𝑦) 𝑑𝑥 + 𝑥(𝑠𝑖𝑛(𝑦) − 𝑦𝑐𝑜𝑠(𝑦)) 𝑑𝑦 = 0
Solution:
𝜕𝑀
𝑀(𝑥, 𝑦) = 𝑦𝑠𝑖𝑛(𝑦) ⇒ = sin(𝑦) + 𝑦𝑐𝑜𝑠(𝑦)
𝜕𝑦
𝜕𝑁
𝑁(𝑥, 𝑦) = 𝑥(sin(𝑦) − 𝑦𝑐𝑜𝑠(𝑦)) ⇒ = sin(𝑦) − 𝑦𝑐𝑜𝑠(𝑦)
𝜕𝑥
𝜕𝑀(𝑥,𝑦) 𝜕𝑁(𝑥,𝑦)
≠
𝜕𝑦 𝜕𝑥
∴ the equation is not exact
𝜕𝑀 𝜕𝑁
− = sin(𝑦) + 𝑦𝑐𝑜𝑠(𝑦) − (sin(𝑦) − 𝑦𝑐𝑜𝑠(𝑦)) = 2𝑦𝑐𝑜𝑠(𝑦)
𝜕𝑦 𝜕𝑥
1 𝜕𝑀 𝜕𝑁 2cos (𝑦)
ℎ(𝑥) = ( − 𝜕𝑥 ) =
𝑀 𝜕𝑦 sin (𝑦)
−2cos (𝑦)
− ∫ ℎ(𝑦)𝑑𝑦 ∫ 𝑑𝑦 1
𝜇=𝑒 = 𝑒 sin (𝑦) =
𝑠𝑖𝑛2 (𝑦)
1
𝑠𝑖𝑛2 (𝑦)
[𝑦𝑠𝑖𝑛(𝑦) 𝑑𝑥 + 𝑥(𝑠𝑖𝑛(𝑦) − 𝑦𝑐𝑜𝑠(𝑦))𝑑𝑦] = 0
𝑦 1 𝑦𝑐𝑜𝑠(𝑦)
𝑑𝑥 + 𝑥 ( − ) 𝑑𝑦 = 0
𝑠𝑖𝑛(𝑦) 𝑠𝑖𝑛(𝑦) 𝑠𝑖𝑛2 (𝑦)
𝜕𝑀 1 𝑦𝑐𝑜𝑠(𝑦) 𝜕𝑁
= − =
𝜕𝑦 𝑠𝑖𝑛(𝑦) 𝑠𝑖𝑛2 (𝑦) 𝜕𝑥
𝜕𝑢 𝑦
= 𝑀(𝑥, 𝑦) =
𝜕𝑥 𝑠𝑖𝑛(𝑦)
𝑦
𝑢(𝑥, 𝑦) = 𝑥 + ℎ(𝑦). . . . . . . . . (∗)
𝑠𝑖𝑛(𝑦)
𝜕𝑢 1 𝑐𝑜𝑠(𝑦)
=𝑥 − 𝑥𝑦 + ℎ′ (𝑦) = 𝑁(𝑥, 𝑦)
𝜕𝑦 𝑠𝑖𝑛(𝑦) 𝑠𝑖𝑛2 (𝑦)
ℎ′ (𝑦) = 0
ℎ(𝑦) = 0
Sub h(y) in eq (*), we get
𝑦
𝑢(𝑥, 𝑦) = 𝑥=𝑐
𝑠𝑖𝑛(𝑦)
16
Engineering analysis Lecture 3
Exercise:
1) verify that the given differential equation is not exact. Multiply the given
differential equation by the indicated integrating factor 𝑀(𝑥, 𝑦) and verify that
the new equation is exact. Solve
1. cos(𝑥) cos(𝑦) 𝑑𝑥 + (sin(𝑥) cos(𝑦) − sin(𝑥) sin(𝑦) + 𝑦)𝑑𝑦 = 0
𝑑𝑦 −𝑦 2
2. =
𝑑𝑥 𝑥𝑦 2 +3𝑥𝑦+1⁄𝑦
2) find the value of k so that the given differential equation is exact.
(𝑦 3 + 𝑘𝑥𝑦 4 − 2𝑥)𝑑𝑥 + (3𝑥𝑦 2 + 20𝑦 3 𝑥 2 )𝑑𝑦 = 0
3) determine whether the given differential equation is exact or not, solve it.
𝑒 𝑥𝑦 (cos(𝑥) − sin(𝑥))𝑑𝑥 + 𝑥𝑒 𝑥𝑦 cos(𝑥) 𝑑𝑦 = 0
17
Engineering analysis Lecture 3
2.4 Homogeneous equations
A differential equation that can be written in the form
𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 (1)
Where
𝑀(𝜆𝑥, 𝜆𝑦) = 𝜆𝑛 𝑀(𝑥, 𝑦) 𝑎𝑛𝑑 𝑁(𝜆𝑥, 𝜆𝑦) = 𝜆𝑛 𝑁(𝑥, 𝑦)
is called a homogeneous differential equation of degree n.
The method of the solution is as follows:
Put 𝑦 = 𝑣𝑥 ⇒ 𝑑𝑦 = 𝑣𝑑𝑥 + 𝑥𝑑𝑣 or 𝑥 = 𝑢𝑦 ⇒ 𝑑𝑥 = 𝑢𝑑𝑦 + 𝑦𝑑𝑢
where u and v are new dependent variables, will reduce a homogeneous equation to a
separable first-order differential equation.
Example(1): solve (𝑥 2 + 𝑦 2 )𝑑𝑥 + (𝑥 2 − 𝑥𝑦)𝑑𝑦 = 0
Solution:
𝑀(𝑥, 𝑦) = (𝑥 2 + 𝑦 2 ); 𝑀(𝜆𝑥, 𝜆𝑦) = (𝜆2 𝑥 2 + 𝜆2 𝑦 2 )
= 𝜆2 (𝑥 2 + 𝑦 2 ) = 𝜆2 𝑀
M is homogeneous of degree 2
𝑁(𝑥, 𝑦) = (𝑥 2 + 𝑥𝑦); 𝑁(𝜆𝑥, 𝜆𝑦) = (𝜆2 𝑥 2 − 𝜆2 𝑥𝑦)
= 𝜆2 (𝑥 2 − 𝑦 2 ) = 𝜆2 𝑁
N is homogeneous of degree 2
∴ M and N are homogeneous of some degree.
let 𝑦 = 𝑣𝑥 ⇒ 𝑑𝑦 = 𝑣𝑑𝑥 + 𝑥𝑑𝑣 , so after substituting, the given equation becomes
(𝑥 2 + (𝑣𝑥)2 )𝑑𝑥 + (𝑥 2 − 𝑥(𝑣𝑥))[𝑣𝑑𝑥 + 𝑥𝑑𝑣] = 0
(𝑥 2 + (𝑣𝑥)2 )𝑑𝑥 + (𝑥 2 − 𝑥(𝑣𝑥))[𝑣𝑑𝑥 + 𝑥𝑑𝑣] = 0
(𝑥 2 + 𝑣 2 𝑥 2 )𝑑𝑥 + (𝑥 2 𝑣 − 𝑥 2 𝑣 2 )𝑑𝑥 + (𝑥 2 − 𝑥 2 𝑣)𝑥𝑑𝑣 = 0
𝑥 2 (1 + 𝑣 2 + 𝑣 − 𝑣 2 )𝑑𝑥 + 𝑥 2 (1 − 𝑣)𝑥𝑑𝑣 = 0
𝑥 2 (𝑣 + 1)𝑑𝑥 = −𝑥 3 (1 − 𝑣)𝑑𝑣
18
Engineering analysis Lecture 3
1 (𝑣−1) −2
𝑑𝑥 = (𝑣+1) 𝑑𝑣 = (1 + (𝑣+1)) 𝑑𝑣
𝑥
ln(𝑥) = 𝑣 − 2 ln(𝑣 + 1) + 𝑐
𝑦
⸪𝑦 = 𝑣𝑥 ⇒ 𝑣 =
𝑥
Sub, value of v in eq (*). We get
𝑦 𝑦
ln(𝑥) = − 2 ln ( + 1) + 𝑐
𝑥 𝑥
Example (2): Solve 𝑥𝑑𝑥 + (𝑦 − 2𝑥)𝑑𝑦 = 0
Let 𝑥 = 𝑢𝑦 ⇒ 𝑑𝑥 = 𝑢𝑑𝑦 + 𝑦𝑑𝑢
𝑢𝑦[𝑢𝑑𝑦 + 𝑦𝑑𝑢] + (𝑦 − 2𝑢𝑦)𝑑𝑦 = 0
𝑢𝑦 2 𝑑𝑢 + (𝑢2 − 2𝑢 + 1)𝑦𝑑𝑦 = 0
𝑢 −1
𝑑𝑢 = 𝑑𝑦
𝑢2 −2𝑢+1 𝑦
𝑢−1+1 −1
(𝑢−1)2
𝑑𝑢 = 𝑑𝑦
𝑦
1 1 −1
+ (𝑢−1)2 𝑑𝑢 = 𝑑𝑦
𝑢−1 𝑦
1
ln(𝑢 − 1) − = − ln(𝑦) + 𝑐
𝑢−1
𝑥 1
ln ( − 1) − 𝑥 + ln(𝑦) = 𝑐
𝑦 −1
𝑦
Exercise: solve the following differential equations:
𝑦 𝑦
1) (𝑥 + 𝑦𝑒 𝑥 ) 𝑑𝑥 − 𝑥𝑒 𝑥 𝑑𝑦 = 0, 𝑦(1) = 0
𝑑𝑦
2) 𝑥 = 𝑦 + √𝑥 2 + 𝑦 2
𝑑𝑥
3) 𝑦 𝑑𝑥 + 𝑥(𝑙𝑛(𝑦) − 𝑙𝑛(𝑥) − 1)𝑑𝑦 = 0
𝑑𝑥
4) (𝑥 2 + 2𝑦 2 ) = 𝑥𝑦 𝑦(−1) = 1
𝑑𝑦
19