Lecture 8
Lecture 8
Emad Al-Hemiary
Second Year, First Semester Non-Homogeneous ODE
and Higher Order ODEs
Non-Homogeneous ODE
Recalling the non-homogeneous 2nd order ODE given by:
𝑦 ′′ + 𝑝(𝑥)𝑦 ′ + 𝑞(𝑥)𝑦 = 𝑟(𝑥) (8.1)
With 𝑟(𝑥) ≢ 0, then the general solution is the sum of the general solution of the
homogeneous 𝑦ℎ (𝑥) and particular 𝑦𝑝 (𝑥):
Example 8.1:
Solve the following 2nd order ODE using undetermined coefficients method:
𝑦 ′′ + 5𝑦 ′ + 4𝑦 = 10𝑒 −3𝑥
1
Engineering Mathematics I Lecture 8: Prof. Dr. Emad Al-Hemiary
Second Year, First Semester Non-Homogeneous ODE
and Higher Order ODEs
Solution:
Our general solution is: 𝑦(𝑥) = 𝑦ℎ (𝑥) + 𝑦𝑝 (𝑥)
Since 𝑟(𝑥) = 10𝑒 −3𝑥 , then from table (8.1) we select 𝑦𝑝 (𝑥) = 𝑘𝑒 −3𝑥 . Substitute 𝑦𝑝 (𝑥) in ODE:
𝑦 ′′ + 5𝑦 ′ + 4𝑦 = 10𝑒 −3𝑥
𝑑2 −3𝑥 )
𝑑
(𝑘𝑒 + 5 (𝑘𝑒 −3𝑥 ) + 4𝑘𝑒 −3𝑥 = 10𝑒 −3𝑥
𝑑𝑥 2 𝑑𝑥
9𝑘𝑒 −3𝑥 − 15𝑘𝑒 −3𝑥 + 4𝑘𝑒 −3𝑥 = 10𝑒 −3𝑥 → −2𝑘 = 10 → 𝑘 = −5
Thus:
Example 8.2:
Solve the initial value problem 𝑦 ′′ + 𝑦 = 0.001𝑥 2 𝑦(0) = 0, 𝑦 ′ (0) = 1.5
Solution:
The general solution is given by:
𝑦(𝑥) = 𝑦ℎ (𝑥) + 𝑦𝑝 (𝑥)
Thus:
𝑦ℎ (𝑥) = 𝐴 cos 𝑥 + 𝐵 sin 𝑥
Non-homogeneous part 𝑦𝑝 (𝑥):
𝑦 ′′ + 𝑦 = 0.001𝑥 2
2
Engineering Mathematics I Lecture 8: Prof. Dr. Emad Al-Hemiary
Second Year, First Semester Non-Homogeneous ODE
and Higher Order ODEs
𝑑2
2
(𝑘2 𝑥 2 + 𝑘1 𝑥 + 𝑘0 ) + (𝑘2 𝑥 2 + 𝑘1 𝑥 + 𝑘0 ) = 0.001𝑥 2 → (2𝑘2 ) + (𝑘2 𝑥 2 + 𝑘1 𝑥 + 𝑘0 ) = 0.001𝑥 2
𝑑𝑥
𝑘2 = 0.001
{ 𝑘1 = 0 → 𝑘0 = −2𝑘2 → 𝑘0 = −2(0.001) → 𝑘0 = −0.002
2𝑘2 + 𝑘0 = 0
We therefore get:
𝑦𝑝 (𝑥) = 0.001𝑥 2 − 0.002
Example 8.3:
Solve the following 2nd order ODE using the method of undetermined coefficients:
𝑦 ′′ − 9𝑦 = 18 cos 𝜋𝑥
Solution:
Our general solution is: 𝑦(𝑥) = 𝑦ℎ (𝑥) + 𝑦𝑝 (𝑥)
From table (8.1) select 𝑦𝑝 (𝑥) = 𝑘1 cos 𝜋𝑥 + 𝑘2 sin 𝜋𝑥. Substitute 𝑦𝑝 (𝑥) in ODE:
𝑦 ′′ − 9𝑦 = 18 cos 𝜋𝑥
𝑑2
(𝑘 cos 𝜋𝑥 + 𝑘2 sin 𝜋𝑥) − 9(𝑘1 cos 𝜋𝑥 + 𝑘2 sin 𝜋𝑥) = 18 cos 𝜋𝑥
𝑑𝑥 2 1
𝑑
(−𝜋𝑘1 sin 𝜋𝑥 + 𝜋𝑘2 cos 𝜋𝑥) − 9𝑘1 cos 𝜋𝑥 − 9𝑘2 sin 𝜋𝑥 = 18 cos 𝜋𝑥
𝑑𝑥
−𝜋 2 𝑘1 cos 𝜋𝑥 − 𝜋 2 𝑘2 sin 𝜋𝑥 − 9𝑘1 cos 𝜋𝑥 − 9𝑘2 sin 𝜋𝑥 = 18 cos 𝜋𝑥
18
−𝜋 2 𝑘2 − 9𝑘2 = 0 → 𝑘2 = 0 → −𝜋 2 𝑘1 − 9𝑘1 = 18 → 𝑘1 = −
𝜋2 + 9
Finally, we get:
3
Engineering Mathematics I Lecture 8: Prof. Dr. Emad Al-Hemiary
Second Year, First Semester Non-Homogeneous ODE
and Higher Order ODEs
18
𝑦(𝑥) = 𝑐1 𝑒 −3𝑥 + 𝑐2 𝑒 3𝑥 − cos 𝜋𝑥
𝜋2 + 9
4
Engineering Mathematics I Lecture 8: Prof. Dr. Emad Al-Hemiary
Second Year, First Semester Non-Homogeneous ODE
and Higher Order ODEs
Example 8.4: Solve the 2nd order ODE using variation of parameters:
𝑒𝑥
𝑦 ′′ − 2𝑦 ′ + 𝑦 =
𝑥
Solution:
Our general solution is: 𝑦(𝑥) = 𝑦ℎ (𝑥) + 𝑦𝑝 (𝑥)
Thus:
𝑦ℎ (𝑥) = 𝑐1 𝑦1 + 𝑐2 𝑦2 = 𝑐1 𝑒 𝑥 + 𝑐2 𝑥𝑒 𝑥 = (𝑐1 + 𝑐2 𝑥)𝑒 𝑥
Non-homogeneous part 𝑦𝑝 (𝑥):
𝑒𝑥 𝑒𝑥
𝑦2 𝑟 𝑦1 𝑟 𝑥𝑒 𝑥 𝑥 𝑒𝑥 𝑥
𝑦𝑝 (𝑥) = −𝑦1 ∫ 𝑑𝑥 + 𝑦2 ∫ 𝑑𝑥 = −𝑒 𝑥 ∫ 2𝑥 𝑑𝑥 + 𝑥𝑒 𝑥 ∫ 2𝑥 𝑑𝑥 =
𝑊 𝑊 𝑒 𝑒
1
= −𝑒 𝑥 ∫ 𝑑𝑥 + 𝑥𝑒 𝑥 ∫ 𝑑𝑥 = −𝑒 𝑥 𝑥 + 𝑥𝑒 𝑥 ln|𝑥| = (ln|𝑥| − 1)𝑥𝑒 𝑥
𝑥
Combining the two parts, we get:
Example 8.5: Solve the 2nd order ODE using the method of variation of parameters:
𝑦 ′′ + 2𝑦 ′ − 3𝑦 = 𝑒 𝑥 − 𝑥 − 1
Solution:
Our general solution is: 𝑦(𝑥) = 𝑦ℎ (𝑥) + 𝑦𝑝 (𝑥)
5
Engineering Mathematics I Lecture 8: Prof. Dr. Emad Al-Hemiary
Second Year, First Semester Non-Homogeneous ODE
and Higher Order ODEs
Thus:
𝑦ℎ (𝑥) = 𝑐1 𝑒 𝑥 + 𝑐2 𝑒 −3𝑥
Non-homogeneous part 𝑦𝑝 (𝑥):
1 4 20
𝑦(𝑥) = 𝑐1 𝑒 𝑥 + 𝑐2 𝑒 −3𝑥 + (𝑥𝑒 𝑥 − 𝑒 𝑥 + 𝑥 + )
4 3 9
where:
𝑦ℎ (𝑥) = 𝑐1 𝑦1 + 𝑐2 𝑦2 + ⋯ + 𝑐𝑛 𝑦𝑛
{ (8.6)
𝑦𝑝 (𝑥) = 𝑣1 𝑦1 (𝑥) + 𝑣2 𝑦2 (𝑥) + ⋯ + 𝑣𝑛 𝑦𝑛 (𝑥)
Solution of (8.6) can be carried out using procedure 1 above. The following examples illustrate
this.
6
Engineering Mathematics I Lecture 8: Prof. Dr. Emad Al-Hemiary
Second Year, First Semester Non-Homogeneous ODE
and Higher Order ODEs
7
Engineering Mathematics I Lecture 8: Prof. Dr. Emad Al-Hemiary
Second Year, First Semester Non-Homogeneous ODE
and Higher Order ODEs
𝑒𝑥 1 𝑒𝑥 1 𝑒𝑥
𝑣1′ + 𝑣2′ 𝑒 𝑥 + 𝑣3′ 𝑒 2𝑥 = 0 𝑣1′ − + = 0 𝑣 ′
1 =
1 1 + 𝑒 −𝑥 2 1 + 𝑒 −𝑥 2 1 + 𝑒 −𝑥
𝑣2′ = − 𝑠𝑢𝑏 2 𝑎𝑛𝑑 3 𝑖𝑛1 1 1
⇒ 1 + 𝑒 −𝑥 ⇒ 𝑣2′ = − ⇒ 𝑣2
′
= −
1 𝑒 −𝑥 1 + 𝑒 −𝑥 1 + 𝑒 −𝑥
−𝑥
′
𝑣3 = ′
1 𝑒 ′
1 𝑒 −𝑥
{ 2 1 + 𝑒 −𝑥 𝑣 3 = 𝑣 =
{ 2 1 + 𝑒 −𝑥 { 3 2 1 + 𝑒 −𝑥
Then we integrate with respect to x to find 𝑣𝑖 :
1 𝑒𝑥 1 𝑒𝑥
𝑣1 = ∫ 𝑑𝑥 = ∫ 𝑒 𝑥 𝑑𝑥
2 1 + 𝑒 −𝑥 2 𝑒𝑥 + 1
Let 𝑢 = 𝑒 𝑥 + 1 → 𝑑𝑢 = 𝑒 𝑥 𝑑𝑥
1 𝑢−1 1 1 1 1
𝑣1 = ∫ 𝑑𝑢 = {∫ 1 𝑑𝑢 − ∫ 𝑑𝑢} = {𝑢 − ln|𝑢|} = {𝑒 𝑥 + 1 − ln|𝑒 𝑥 + 1|}
2 𝑢 2 𝑢 2 2
1 1
𝑣2 = − ∫ 𝑑𝑥 = − ∫ 𝑒 𝑥 𝑑𝑥
1 + 𝑒 −𝑥 𝑒𝑥 + 1
Let 𝑢 = 𝑒 𝑥 + 1 → 𝑑𝑢 = 𝑒 𝑥 𝑑𝑥
1
𝑣2 = − ∫ 𝑑𝑢 = − ln|𝑢| = − ln(𝑒 𝑥 + 1)
𝑢
1 𝑒 −𝑥
𝑣3 = ∫ 𝑑𝑥
2 1 + 𝑒 −𝑥
Let 𝑢 = 𝑒 −𝑥 + 1 → 𝑑𝑢 = −𝑒 −𝑥 𝑑𝑥
1 1 1 1
𝑣3 = − ∫ 𝑑𝑢 = − ln|𝑢| = − ln(𝑒 −𝑥 + 1)
2 𝑢 2 2
1 1
∴ 𝑦𝑝 (𝑥) = 𝑣1 𝑦1 + 𝑣2 𝑦2 + 𝑣3 𝑦3 = {𝑒 𝑥 + 1 − ln|𝑒 𝑥 + 1|} − 𝑒 𝑥 ln(𝑒 𝑥 + 1) − 𝑒 2𝑥 ln(𝑒 −𝑥 + 1)
2 2
Finally, we get:
1 1
𝑦(𝑥) = 𝑐1 + 𝑐2 𝑒 𝑥 + 𝑐3 𝑒 2𝑥 + {𝑒 𝑥 + 1 − ln|𝑒 𝑥 + 1|} − 𝑒 𝑥 ln(𝑒 𝑥 + 1) − 𝑒 2𝑥 ln(𝑒 −𝑥 + 1)
2 2