Lec 2
Lec 2
Page 1 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
Definition:
A differential equation 𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 is called exact if 𝑀(𝑥, 𝑦) and
𝑁(𝑥, 𝑦) are continuous functions and have continuous first partial derivatives then,
the differential equation is exact if and only if
𝜕𝑀(𝑥, 𝑦) 𝜕𝑁(𝑥, 𝑦)
=
𝜕𝑦 𝜕𝑥
If the above condition holds, then𝑀(𝑥, 𝑦)𝑑𝑥 + 𝑁(𝑥, 𝑦)𝑑𝑦 = 0 is an equation of the
form 𝑑𝑓(𝑥, 𝑦) = 0, and its complete solution:
𝑓(𝑥, 𝑦) = 𝑐 , 𝑐 𝑖𝑠 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡
Examples 1:
Page 2 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝟐 𝒙 𝒚 𝒅𝒙 + (𝒙𝟐 − 𝟏)𝒅𝒚 = 𝟎
Solution:
𝑀(𝑥, 𝑦) = 2 𝑥 𝑦 𝑁(𝑥, 𝑦) = 𝑥 2 − 1
𝜕𝑀 𝜕𝑁
= 2𝑥 = 2𝑥
𝜕𝑦 𝜕𝑥
Method 1:
Then the D.E. is exact, then by integrating all of the equation without repeat any term:
∫ 2 𝑥 𝑦 𝑑𝑥 + ∫(𝑥 2 − 1) 𝑑𝑦 = ∫ 0
Page 3 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝑥 2𝑦 + 𝑥 2𝑦 − 𝑦 = 𝑐
These terms are repeated, then the general solution of this equation be:
𝑥 2𝑦 − 𝑦 = 𝑐
Method 2:
2 𝑥 𝑦 𝑑𝑥 + (𝑥 2 − 1)𝑑𝑦 = 0
𝜕𝑓
= 𝑀(𝑥, 𝑦)
𝜕𝑥
𝜕𝑓
= 2𝑥𝑦 then 𝑑𝑓 = 2𝑥𝑦 𝑑𝑥 𝑏𝑦 𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑡𝑖𝑜𝑛
𝜕𝑥
Page 4 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
∫ 𝑑𝑓 = 2 ∫ 𝑥𝑦 𝑑𝑥 , 𝑓 = 2 ∫ 𝑥𝑦 𝑑𝑥 + 𝐶(𝑦)
𝑓 = 𝑥 2 𝑦 + 𝐶 (𝑦)
𝜕𝑓 2 𝑑𝐶(𝑦)
= 𝑥 + = 𝑁(𝑥, 𝑦):
𝜕𝑦 𝑑𝑦
𝑑𝐶(𝑦) 𝑑𝐶 (𝑦)
𝑥2 + = 𝑥 2 − 1, = −1 𝑡ℎ𝑒𝑛 𝐶 (𝑦) = −𝑦
𝑑𝑦 𝑑𝑦
𝑥 2 𝑦 − 𝑦 = 𝐶.
Example 2:
Page 5 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
Solution:
𝜕𝑀 𝜕𝑁
= −2𝑥𝑦 =
𝜕𝑦 𝜕𝑥
1 2
1 2 2 1 2 1 2 2
𝑠𝑖𝑛 𝑥 − 𝑥 𝑦 + 𝑦 − 𝑦 𝑥 = 𝑐
2 2 2 2
Page 6 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
These terms are repeated, then the general solution of this equation be:
1 2
1 2 2 1 2
𝑠𝑖𝑛 𝑥 − 𝑥 𝑦 + 𝑦 = 𝑐
2 2 2
Method 2:
𝜕𝑓
𝑎𝑠 = 𝑀(𝑥, 𝑦) = (𝑐𝑜𝑠 𝑥 𝑠𝑖𝑛 𝑥 − 𝑥𝑦 2 )
𝜕𝑥
1 1
𝑓 = 𝑠𝑖𝑛2 𝑥 − 𝑥 2 𝑦 2 + 𝐶(𝑦)
2 2
Page 7 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝜕𝑓 𝑑𝑐(𝑦)
= −𝑥 2 𝑦 + = 𝑦 − 𝑥 2𝑦
𝜕𝑦 𝑑𝑦
𝑑𝑐(𝑦) 1 2
=𝑦 𝑡ℎ𝑒𝑛 𝑐 (𝑦) = 𝑦
𝑑𝑦 2
1 2
1 2 2 1 2
𝑓 = 𝑠𝑖𝑛 𝑥 − 𝑥 𝑦 + 𝑦 = 𝑐
2 2 2
Example 3:
Solution:
Page 8 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝜕𝑀
= 2𝑒 2𝑦 − [−𝑥𝑦 𝑠𝑖𝑛𝑥𝑦 + 𝑐𝑜𝑠𝑥𝑦]
𝜕𝑦
𝜕𝑁
= 2𝑒 2𝑦 − [−𝑥 𝑦 𝑠𝑖𝑛𝑥𝑦 + 𝑐𝑜𝑠𝑥𝑦]
𝜕𝑥
Using Method 2:
2𝑦 2𝑦
𝜕𝑓 𝜕𝑓
(𝑒 − 𝑦 𝑐𝑜𝑠 𝑥𝑦) 𝑑𝑥 + (2𝑥 𝑒 − 𝑥 𝑐𝑜𝑠 𝑥𝑦 + 2𝑦)𝑑𝑦 = 𝑑𝑥 + 𝑑𝑦
𝜕𝑥 𝜕𝑦
𝜕𝑓
= (𝑒 2𝑦 − 𝑦 𝑐𝑜𝑠 𝑥𝑦)
𝜕𝑥
𝜕𝑓 = (𝑒 2𝑦 − 𝑦 𝑐𝑜𝑠 𝑥𝑦) 𝑑𝑥
Page 9 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝑓 = 𝑥𝑒 2𝑦 − 𝑠𝑖𝑛𝑥𝑦 + 𝑐(𝑦)
𝜕𝑓 𝑑𝐶 (𝑦)
= 2𝑥𝑒 2𝑦 − 𝑥 𝑐𝑜𝑠𝑥𝑦 + = 2𝑥 𝑒 2𝑦 − 𝑥 𝑐𝑜𝑠 𝑥𝑦 + 2𝑦
𝜕𝑦 𝑑𝑦
𝑑𝐶 (𝑦)
= 2𝑦
𝑑𝑦
𝑐 (𝑦) = 𝑦 2
𝑓 = 𝑥𝑒 2𝑦 − 𝑠𝑖𝑛𝑥𝑦 + 𝑦 2 = 𝑐
Example 4:
Page 10 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝒚
(𝟏 + ) 𝒅𝒙 + 𝒍𝒏 𝒙 𝒅𝒚 = 𝟎
𝒙
Solution:
𝑦
𝑀(𝑥, 𝑦) = 1 + , 𝑁(𝑥, 𝑦) = 𝑙𝑛𝑥
𝑥
𝜕𝑀 1 𝜕𝑁 1
= , =
𝜕𝑦 𝑥 𝜕𝑥 𝑥
Using Method 1:
𝑦
∫ (1 + ) 𝑑𝑥 + ∫ 𝑙𝑛 𝑥 𝑑𝑦 = ∫ 0
𝑥
𝒙 + 𝒚 𝒍𝒏𝒙 + 𝒍𝒏𝒙 ∗ 𝒚 = 𝒄
Page 11 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝒙 + 𝒚 𝒍𝒏𝒙 = 𝒄
Page 12 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
Integrating factor
Examples:
Page 13 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
Solution:
𝝏𝑴
𝑴(𝒙, 𝒚) = (𝒙 + 𝒚) → =𝟏
𝝏𝒚
𝝏𝑵 𝟏
𝑵(𝒙, 𝒚) = 𝒙 𝒍𝒏 𝒙 → = 𝒙 ( ) + 𝒍𝒏 𝒙 = 𝟏 + 𝒍𝒏𝒙
𝝏𝒙 𝒙
𝝏𝑴 𝝏𝑵
≠ Not Exact
𝝏𝒚 𝝏𝒙
𝟏 𝟏
(𝒙 + 𝒚)𝒅𝒙 + ( )𝒙 𝒍𝒏 𝒙 𝒅𝒚 = 𝟎
𝒙 𝒙
𝒚
(𝟏 + ) 𝒅𝒙 + 𝒍𝒏 𝒙 𝒅𝒚 = 𝟎
𝒙
𝒚 𝝏𝑴 𝟏
𝑴(𝒙, 𝒚) = (𝟏 + ) → =
𝒙 𝝏𝒚 𝒙
Page 14 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝝏𝑵 𝟏
𝑵(𝑿, 𝒚) = 𝒍𝒏 𝒙 → =
𝝏𝒙 𝒙
Definition :
𝝏𝑴 𝝏𝑵
𝑴(𝒙, 𝒚)𝒅𝒙 + 𝑵(𝒙, 𝒚)𝒅𝒚 = 𝟎 is not exact i.e., ≠ .
𝝏𝒚 𝝏𝒙
Page 15 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝝏𝑴 𝝏𝑵
𝝁(𝒙, 𝒚)𝑴(𝒙, 𝒚)𝒅𝒙 + 𝝁(𝒙, 𝒚)𝑵(𝒙, 𝒚)𝒅𝒚 = 𝟎 is exact i.e., = .
𝝏𝒚 𝝏𝒙
Rule 1:
𝑴𝒚 − 𝑵𝒙
= 𝑷(𝒙)
𝑵
𝝁(𝒙, 𝒚) = 𝒆∫ 𝑷(𝒙)𝒅𝒙
Rule 2:
𝑵𝒙 − 𝑴𝒚
= 𝑸(𝒚)
𝑴
𝝁(𝒙, 𝒚) = 𝒆∫ 𝑸(𝒚)𝒅𝒚
Page 16 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
Rule 3:
And 𝒙𝑴 + 𝒚𝑵 ≠ 𝟎
𝟏
𝝁(𝒙, 𝒚) =
𝒙𝑴 + 𝒚𝑵
Rule 4:
𝒙𝑴 − 𝒚𝑵 ≠ 𝟎
Page 17 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝟏
𝝁(𝒙, 𝒚) =
𝒙𝑴 − 𝒚𝑵
Examples:
Solution:
𝝏𝑴 𝝏𝑵
= 𝟒𝒚𝟑 + 𝟐, = 𝒚𝟑 − 𝟒
𝝏𝒚 𝝏𝒙
𝝏𝑴 𝝏𝑵
Since ≠
𝝏𝒚 𝝏𝒙
Page 18 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝑴𝒚 − 𝑵𝒙 𝟒𝒚𝟑 + 𝟐 − 𝒚𝟑 + 𝟒
= 𝒊𝒔 𝒏𝒐𝒕 𝒂 𝒇𝒖𝒏𝒄𝒕𝒊𝒐𝒏 𝒊𝒏 𝒙
𝑵 𝒙𝒚𝟑 + 𝟐𝒚𝟒 − 𝟒𝒙
𝑵𝒙 − 𝑴𝒚 𝒚𝟑 − 𝟒 − 𝟒𝒚𝟑 − 𝟐 −𝟑𝒚𝟑 − 𝟔 −𝟑
= = =
𝑴 𝒚𝟒 + 𝟐𝒚 𝒚(𝒚𝟑 + 𝟐) 𝒚
−𝟑
∫ 𝒚 𝒅𝒚 −𝟑
𝝁(𝒙, 𝒚) = 𝒆∫ 𝑸(𝒚)𝒅𝒚 = 𝒆 = 𝒆−𝟑𝒍𝒏 𝒚 = 𝒆𝒍𝒏 𝒚
−𝟑
𝟏
𝝁=𝒚 = 𝟑
𝒚
Now:
Page 19 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝝏𝑴 𝝏𝑵
= 𝟏 − 𝟒𝒚−𝟑 = Exact D.E
𝝏𝒚 𝝏𝒙
𝝏𝒇
= 𝒚 + 𝟐𝒚−𝟐
𝝏𝒙
𝝏𝒇 = ( 𝒚 + 𝟐𝒚−𝟐 )𝝏𝒙
∫ 𝝏𝒇 = ∫( 𝒚 + 𝟐𝒚−𝟐 )𝝏𝒙
𝒇 = 𝒚𝒙 + 𝟐𝒙𝒚−𝟐 + 𝒄(𝒚)
𝝏𝒇 𝒅(𝒄𝒚)
= 𝒙 − 𝟒𝒙𝒚−𝟑 +
𝝏𝒚 𝒅𝒚
Comparing we get:
𝒅(𝒄𝒚)
= 𝟐𝒚
𝒅𝒚
Page 20 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝒄(𝒚) = 𝒚𝟐
𝒇 = 𝒚𝒙 + 𝟐𝒙𝒚−𝟐 + 𝒚𝟐
𝒅𝒚 𝒅𝒚
4- 𝒚 − 𝒙 𝒅𝒙 = 𝒙 + 𝒚 𝒅𝒙
As mentioned before that, the first order D.E is an equation that is linear in the
independent variable 𝑦 and its derivatives, then this type of equation take the form:
𝑦 ′ + 𝑃(𝑥 )𝑦 = 𝑞(𝑥)
Page 21 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝑑𝑦
Where 𝑝(𝑥 ), 𝑞(𝑥 )are given functions in 𝑥 only or constants. And the coefficient of 𝑑𝑥
𝜇(𝑥 ) = 𝑒 ∫ 𝑃(𝑥)𝑑𝑥
𝜇𝑦 = ∫ 𝜇 𝑞(𝑥 )𝑑𝑥 + 𝑐
Examples :
𝒅𝒚
[1] +𝟐𝒙𝒚=𝒙
𝒅𝒙
Solution:
Page 22 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
2 2
𝑒 𝑥 𝑦 = ∫ 𝑥𝑒 𝑥 𝑑𝑥 + 𝑐
2 1 2
𝑒𝑥 𝑦 = 𝑒𝑥 + 𝑐
2
𝒅𝒚
[2] 𝒙 𝒅𝒙 + 𝒚 = 𝟐𝒙
Solution:
1
𝑃(𝑥 ) = , 𝑞(𝑥 ) = 2
𝑥
1
∫𝑥 𝑑𝑥
𝜇(𝑥 ) = 𝑒 ∫ 𝑃(𝑥)𝑑𝑥 = 𝑒 =𝑥
Page 23 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝜇 𝑦 = ∫ 𝜇 𝑞(𝑥 )𝑑𝑥 + 𝑐
𝑥𝑦 = ∫ 2𝑥𝑑𝑥 + 𝑐
𝑥𝑦 = 𝑥 2 + 𝑐
𝒅𝒚
[3] 𝒙 𝒅𝒙 − 𝟒𝒚 = 𝒙𝟔 𝒆𝒙
Solution:
𝑑𝑦 4
− 𝑦 = 𝑥 5𝑒 𝑥
𝑑𝑥 𝑥
−4
𝑃(𝑥 ) = , 𝑞(𝑥 ) = 𝑥 5 𝑒 𝑥
𝑥
Page 24 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
−4 −4 )
∫ 𝑥 𝑑𝑥
𝜇(𝑥 ) = 𝑒 ∫ 𝑃(𝑥)𝑑𝑥 = 𝑒 = 𝑒 −4𝑙𝑛𝑥 = 𝑒 𝑙𝑥(𝑥 = 𝑥 −4
𝜇 𝑦 = ∫ 𝜇 𝑞(𝑥 )𝑑𝑥 + 𝑐
𝑥 −4 𝑦 = ∫ 𝑥𝑒 𝑥 𝑑𝑥 + 𝑐
𝑥 −4 𝑦 = 𝑥𝑒 𝑥 − 𝑒 𝑥 + 𝑐
Page 25 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
General form:
𝑦 ′ + 𝑃(𝑥 )𝑦 = 𝑞(𝑥)𝑦 𝑛
𝑦 −𝑛 𝑦 ′ + 𝑃(𝑥 )𝑦 𝑦 −𝑛 = 𝑞 (𝑥 )𝑦 𝑛 𝑦 −𝑛
Let 𝑦 1−𝑛 = 𝑍
(1 − 𝑛)𝑦 −𝑛 𝑦 ′ = 𝑍 ′
Page 26 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
′
𝑍
𝑦 −𝑛 𝑦 ′ =
1−𝑛
𝑍′
+ 𝑝(𝑥 )𝑍 = 𝑞 (𝑥 )
1−𝑛
𝑍 ′ + (1 − 𝑛)𝑝(𝑥 )𝑍 = (1 − 𝑛)𝑞(𝑥 )
𝑍 ′ + Ρ(𝑥 )𝑍 = 𝑄(𝑥)
Examples:
Solve the following differential equations:
𝟏
[1] 𝒚′ + 𝒚 = 𝒙 𝒚𝟐 (Multiply by 𝒚−𝟐 )
𝒙
Solution :
Page 27 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
1
𝑦 −2 𝑦 ′ + 𝑦. 𝑦 −2 = 𝑥 𝑦 2 . 𝑦 −2
𝑥
−2 ′
1 −1
𝑦 𝑦 + 𝑦 =𝑥
𝑥
𝐿𝑒𝑡 𝑍 = 𝑦 −1 → 𝑍 ′ = −𝑦 −2 𝑦 ′
1 1
Sub. −𝑍 ′ + 𝑍=𝑥 then 𝑍 ′ − 𝑍 = −𝑥
𝑥 𝑥
−1
∫ 𝑥 𝑑𝑥 −𝑙𝑛𝑥 𝑙𝑛𝑥 −1 𝑙𝑛
1 1
𝜇= 𝑒 =𝑒 =𝑒 =𝑒 𝑥 =
𝑥
1 1
𝑍 = ∫ − (𝑥) + 𝑐
𝑥 𝑥
1
𝑍 = −𝑥 + 𝑐
𝑥
1
= −𝑥 + 𝑐
𝑥𝑦
Page 28 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2
Basic Science Department
𝟏 𝟑
′
[2] 𝒚 𝒚 + 𝒚 = 𝟏 ,
𝟐 𝟐 𝒚(𝟎) = 𝟒
Page 29 of 29
Dr.Mohammed Elsayed BAS 111 Mathematics 3 Lec 2