CE 207: Applied Mathematics for Engineers
Lecture# 4
Exact ODEs
Adeeba Naz
Lecturer, Dept. of CE
Contact: [email protected]
Exact Equation (1)
➢ Consider an equation
𝑑𝑦 𝑠𝑖𝑛𝑦
𝑑𝑥
=
2𝑦 −𝑥𝑐𝑜𝑠𝑦
(1) sinydx + xcosy − 2y dy = 0 (2)
➢ Notethat equation (2) is just the differential of
𝑢 𝑥, 𝑦(𝑥) = 𝑥𝑠𝑖𝑛𝑦 − 𝑦 2 = 𝐶 – How?
CE 207_Exact_ODEs
Exact Equation (2)
➢ To generalize…
𝑑𝑦 𝑀(𝑥,𝑦)
• Equation (1) can be expressed as =− (5) or
𝑑𝑥 𝑁 (𝑥,𝑦)
• as 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑁 𝑥, 𝑦 𝑑𝑦 = 0 (6)
➢ Now if there is a function 𝑢 𝑥, 𝑦 such that
d𝑢 𝑥, 𝑦 = 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑁 𝑥, 𝑦 𝑑𝑦
then equation (6) can be written as
𝑑𝑢 𝑥, 𝑦 = 0 which can be integrated to the general solution
𝑢 𝑥, 𝑦 = 𝐶
CE 207_Exact_ODEs
Exact Equation (3)
➢ In such a case 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑁 𝑥, 𝑦 𝑑𝑦 is called the exact differential
and
➢ 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑁 𝑥, 𝑦 𝑑𝑦 = 0 is called the exact differential equation
➢ How do we know if 𝑢 𝑥, 𝑦 exists such that
𝑑𝑢 𝑥, 𝑦 = 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑁 𝑥, 𝑦 𝑑𝑦?
➢ If we know that there exists a function 𝑢 𝑥, 𝑦 , how do we find it?
CE 207_Exact_ODEs
How do we know if u(x,y) (exact differential) exists?
𝜕𝑀 𝜕𝑁
Theorem 01: Let 𝑀 𝑥, 𝑦 , 𝑁 𝑥, 𝑦 , 𝜕𝑦
and be continuous within a rectangle
𝜕𝑥
R in the x, y plane. Then 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑁 𝑥, 𝑦 𝑑𝑦 is an exact differential, in R,
if and only if
𝜕𝑀 𝜕𝑁
= everywhere in R
𝜕𝑦 𝜕𝑥
CE 207_Exact_ODEs
How to find u(x,y) (exact differential)? (1)
➢ If d𝑢 𝑥, 𝑦 = 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑁 𝑥, 𝑦 𝑑𝑦 then by chain rule of calculus;
𝜕𝑢 𝜕𝑢
d𝑢 = d𝑥 + dy
𝜕𝑥 𝜕𝑦
𝜕𝑢 𝜕𝑢
So, M = and N =
𝜕𝑥 𝜕𝑦
𝜕𝑢
=𝑀
𝜕𝑥
𝜕𝑢 = 𝑀𝜕𝑥
𝒖 𝒙, 𝒚 = න𝑴 ⅆ𝒙 + 𝒌(𝒚)
➢ So, 𝑢 𝑥, 𝑦 = 𝑥 𝑀 , 𝑦 𝑑𝑥 + 𝑘 𝑦
where, 𝑘(𝑦) is constant of integration
➢ 𝑢 𝑥, 𝑦 = 𝑥 𝑁 , 𝑦 𝑑𝑦 + 𝑙 𝑥
where, 𝑙(𝑥) is constant of integration
CE 207_Exact_ODEs
Check for the existence of u(x,y) (exact
differential) - Example
𝒔𝒊𝒏𝒚ⅆ𝒙 + 𝒙𝒄𝒐𝒔𝒚 − 𝟐𝒚 ⅆ𝒚 = 𝟎 (1)
➢ Where, 𝑀 = 𝑠𝑖𝑛𝑦 & 𝑁 = 𝑥𝑐𝑜𝑠𝑦 − 2𝑦
𝜕𝑀 𝜕𝑁
➢
𝜕𝑦
= 𝑐𝑜𝑠𝑦 & 𝜕𝑥
= 𝑐𝑜𝑠𝑦
➢ Therefore, there exists u(x, y)!
➢ And equation 1 is an exact ODE
CE 207_Exact_ODEs
Find F(x,y) (solution of exact ODE) - Example
➢ For the exact differential equation 𝑠𝑖𝑛𝑦𝑑𝑥 + 𝑥𝑐𝑜𝑠𝑦 − 2𝑦 𝑑𝑦 = 0,
𝜕𝑢
▪ = 𝑀 = 𝑠𝑖𝑛𝑦 (1) and
𝜕𝑥
𝜕𝑢
▪ = 𝑁 = 𝑥𝑐𝑜𝑠𝑦 − 2𝑦 (2)
𝜕𝑦
➢ Now integrating equation (1) (partially) w. r. t. x gives
• 𝒖 𝒙, 𝒚 = 𝒚𝒏𝒊𝒔𝒙 = 𝒙𝝏𝒚𝒏𝒊𝒔 + 𝒌(𝒚) (3)
➢ Now replacing 𝐹 𝑥, 𝑦 from eq. (3) into the left-hand side of eq. (2) we get
𝝏𝒖 𝝏(𝒙𝒔𝒊𝒏𝒚+𝒌(𝒚))
= = 𝒙𝒄𝒐𝒔𝒚 + 𝒌′ 𝒚 = 𝒙𝒄𝒐𝒔𝒚 − 𝟐𝒚
𝝏𝒚 𝝏𝒚
or, 𝒌 𝒚 = − 𝒚𝟐 + 𝑩 (4)
➢ Now from eq. (3) and eq. (4) we get 𝒖 𝒙, 𝒚 = 𝒙𝒔𝒊𝒏𝒚 − 𝒚𝟐 + 𝑩 = constant
➢ 𝒖 𝒙, 𝒚 = 𝒙𝒔𝒊𝒏𝒚 − 𝒚𝟐 = constant
CE 207_Exact_ODEs
Problem 01 (Kreyszig, Page 22, Example 01)
➢ cos 𝑥 + 𝑦 𝑑𝑥 + 3𝑦 2 + 2𝑦 + cos 𝑥 + 𝑦 𝑑𝑦 = 0
M N
𝑀𝑑𝑥 + 𝑁𝑑𝑦 = 0
𝜕𝑀 𝜕𝑁
= − sin 𝑥 + 𝑦 ; = − sin 𝑥 + 𝑦
𝜕𝑦 𝑥
𝜕𝑀 𝜕𝑁
So, =
𝜕𝑦 𝜕𝑥
There exist an exact ODE.
CE 207_Exact_ODEs
Problem 01 (Kreyszig, Page 22, Example 01)
➢ cos 𝑥 + 𝑦 𝑑𝑥 + 3𝑦 2 + 2𝑦 + cos 𝑥 + 𝑦 𝑑𝑦 = 0
M N
𝑢 𝑥, 𝑦 = න 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑘 𝑦
= 𝑥 𝑠𝑜𝑐 , 𝑦 𝑑𝑥 + 𝑘 𝑦
= sin(𝑥 + 𝑦) + 𝑘 𝑦
CE 207_Exact_ODEs
Problem 01 (Kreyszig, Page 22, Example 01)
➢ cos 𝑥 + 𝑦 𝑑𝑥 + 3𝑦 2 + 2𝑦 + cos 𝑥 + 𝑦 𝑑𝑦 = 0
𝜕𝑢
=𝑁
𝜕𝑦
𝜕 sin(𝑥 + 𝑦) + 𝑘 𝑦
= 3y2 + 2y + cos(x + y)
𝜕𝑦
cos(𝑥 + 𝑦) + 𝑘 ′ 𝑦 = 3y2 + 2y + cos x + y
𝑘′ 𝑦 = 3y2 + 2y
𝑘 𝑦 = y3 + y2 + B
CE 207_Exact_ODEs
Problem 01 (Kreyszig, Page 22, Example 01)
➢ cos 𝑥 + 𝑦 𝑑𝑥 + 3𝑦 2 + 2𝑦 + cos 𝑥 + 𝑦 𝑑𝑦 = 0
𝑢 𝑥, 𝑦 = sin(𝑥 + 𝑦) + 𝑘 𝑦
= sin(𝑥 + 𝑦) + y3 + y2 + B = constant
= sin(𝑥 + 𝑦) + y3 + y2
Check:
𝜕𝑢 𝜕𝑢
𝜕𝑢 𝑥, 𝑦 = 𝑑𝑥 + 𝑑𝑦
𝜕𝑥 𝜕𝑦
= cos 𝑥 + 𝑦 𝑑𝑥 + 3𝑦 2 + 2𝑦 + cos 𝑥 + 𝑦 𝑑𝑦
CE 207_Exact_ODEs
Problem 02 (Kreyszig, Page 23, Example 03) (1)
Solve the ODE: • Let’s multiply equation (1) by a factor
1
−y𝑑𝑥 + 𝑥𝑑𝑦 = 0 2 (Referred to as integrating factor)
𝑥
−𝑦 𝑥
➢𝑀 = −y →
𝜕𝑀
= −1 • 𝑑𝑥 + 𝑑𝑦 = 0
𝜕𝑦 𝒙𝟐 𝒙𝟐
−𝑦 𝜕𝑀 1
➢𝑁 =x →
𝜕𝑁
=1 •𝑀= → =−
𝜕𝑥 𝑥2 𝜕𝑦 𝑥2
𝜕𝑀 𝜕𝑁 1 𝜕𝑁 1
➢ ≠ ! •𝑁= → =−
𝜕𝑦 𝜕𝑥 𝑥 𝜕𝑥 𝑥2
𝜕𝑀 𝜕𝑁
So, not exact 𝜕𝑦
=
𝜕𝑥
So, u(x,y) exists; exact
CE 207_Exact_ODEs
Problem 02 (Kreyszig, Page 23, Example 03) (2)
𝜕𝑢 −𝑦
➢𝑀 = = (1)
𝜕𝑥 𝒙𝟐
𝜕𝑢 1
➢𝑁 = = (2)
𝜕𝑦 𝑥
Mdx + Ndy =0
𝑢 𝑥, 𝑦 = න 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑘 𝑦
𝑦
= − 𝑑𝑥 + 𝑘 𝑦
𝑥2
𝑦
= +𝑘 𝑦
𝑥
CE 207_Exact_ODEs
Problem 02 (Kreyszig, Page 23, Example 03) (2)
𝜕𝑢 1
𝑁= 𝜕𝑦
= 𝑥 𝜕𝑢
=𝑁
𝜕𝑦
𝑦
𝜕 +𝑘 𝑦 1
𝑥 =
𝜕𝑦 𝑥
1 ′ 𝑦
1
+𝑘 =
𝑥 𝑥
𝑘′ 𝑦 = 0
𝑘 𝑦 =𝐵
CE 207_Exact_ODEs
Problem 02 (Kreyszig, Page 23, Example 03) (2)
𝜕𝑢 1
𝑁= 𝜕𝑦
= 𝑥
𝑦
𝑢 𝑥, 𝑦 = + 𝑘 𝑦
𝑥
𝑦
= + 𝐵 = constant
𝑥
𝑦
= = 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡
𝑥
Check:
𝜕𝑢 𝜕𝑢
𝜕𝑢 𝑥, 𝑦 = 𝑑𝑥 + 𝑑𝑦
𝜕𝑥 𝜕𝑦
−𝑦 1
= 2 𝑑𝑥 + 𝑑𝑦
𝑥 𝑥
CE 207_Exact_ODEs
How to find an integrating factor? (1)
➢𝑀 𝑥, 𝑦 𝑑𝑥 + 𝑁 𝑥, 𝑦 𝑑𝑦 = 0 (1)
➢ Let’s multiply both sides of equation (1) by a function 𝐹 𝑥, 𝑦 such that
𝐹 𝑥, 𝑦 𝑀 𝑥, 𝑦 𝑑𝑥 + 𝐹 𝑥, 𝑦 𝑁 𝑥, 𝑦 𝑑𝑦 = 0 would be an exact equation!
𝜕(𝐹𝑀) 𝜕(𝐹𝑁)
➢ Therefore,
𝜕𝑦
= 𝜕𝑥
→ 𝐹𝑦 𝑀 + 𝐹𝑀𝑦 = 𝐹𝑥 𝑁 + 𝐹𝑁𝑥
CE 207_Exact_ODEs
How to find an integrating factor? (2)
➢ Now, lets assume 𝐹 is only a function of 𝑥
• If you can’t solve a problem as a whole – try to solve a simpler version of
it – that might provide you much needed insight!
𝜕(𝐹𝑀) 𝜕(𝐹𝑁)
➢ Then
𝜕𝑦
= 𝜕𝑥
→ 𝐹𝑦 𝑀 + 𝐹𝑀𝑦 = 𝐹𝑥 𝑁 + 𝐹𝑁𝑥 would become
• 𝑭𝑴𝒚 = 𝑭𝒙 𝑵 + 𝑭𝑵𝒙 (ii)
CE 207_Exact_ODEs
How to find an integrating factor? (3)
𝜕(𝐹𝑀) 𝜕(𝐹𝑁)
➢ Then
𝜕𝑦
= 𝜕𝑥
→ 𝐹𝑦 𝑀 + 𝐹𝑀𝑦 = 𝐹𝑥 𝑁 + 𝐹𝑁𝑥 would become
• 𝑭𝑴𝒚 = 𝑭𝒙 𝑵 + 𝑭𝑵𝒙 (ii)
➢ Now let’s divide both sides of equation (ii) by 𝐹𝑁
𝑀𝑦 𝐹𝑥 𝑁𝑥
• = +
𝑁 𝐹 𝑁
𝐹𝑥 𝑀𝑦 𝑁𝑥 𝜕𝐹 1 1 𝜕𝑀 𝜕𝑁
• = − → . = −
𝐹 𝑁 𝑁 𝜕𝑥 𝐹 𝑁 𝜕𝑦 𝜕𝑥
1 𝜕𝑀 𝜕𝑁 𝜕𝐹
• Let’s assume 𝑅 = − therefore, = 𝑅𝜕𝑥 (iii)
𝑁 𝜕𝑦 𝜕𝑥 𝐹
CE 207_Exact_ODEs
How to find an integrating factor? (4)
1 𝜕𝑀 𝜕𝑁 𝜕𝐹
➢ Let’s assume 𝑅 = 𝑁 𝜕𝑦
− 𝜕𝑥 therefore, 𝐹
= 𝑅𝜕𝑥 (iii)
➢ Now integrating equation (iii) on both sides we get
• 𝑙𝑛𝐹 = → 𝑥𝜕𝑅 𝐹 = 𝑒 𝑥𝜕𝑅 (iv)
➢ Theorem 01: If equation (1) is such that 𝑅 in equation (iv) only depends on
x i.e. R = R(x), then equation (1) has an integrating factor, 𝐹 = 𝑒 𝑥𝜕𝑅
CE 207_Exact_ODEs
How to find an integrating factor? (5)
we start by assuming that 𝐹 ∗ is a function of 𝑦 then we will find that 𝑅∗ =
➢ If
1 𝜕𝑁 𝜕𝑀 ∗ 𝑦𝜕 ∗𝑅
𝑀 𝜕𝑥
− 𝜕𝑦 and 𝐹 = 𝑒 (v)
➢ Theorem 02: If equation (1) is such that 𝑅∗ in equation (v) only depends
on y i.e., 𝑅∗ = 𝑅∗(y) , then equation (1) has an integrating factor
∗ 𝑦𝜕 ∗𝑅
𝐹 = 𝑒
CE 207_Exact_ODEs
Problem 04 (Kreyszig, Example 5, P # 25) (1)
➢ 𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦 𝑑𝑥 + 𝑥𝑒 𝑦 − 1 𝑑𝑦 = 0
𝜕𝑀 𝜕𝑁
= 𝑒 (𝑥+𝑦) + 𝑦ⅇ𝑦 + ⅇ𝑦 = 𝑒𝑦
𝜕𝑦 𝜕𝑥
➢ So,not exact
➢ Assume R is a function of x.
➢𝐹 = 𝑒 𝑥𝜕𝑅
1 𝜕𝑀 𝜕𝑁 1
𝑦𝜕 𝑁− 𝜕𝑥 𝜕𝑥 𝑦𝑒𝑥 −1 𝑒 (𝑥+𝑦) +𝑦ⅇ𝑦 +ⅇ𝑦 −ⅇ𝑦 𝜕𝑥
➢ = 𝑒 = 𝑒
1
𝑦𝑒𝑥 −1 𝑒 (𝑥+𝑦) +𝑦ⅇ𝑦 𝜕𝑥
➢ = 𝑒
1
➢R = 𝑒 (𝑥+𝑦) + 𝑦ⅇ𝑦 So, R is not a function of x only.
𝑥𝑒 𝑦 −1
CE 207_Exact_ODEs
Problem 04 (Kreyszig, Example 5, P # 25) (3)
➢ 𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦 𝑑𝑥 + 𝑥𝑒 𝑦 − 1 𝑑𝑦 = 0
Assume R is a function of y.
𝐹 = 𝑒 𝑦𝜕𝑅
1 𝜕𝑁 𝜕𝑀
𝑥𝜕 𝑀− 𝜕𝑦 𝜕𝑦
= 𝑒
1 𝜕𝑁 𝜕𝑀 1 𝜕 𝑥𝑒 𝑦 −1 𝜕(𝑒 𝑥+𝑦 +𝑦𝑒 𝑦 )
So, R= 𝑀 𝜕𝑥
−
𝜕𝑦
= 𝑒 𝑥+𝑦 +𝑦𝑒 𝑦 𝜕𝑥
−
𝜕𝑦
1 𝑦 𝑥+𝑦
= 𝑦 (𝑒 − 𝑒 − 𝑒 𝑦 − 𝑦𝑒 )
𝑦
𝑒 𝑥+𝑦 +𝑦𝑒
1 𝑥+𝑦
= 𝑦 (−𝑒 − 𝑦𝑒 𝑦 ) = -1
𝑒 𝑥+𝑦 +𝑦𝑒
R = −1; 𝑆𝑜, 𝐹 = 𝑒 𝑒 = 𝑦𝜕𝑅 −1𝜕𝑦 = 𝑒 −𝑦
CE 207_Exact_ODEs
Problem 04 (Kreyszig, Example 5, P # 25) (4)
➢ 𝑒 𝑥+𝑦 + 𝑦𝑒 𝑦 𝑑𝑥 + 𝑥𝑒 𝑦 − 1 𝑑𝑦 = 0
➢ (𝑒 𝑥+𝑦 + 𝑦𝑒𝑦 ) 𝑒 −𝑦 𝑑𝑥 + 𝑥𝑒 𝑦 − 1 𝑒 −𝑦 𝑑𝑦 = 0
𝑀 = 𝑒𝑥 + 𝑦 ; N = 𝑥 + 𝑒 −𝑦 ;
𝜕𝑀 𝜕𝑁
➢
𝜕𝑦
=1; 𝜕𝑥
=1 So, there exists an exact ODE
CE 207_Exact_ODEs
Practice Problems (Exact equation) (1)
➢ 3𝑥 2 − 2𝑥𝑦 + 2 𝑑𝑥 + 6𝑦 2 − 𝑥 2 + 3 𝑑𝑦 = 0
➢ 𝑒 𝑥 + 𝑦 𝑑𝑥 + 𝑥 − 𝑒 −𝑦 𝑑𝑦 = 0
➢ Problem Set 1.4: Problem 3, 5, 6, 9, 10, 12, 13, 15
CE 207_Exact_ODEs