Ordinary Differential Equation - Lecutre 2 - D.reda
Ordinary Differential Equation - Lecutre 2 - D.reda
Ordinary Differential Equation - Lecutre 2 - D.reda
𝑔 𝑥, 𝑦 𝑑𝑦 = 3𝑥 − 3𝑦 2 𝑑𝑦 = −𝑦 3 + 3𝑥𝑦
𝑔 𝑥, 𝑦 𝑑𝑦 = 𝑥𝑒 𝑦 + cos 𝑦 𝑑𝑦 = 𝑥𝑒 𝑦 + sin 𝑦
Add the two terms without repeating, and then the solution is
𝑥 3 + 𝑥𝑒 𝑦 + sin 𝑦 = 𝑐
Example (16):
Solve 2𝑥 + 6𝑥𝑦 2 𝑑𝑥 + 3𝑦 2 + 6𝑥 2 𝑦 𝑑𝑦 = 0
Solution:
𝑝 𝑥, 𝑦 = 2𝑥 + 6𝑥𝑦 2 ⟹ 𝑝𝑦 = 12𝑥𝑦 & 𝑔 𝑥, 𝑦 = 3𝑦 2 + 6𝑥 2 𝑦 ⟹ 𝑔𝑥
= 12𝑥𝑦
Since 𝑝𝑦 = 𝑔𝑥 then the equation is exact, its solution obtained as
𝑝 𝑥, 𝑦 𝑑𝑥 = 2𝑥 + 6𝑥𝑦 2 𝑑𝑥 = 𝑥 2 + 3𝑥 2 𝑦 2
𝑔 𝑥, 𝑦 𝑑𝑦 = 3𝑦 2 + 6𝑥 2 𝑦 𝑑𝑦 = 𝑦 3 + 3𝑥 2 𝑦 2
Add the two terms without repeating, and then the solution is
𝑥 2 + 3𝑥 2 𝑦 2 + 𝑦 3 = 𝑐
Exercise (3)
Find the general solution of the following differential
equation:
(1) 𝑥 2 + 𝑦 cos 𝑥 𝑑𝑥 + 𝑦 + sin 𝑥 𝑑𝑦 = 0
(2) 4𝑥 3 + 2𝑥𝑒 𝑦 𝑑𝑥 + 8 + 𝑥 2 𝑒 𝑦 𝑑𝑦 = 0
(3) 𝑦 + ln 𝑥 𝑑𝑥 + 𝑥 − sin 𝑦 𝑑𝑦 = 0
(4) 𝑦 + tan 𝑦 𝑑𝑥 + 𝑥 + 𝑥 sec 2 𝑦 𝑑𝑦 = 0
(5) 2 + cosh 𝑦 𝑑𝑥 + 𝑦 + 𝑥 sinh 𝑦 𝑑𝑦 = 0
[4] Linear differential equations:
First order linear differential equations takes the form
𝒚′ + 𝑷 𝒙 𝒚 = 𝑸 𝒙 (𝟒)
To solve equation (3) first we find the integrating factor
𝝁 = 𝒆 𝑷 𝒙 𝒅𝒙
Then we substitute in the solution formula
𝒚𝝁 = 𝝁𝑸 𝒙 𝒅𝒙 + 𝒄 (𝟓)
Example (17):
Solve
𝟏
𝒚′ − 𝒚 = 𝟒𝒙𝟐
𝒙
Solution:
𝟏
The equation is a linear and 𝑃 𝑥 = − , 𝑄 𝑥 = 𝟒𝒙𝟐 We can determine
𝒙
the integrating factor,
𝑷 𝒙 𝒅𝒙
𝟏
− 𝒅𝒙 − 𝐥𝐧 𝒙 𝐥𝐧(
𝟏
) 𝟏
𝝁=𝒆 =𝒆 𝒙 =𝒆 =𝒆 𝒙 =
𝒙
Substitute in the solution formula
𝟏 𝟏 𝒚
𝒚. = . 𝟒𝒙 𝒅𝒙 + 𝒄 ⟹ = 𝟐𝒙𝟐 + 𝒄
𝟐
𝒙 𝒙 𝒙
Example (18):
Solve
𝟏
𝒚′ + 𝒚 = sin 𝒙
𝒙
Solution:
𝟏
The equation is a linear and 𝑃 𝑥 = , 𝑄 𝑥 = sin 𝑥 We can determine the integrating
𝒙
factor,
𝟏
𝝁=𝒆 𝑷 𝒙 𝒅𝒙
=𝒆 𝒙𝒅𝒙 = 𝒆𝐥𝐧 𝒙 = 𝒆𝐥𝐧(𝒙) = 𝒙
Substitute in the solution formula
𝒚. 𝒙 = 𝒙. sin 𝑥 𝒅𝒙 + 𝒄
𝟏
𝒚. sec 𝒙 = cos 𝟐 𝒙 𝒅𝒙 + 𝒄 → 𝒚. sec 𝒙 = 𝟏 + cos 𝟐𝒙 𝒅𝒙
𝟐
𝟏 sin 𝟐𝒙
⟹ 𝒚. sec 𝒙 = (𝒙 + )+𝒄
𝟐 𝟐
Example (20):
Solve
𝒚′ + co𝑡 𝒙 . 𝒚 = 𝑠𝑖𝑛𝟐 𝒙
Solution:
The equation is a linear and 𝑃 𝑥 = co𝑡 𝒙 , 𝑄 𝑥 = 𝑠𝑖𝑛𝟐 𝒙We can determine the
integrating factor,
cos 𝒙
𝝁=𝒆 𝑷 𝒙 𝒅𝒙
=𝒆 co𝑡 𝒙𝒅𝒙
= 𝒆 sin 𝒙 𝒅𝒙 = 𝒆𝐥𝐧 sin 𝒙 = 𝒆𝐥𝐧 s𝑖𝑛 𝒙 = s𝑖𝑛 𝒙
Substitute in the solution formula (5)
𝒚. s𝑖𝑛 𝒙 = s𝑖𝑛 𝒙 . 𝑠𝑖𝑛𝟐 𝒙 𝒅𝒙 + 𝒄
cos 𝟑 𝒙
⟹ 𝒚. s𝑖𝑛 𝒙 = − cos 𝒙 + +𝒄
𝟑
Exercise (4)
Find the general solution of the following differential
equation:
(1) 𝒚′ − 𝐭𝐚𝐧 𝒙 . 𝒚 = 𝐬𝐞𝐜 𝒙
(2) 𝒚′ − 𝐜𝐨𝐭 𝒙 . 𝒚 = 𝐜𝐬𝐜 𝒙
𝟐
(3) 𝒚′ − .𝒚 = 𝟒
𝒙
′ 𝟐
(4) 𝒚 + .𝒚 = 𝒙
𝒙+𝟐
′ 𝟏
(5) 𝒚 + . 𝒚 = 𝟒 𝐥𝐧 𝒙
𝒙
Higher Order Linear Differential Equations with
Constant Coefficient
The second order ODE
Take the form
𝑎𝑦 " + 𝑏𝑦 ′ + 𝑐𝑦 = 𝑓 𝑥 (2)
Equation (2) can be written as
𝑎𝐷2 + 𝑏𝐷 + 𝑐 𝑦 = 𝑓 𝑥 → 𝐹 𝐷 𝑦 = 𝑓(𝑥) (3)
Where 𝐷 is the differential operator (𝐷𝑥 = 1, 𝐷𝑥 2 = 2𝑥, 𝐷2 𝑥 2 = 2, 𝐷 sin 𝑥 = cos 𝑥
1 1 𝑥2 1 3 𝑥4 1
And is the integral operator ( 𝑥 = , 𝑥 = , sin 𝑥 = − cos 𝑥,
𝐷 𝐷 2 𝐷 4 𝐷
And 𝐹 𝐷 = 𝑎𝐷2 + 𝑏𝐷 + 𝑐 is a polynomial in 𝐷.
The solution of (2) has the form
𝑦 = 𝑦𝑐 + 𝑦𝑝
Where 𝑦𝑐 : is the solution of homogenous equation 𝑎𝑦 " + 𝑏𝑦 ′ + 𝑐𝑦 = 0.
And 𝑦𝑝 : is the particular solution for nonhomogeneous equation (2) or (3).
Finding 𝐲𝐜 :
For the homogenous form of (2)
𝑎𝑦 " + 𝑏𝑦 ′ + 𝑐𝑦 = 0 (4)
Let the solution of (4) is
𝑦 = 𝑒 𝑚𝑥 → 𝑦 ′ = 𝑚𝑒 𝑚𝑥 → 𝑦 " = 𝑚2 𝑒 𝑚𝑥 (5)
Substituting from (5) in (4)
𝑎𝑚2 𝑒 𝑚𝑥 + 𝑏𝑚𝑒 𝑚𝑥 + 𝑐𝑒 𝑚𝑥 = 0 → (𝑎𝑚2 + 𝑏𝑚 + 𝑐)𝑒 𝑚𝑥 = 0
But 𝑒 𝑚𝑥 ≠ 0 then
𝑎𝑚2 + 𝑏𝑚 + 𝑐 = 0 (6)
Equation (6) is called the auxiliary (characteristic) equation, it is a second degree equation
and has two roots say (𝑚1 & 𝑚2 ), and this roots has the following cases:
If 𝒎𝟏 & 𝒎𝟐 are real and different then 𝒚𝒄 = 𝒄𝟏 𝒆𝒎𝟏 𝒙 + 𝒄𝟐 𝒆𝒎𝟐 𝒙 .
If 𝒎𝟏 = 𝒎𝟐 = 𝒎 are real and equal then 𝒚𝒄 = 𝒄𝟏 𝒆𝒎𝒙 + 𝒄𝟐 𝒙𝒆𝒎𝒙 .
If (𝒎𝟏,𝟐 = 𝜶 ± 𝒊𝜷) are imaginary then 𝒚𝒄 = 𝒆𝜶𝒙 (𝒄𝟏 𝐜𝐨𝐬 𝜷𝒙 + 𝒄𝟐 𝐬𝐢𝐧 𝜷𝒙).
Example (21):
Solve
𝑦 " − 5𝑦 ′ + 6𝑦 = 0
Solution
Since 𝑔(𝑥) = 0 so general solution is
𝑦 = 𝑦𝑐
To find 𝑦𝑐 , the characteristic equation formed as
(replace 𝑦 " by 𝑚2 , 𝑦 ′ by 𝑚, 𝑦 by 1)
𝑚2 − 5𝑚 + 6 = 0 → 𝑚 − 3 𝑚 − 2 = 0
which gives roots 𝑚1 = 3, 𝑚2 = 2 (Distinct roots). Hence
𝑦𝑐 = 𝑐1 𝑒 3𝑥 + 𝑐2 𝑒 2𝑥 .
Example (22):
Solve
𝐷2 − 3𝐷 + 2 𝑦 = 0
Solution
Since 𝑔(𝑥) = 0 so general solution is
𝑦 = 𝑦𝑐
To find 𝑦𝑐 , the characteristic equation formed as
(replace𝐷2 by 𝑚2 , 𝐷by 𝑚, 2 stay as it )
𝑚2 − 3𝑚 + 2 = 0 → 𝑚 − 2 𝑚 − 1 = 0
which gives roots 𝑚1 = 1, 𝑚2 = 2 (Distinct roots). Hence
𝑦𝑐 = 𝑐1 𝑒 𝑥 + 𝑐2 𝑒 2𝑥 .
Example (23):
Solve
2𝑦 " + 5𝑦 ′ + 2𝑦 = 0
Solution
Since 𝑔(𝑥) = 0 so general solution is
𝑦 = 𝑦𝑐
To find 𝑦𝑐 , the characteristic equation formed as
(replace 𝑦 " by 𝑚2 , 𝑦 ′ by 𝑚, 𝑦 by 1)
2𝑚2 + 5𝑚 + 2 = 0 → 2𝑚 + 1 𝑚 + 2 = 0
1
which gives roots 𝑚1 = − , 𝑚2 = −2 (Distinct roots). Hence
2
1
− 𝑥
𝑦𝑐 = 𝑐1 𝑒 2 + 𝑐2 𝑒 −2𝑥 .
Example (24):
Solve
𝑦 " − 2𝑦 ′ + 𝑦 = 0
Solution
Since 𝑔(𝑥) = 0 so general solution is
𝑦 = 𝑦𝑐
To find 𝑦𝑐 , the characteristic equation formed as
(replace 𝑦 " by 𝑚2 , 𝑦 ′ by 𝑚, 𝑦 by 1)
𝑚2 − 2𝑚 + 1 = 0 → 𝑚 − 1 𝑚 − 1 = 0
which gives roots 𝑚1 = 𝑚2 = 1 (equal roots). Hence
𝑦𝑐 = 𝑐1 𝑒 𝑥 + 𝑐2 𝑥𝑒 𝑥 .
Example (25):
Solve
𝑦 " + 8𝑦 ′ + 16𝑦 = 0
Solution
Since 𝑔(𝑥) = 0 so general solution is
𝑦 = 𝑦𝑐
To find 𝑦𝑐 , the characteristic equation formed as
(replace 𝑦 " by 𝑚2 , 𝑦 ′ by 𝑚, 𝑦 by 1)
𝑚2 + 8𝑚 + 16 = 0 → 𝑚 + 4 𝑚 + 4 = 0
which gives roots 𝑚1 = 𝑚2 = −4 (equal roots). Hence
𝑦𝑐 = (𝑐1 +𝑐2 𝑥)𝑒 −4𝑥 .
Example (26):
Solve
𝑦 " − 6𝑦 ′ + 13𝑦 = 0
Solution
Since 𝑔(𝑥) = 0 so general solution is
𝑦 = 𝑦𝑐
To find 𝑦𝑐 , the characteristic equation formed as
(replace 𝑦 " by 𝑚2 , 𝑦 ′ by 𝑚, 𝑦 by 1)
𝑚2 − 6𝑚 + 13 = 0
−𝑏± 𝑏2 −4𝑎𝑐 6± 36−52
which gives roots 𝑚 = = = 3 ± 2𝑖
2𝑎 2
𝑚1,2 = 3 ± 2𝑖 (imaginary roots). Hence
𝑦𝑐 = 𝑒 3𝑥 (𝑐1 cos 2𝑥 + 𝑐2 sin 2𝑥).
Example (27):
Solve
𝐷2 − 2𝐷 + 5 𝑦 = 0
Solution
Since 𝑔(𝑥) = 0 so general solution is
𝑦 = 𝑦𝑐
To find 𝑦𝑐 , the characteristic equation formed as
(replace𝐷2 by 𝑚2 , 𝐷by 𝑚, 2 stay as it )
𝑚2 − 2𝑚 + 5 = 0
−𝑏± 𝑏2 −4𝑎𝑐 2± 4−20
which gives roots 𝑚 = = = 1 ± 2𝑖
2𝑎 2
𝑚1,2 = 1 ± 2𝑖 (imaginary roots). Hence
𝑦𝑐 = 𝑒 𝑥 (𝑐1 cos 2𝑥 + 𝑐2 sin 2𝑥).
Example (28):
Solve
𝐷3 + 4𝐷 𝑦 = 0
Solution
Since 𝑔(𝑥) = 0 so general solution is
𝑦 = 𝑦𝑐
To find 𝑦𝑐 , the characteristic equation formed as
(replace𝐷2 by 𝑚2 , 𝐷by 𝑚, 2 stay as it )
𝑚3 + 4𝑚 = 0 → 𝑚 𝑚2 + 4 = 0, 𝑚 = 0 &𝑚2 = −4
which gives roots 𝑚1 = 0, 𝑚2,3 = ±2𝑖
±2𝑖 (imaginary roots), 𝑚1 = 0 real root . Hence
𝑦𝑐 = 𝑐1 𝑒 𝑥 + 𝑒 0𝑥 (𝑐2 cos 2𝑥 + 𝑐3 sin 2𝑥).
𝑦𝑐 = 𝑐1 𝑒 𝑥 + 𝑐2 cos 2𝑥 + 𝑐3 sin 2𝑥.
Exercise (5)
Find the general solution of the following homogenous differential
equations:
(1) 𝒚′′ − 𝟕𝒚′ + 𝟔𝒚 = 𝟎