Lecture Two
Lecture Two
𝑑2𝑦 𝑑𝑦
𝑎 2+𝑏 + 𝑐𝑦 = 𝑓(𝑥)
𝑑𝑥 𝑑𝑥
Homogeneous if 𝑓(𝑥) = 0 and non-homogeneous if 𝑓(𝑥) ≠ 0
Homogeneous 2nd Order DEs
𝒅𝟐 𝒚 𝒅𝒚
𝒂 +𝒃 + 𝒄𝒚 = 𝟎 where a, b and c are constant coefficients.
𝒅𝒙𝟐 𝒅𝒙
𝒅𝒚 𝒅𝟐 𝒚
Now, 𝑦 = 𝐴𝑒 𝑚𝑥 = 𝐴𝑚𝑒 𝑚𝑥 = 𝐴𝑚2 𝑒 𝑚𝑥
𝒅𝒙 𝒅𝒙𝟐
Case 1: Real and different roots of the auxiliary equation occur when 𝑏 2 − 4𝑎𝑐 > 0
If 𝑚1 and 𝑚2 are the roots, then the general solution is of the form 𝑦 = 𝐴𝑒 𝑚1𝑥 + 𝐵𝑒 𝑚2𝑥
Example
𝒅𝟐 𝒚 𝒅𝒚
Solve the equation +𝟑 + 𝟐𝒚 = 𝟎
𝒅𝒙𝟐 𝒅𝒙
Solution
Yusuf Kyambadde 1
The auxiliary equation is
𝑚2 + 3𝑚 + 2 = 0 (𝑚 + 1)(𝑚 + 2) = 0 𝑚 = −1 and 𝑚 = −2
The solution is 𝑦 = 𝐴𝑒 −𝑥 + 𝐵𝑒 −2𝑥
Question
𝒅𝟐 𝒚 𝒅𝒚
Solve the Des; (a) −𝟕 + 𝟏𝟐𝒚 = 𝟎 Ans: 𝑦 = 𝐴𝑒 3𝑥 + 𝐵𝑒 4𝑥
𝒅𝒙𝟐 𝒅𝒙
𝒅𝟐 𝒚 𝒅𝒚
(b) +𝟑 − 𝟏𝟎𝒚 = 𝟎 Ans: 𝑦 = 𝐴𝑒 2𝑥 + 𝐵𝑒 −5𝑥
𝒅𝒙𝟐 𝒅𝒙
Case 2: Real double root of the auxiliary equation occurs when 𝑏 2 − 4𝑎𝑐 = 0
If the double root is 𝑚, then the general solution is of the form 𝑦 = 𝑒 𝑚𝑥 (𝐴 + 𝐵𝑥)
𝒅𝟐 𝒚 𝒅𝒚
Example: Solve the DE +𝟔 + 𝟗𝒚 = 𝟎
𝒅𝒙𝟐 𝒅𝒙
Solution
The auxiliary equation is
𝑚2 + 6𝑚 + 9 = 0 (𝑚 + 3)(𝑚 + 3) = 0 𝑚 = −3 (twice)
The solution is 𝑦 = 𝑒 −3𝑥 (𝐴 + 𝐵𝑥)
Question: Solve the DE
𝒅𝟐 𝒚 𝒅𝒚
(a) +𝟒 + 𝟒𝒚 = 𝟎 Ans: 𝑦 = 𝑒 −2𝑥 (𝐴 + 𝐵𝑥)
𝒅𝒙𝟐 𝒅𝒙
𝒅𝟐 𝒚 𝒅𝒚
(b) + 𝟏𝟎 + 𝟐𝟓𝒚 = 𝟎 Ans: 𝑦 = 𝑒 −5𝑥 (𝐴 + 𝐵𝑥)
𝒅𝒙𝟐 𝒅𝒙
Yusuf Kyambadde 2
Then;
𝑦 = 𝑒 𝛼𝑥 [𝐶(cos 𝛽𝑥 + 𝑖 sinβ 𝑥) + 𝐷(cos 𝛽𝑥 − 𝑖 sinβ 𝑥)]
= 𝑒 𝛼𝑥 [(𝐶 + 𝐷) cos 𝛽𝑥 + 𝑖(𝐶 − 𝐷)sinβx]
𝒚 = 𝒆𝜶𝒙 [𝑨 𝐜𝐨𝐬 𝜷𝒙 + 𝒊𝑩𝐬𝐢𝐧𝛃𝒙] where 𝐴 = 𝐶 + 𝐷 and 𝐵 =𝐶−𝐷
or
if we instead let 𝑩 = 𝒊(𝑪 − 𝑫), then 𝒚 = 𝒆𝜶𝒙 [𝑨 𝐜𝐨𝐬 𝜷𝒙 + 𝑩𝐬𝐢𝐧𝛃𝒙] ………(1)
⇒ Use equation (1) as the general solution where we have complex roots.
Please take note of this equation
Hence if 𝑚 = 𝛼 ± 𝑖𝛽, the general solution is of the form
as it does not contain 𝒊.
𝑦 = 𝑒 𝛼𝑥 [𝐴 cos 𝛽𝑥 + 𝐵sinβ𝑥] So correct your lecture notes
𝒅𝟐 𝒚 𝒅𝒚
Example. Solve the DE +𝟒 + 𝟗𝒚 = 𝟎
𝒅𝒙𝟐 𝒅𝒙
Solution
The auxiliary equation is 𝑚2 + 4𝑚 + 9 = 0
−4±√(16−36) −4±√−20 −4±𝑖2√5
⸫𝑚 = = = = −2 ± 𝑖√5
2 2 2
𝛼 = −2 and 𝛽 = √5
The solution is: 𝑦 = 𝑒 −2𝑥 [𝐴 cos √5𝑥 + 𝐵sin√5𝑥]
Question: Solve the DE
𝑑2𝑦 𝑑𝑦
(a) −2 + 10𝑦 = 0 Ans: 𝑦 = 𝑒 𝑥 [𝐴 cos 3𝑥 + 𝐵sin3𝑥]
𝑑𝑥 2 𝑑𝑥
Yusuf Kyambadde 3
In Summary
𝒅𝟐 𝒚 𝒅𝒚
Equations of the form 𝒂 +𝒃 + 𝒄𝒚 = 𝟎.
𝒅𝒙𝟐 𝒅𝒙
Then 𝑦 = 𝐶𝑒 𝑛𝑥 + 𝐷𝑒 −𝑛𝑥
Since 𝑒 𝑛𝑥 = cosh 𝑛𝑥 + sinh 𝑛𝑥 and 𝑒 −𝑛𝑥 = cosh 𝑛𝑥 − sinh 𝑛𝑥
So 𝑦 = 𝐴 cosh 𝑛𝑥 + 𝐵 sinh 𝑛𝑥
𝒅𝟐 𝒚 𝒅𝟐 𝒚
Example: Solve (a) 𝟐
+ 𝟏𝟔𝒚 = 𝟎 (b) − 𝟑𝒚 = 𝟎
𝒅𝒙 𝒅𝒙𝟐
Solution
(a )𝑚2 = −16 𝑚 = ±4𝑖 𝑦 = 𝐴 cos 4𝑥 + 𝐵 sin 4𝑥
(b) 𝑚2 = 3 𝑚 = ±√3 𝑦 = 𝐴 cosh √3𝑥 + 𝐵 sinh √3𝑥
Question
𝒅𝟐 𝒚
Solve + 𝟓𝒚 = 𝟎
𝒅𝒙𝟐
Yusuf Kyambadde 4
Non-Homogeneous Equations
𝑑2𝑦 𝑑𝑦
These are of the form, 𝑎 +𝑏 + 𝑐𝑦 = 𝑓(𝑥) where 𝑓(𝑥) ≠ 0 (1)
𝑑𝑥 2 𝑑𝑥
𝑑2𝑦 𝑑𝑦
The corresponding homogeneous ODE is , 𝑎 +𝑏 + 𝑐𝑦 = 0 (2)
𝑑𝑥 2 𝑑𝑥
So 0 + 5𝐴 + 6(𝐴𝑥 + 𝐵) = 2𝑥 + 1 6𝐴𝑥 + 6𝐴 + 5𝐵 = 2𝑥 + 1
Comparing coefficients;
6𝐴 = 2 𝐴 = 1⁄3 and 6𝐴 + 5𝐵 = 1
𝑚 + 1 = ±𝑖 𝑚1 = −1 + 𝑖 and 𝑚2 = −1 − 𝑖
So 𝑦ℎ = 𝑒 −𝑥 (𝐶1 cos 𝑥 + 𝐶2 sin 𝑥)
Yusuf Kyambadde 6
𝑚2 + 4𝑚 + 5 = 0 (𝑚 + 2)2 − 4 + 5 = 0 (𝑚 + 2)2 = −1
𝑚 + 2 = ±𝑖 𝑚1 = −2 + 𝑖 and 𝑚2 = −2 − 𝑖
So 𝑦ℎ = 𝑒 −2𝑥 (𝐶1 cos 𝑥 + 𝐶2 sin 𝑥)
The particular integral is;
𝑦𝑝 = 𝐾1 𝑥2 + 𝐾2 𝑥 + 𝐾3 + 𝐴 cos 2𝑥 + 𝐵 sin 2𝑥
Solution:
𝑚3 − 2𝑚2 − 5𝑚 + 6 = 0
𝑚1 = 1, 𝑚2 = 3, 𝑚3 = −2
Hence 𝑦 = 𝐴𝑒 2𝑥 + 𝐵𝑒 3𝑥 + 𝐶𝑒 −2𝑥
Yusuf Kyambadde 8
Some Applications of 2nd Order ODEs
1. Electrical Circuits
𝑑𝑄
Let 𝑄(𝑡) be the charge in the capacitor at time 𝑡. Then is called the current, 𝐼. The battery produces
𝑑𝑡
a p,d resulting in current 𝐼 when the switch is closed. The resistance 𝑅 results in a voltage drop 𝑉 = 𝐼𝑅.
The coil of wire (inductor) produces a magnetic field resisting change in the current. The voltage drop
𝑑𝐼 𝑄
created is 𝐿 𝑑𝑡 . The capacitor produces a voltage drop 𝑉 = ⁄𝐶 .
Kirchhoff’s Voltage Law gives that the algebraic sum of the voltage drops around a circuit is zero;
𝑑𝐼 𝑄 𝑑𝑄
𝐼𝑅 + 𝐿 𝑑𝑡 + 𝐶 = 𝐸(𝑡) But, 𝐼= 𝑑𝑡
𝑑2 𝑄 𝑑𝑄 𝑄 1
𝐿 𝑑𝑡 2 + 𝑅 𝑑𝑡 + 𝐶 = 𝐸(𝑡) 𝐿𝑚2 + 𝑅𝑚 + 𝐶 = 𝐸(𝑡)
𝑅 √𝑅 2 −4𝐿 ⁄𝐶 𝑅 √𝑅 2 −4𝐿 ⁄𝐶
𝑚1 = − + and 𝑚2 = − −
2𝐿 2𝐿 2𝐿 2𝐿
Yusuf Kyambadde 9
𝑅
In this case 𝑚1 = 𝑚2 = −
2𝐿
Example
Find the charge and current at time 𝑡
when the switch is closed if 𝑅 =
40 Ω, 𝐿 = 1 𝐻, 𝐶 = 1.6𝑚𝐹, 𝐸(𝑡) =
100 cos 10𝑡 and the initial charge
and current are both zero.
Solution
𝑑𝐼 1 𝑑𝑄
KVL: 𝐿 𝑑𝑡 + 𝐼𝑅 + 𝐶 𝑄 = 𝐸(𝑡) But 𝐼= 𝑑𝑡
𝑑2 𝑄 𝑑𝑄 1 𝑑2 𝑄 𝑑𝑄
𝐿 𝑑𝑡 2 + 𝑅 𝑑𝑡 + 𝐶 𝑄 = 𝐸(𝑡) + 40 𝑑𝑡 + 625𝑄 = 100 cos 10𝑡…………………..(1)
𝑑𝑡 2
Yusuf Kyambadde 10
𝑄𝑝 (𝑡) = 𝐴 cos 10𝑡 + 𝐵 sin 10𝑡 𝑄 ′ = −10𝐴 sin 10𝑡 + 10𝐵 cos 10𝑡
−100𝐴 cos 10𝑡 − 100𝐵 sin 10𝑡 + 40(−10𝐴 sin 10𝑡 + 10𝐵 cos 10𝑡) + 625(𝐴 cos 10𝑡 + 𝐵 sin 10𝑡) =
100 cos 10𝑡
(525𝐴 + 400𝐵) cos 10𝑡 + (−400 + 525𝐵) sin 10𝑡 = 100 cos 10𝑡
84 64
525A+400B=100 and −400 + 525𝐵 = 0 𝐴 = 697 𝑎𝑛𝑑 𝐵 = 679
1
⸫ 𝑄𝑝 (𝑡) = 697 (84 cos 10𝑡 + 64 sin 10𝑡)
84
Initially 𝑄(0) = 0 0 = 𝐶1 +
84
𝐶1 = 697
697
84 1
𝑄(𝑡) = 𝑒−20𝑡 ( cos 15𝑡 + 𝐶2 sin 15𝑡) + (84 cos 10𝑡 + 64 sin 10𝑡)
697 697
𝑑𝑄(𝑡) 40
𝐼(𝑡) = = 𝑒 −20𝑡 ((−20𝐶1 + 15𝐶2 ) cos 15𝑡 + (−15𝐶1 + 20𝐶2 ) sin 15𝑡) + 697 (16 cos 10𝑡 −
𝑑𝑡
21 sin 10𝑡)
640 464
Initially 𝐼(0) = 0 0 = −20𝐶1 + 15𝐶2 + 697 𝐶2 = 2091
Hence
4 𝑒−20𝑡
𝑄(𝑡) = [ (−63 cos 15𝑡 − 116 sin 15𝑡) + (21 cos 10𝑡 + 16 sin 10𝑡)]
697 3
And
1
𝐼(𝑡) = 2091 [𝑒 −20𝑡 (−1920 cos 15𝑡 + 13060 sin 15𝑡) + 120(16 cos 10𝑡 − 21 sin 10𝑡)]
Yusuf Kyambadde 11