Pmath 1 2
Pmath 1 2
𝑑𝑦
+ 𝑦𝑥 2 = 𝑓(𝑥) is a 1st order, 1st degree Ordinary Differential equation(ODE).
𝑑𝑥
𝑑2𝑥 𝑑𝑥 3
+ 5 ( ) − 4𝑥 = 𝑒 𝑡 is a 2nd order, 1st degree ODE.
𝑑𝑡 2 𝑑𝑡
𝑑𝑦
Example 1 = 𝑦, 𝑦(0) = 3, initial-value problem(IVP).
𝑑𝑥
𝑑𝑦 𝑑𝑦
Solution =𝑦⇒ = 𝑑𝑥
𝑑𝑥 𝑦
where 𝑒 𝑐 = 𝑘
𝑑𝑦 𝑥
Solution = − ⇒ 𝑦 𝑑𝑦 = −𝑥𝑑𝑥
𝑑𝑥 𝑦
Integrating
𝑦2 𝑥2
=− + 𝑐 ⇒ 𝑥 2 + 𝑦 2 = 2𝑐 = 𝑘 (ii)
2 2
42 + (−3)2 = 𝑘 ⇒ 𝑘 = 25
1
Linear 1st ordered ODEs
𝑑𝑦
𝑎(𝑥) + 𝑏(𝑥)𝑦 = 𝑓(𝑥) is a linear 1st order ODE.
𝑑𝑥
𝑑𝑦 𝑏(𝑥) 𝑑𝑦
and + 𝑦 = 𝑓(𝑥)/𝑎(𝑥) that is + 𝑝(𝑥)𝑦 = 𝑔(𝑥) ….. (i)
𝑑𝑥 𝑎(𝑥) 𝑑𝑥
is linear standard form .
In standard form
𝑑𝑦 4𝑦
− = 𝑥 5𝑒 𝑥 (ii)
𝑑𝑥 𝑥
−4
Here 𝑝(𝑥) =
𝑥
4
Now find ∫ 𝑝 𝑑𝑥 = ∫ − 𝑑𝑥 = −4 𝑙𝑛𝑥 = 𝑙𝑛𝑥 −4 .
𝑥
−4
So integrating factor (I.F.)= 𝑒 ∫ 𝑝𝑑𝑥 = 𝑒 𝑙𝑛𝑥 = 𝑥 −4 .
Now multiply both sides of equation (ii) by the I.F. and get
𝑥 −4 𝑑𝑦 4𝑦 𝑑
− . 𝑥 −4 = 𝑥 5 𝑒 𝑥 𝑥 −4 ⇒ (𝑦 𝑥 −4 ) = 𝑥𝑒 𝑥 .
𝑑𝑥 𝑥 𝑑𝑥
Integrating gives,
𝑦 𝑥 −4 = ∫ 𝑥𝑒 𝑥 𝑑𝑥 = 𝑥𝑒 𝑥 − 𝑒 𝑥 + 𝑐
So 𝑦 = 𝑥 5 𝑒 𝑥 − 𝑥 4 𝑒 𝑥 + 𝑐𝑥 4 is the solution .
𝑑𝑥
Example 2 Solve 𝑡 + (1 + 𝑡)𝑥 = 𝑒 −𝑡 𝑠𝑖𝑛2𝑡.
𝑑𝑡
2
Solution Standard form
𝑑𝑥 (1+𝑡) 𝑒 −𝑡 𝑠𝑖𝑛2𝑡
+ 𝑥= ( i)
𝑑𝑡 𝑡 𝑡
1+𝑡 1
Here 𝑝(𝑡) = = +1
𝑡 𝑡
1
∴ ∫ 𝑝(𝑡)𝑑𝑡 = ∫ ( + 1) 𝑑𝑡 = 𝑙𝑛𝑡 + 𝑡
𝑡
Integrating gives,
1
𝑥 𝑡𝑒 𝑡 = ∫ 𝑠𝑖𝑛2𝑡 𝑑𝑡 = − 𝑐𝑜𝑠2𝑡 + 𝑐, solution.
2
𝑑𝑥 𝑑𝑦
Examples (a) (𝑡 + 1) + 𝑥 = 𝑙𝑛𝑡 (b) + 𝑦 𝑡𝑎𝑛𝑡 = 𝑐𝑜𝑠 2 𝑡
𝑑𝑡 𝑑𝑡
𝑑𝑦 𝑑𝑦
(c ) 𝑥 + 4𝑦 = 𝑥 3 − 𝑥 (d) 𝑐𝑜𝑠𝑥 + (𝑠𝑖𝑛𝑥)𝑦 = 1
𝑑𝑥 𝑑𝑥
𝑑𝑟
(e ) + 𝑟 𝑠𝑒𝑐𝜃 = 𝑐𝑜𝑠𝜃
𝑑𝜃
Bernoulli’s Equations
𝑑𝑦
+ 𝑝(𝑥)𝑦 = 𝑓(𝑥) 𝑦 𝑛 [𝑛 ≠ 0,1] (i)
𝑑𝑥
3
𝑑𝑦 1
⇒ 𝑦 −2 + 𝑦 −1 = 𝑥 (ii)
𝑑𝑥 𝑥
We put 𝑢 = 𝑦 −1
𝑑𝑢 𝑑𝑦
∴ = (−1) 𝑦 −2
𝑑𝑥 𝑑𝑥
Then (ii) becomes
𝑑𝑢 𝑢 𝑑𝑢 𝑢
− + =𝑥⇒ − = −𝑥 which is linear. (iii)
𝑑𝑥 𝑥 𝑑𝑥 𝑥
1
Here 𝑝(𝑥) = −
𝑥
1
∴ ∫ 𝑝(𝑥)𝑑𝑥 = ∫ − 𝑑𝑥 = −𝑙𝑛𝑥
𝑥
−1 1
Now I.F. = 𝑒 −𝑙𝑛𝑥 = 𝑒 𝑙𝑛𝑥 = 𝑥 −1 =
𝑥
𝑑 1 1
( 𝑦) = −𝑥 ∙ = −1
𝑑𝑥 𝑥 𝑥
Integrating gives
1
𝑦 = −𝑥 + 𝑐 ⇒ 𝑦 = 𝑐𝑥 − 𝑥 2 , solution .
𝑥
𝑑𝑦 𝑑𝑦
Examples (a) 𝑥𝑦 2 = 𝑦 3 − 𝑥 3 , 𝑦(1) = 2 (b) 𝑥 − (1 + 𝑥)𝑦 = 𝑥𝑦 2
𝑑𝑥 𝑑𝑥
𝑑𝑦
(c ) √𝑦 + 3√𝑦 = 1 , 𝑦(0) = 4
𝑑𝑥
4
If 𝑧 = 𝑓(𝑥, 𝑦) is a function of variables , 𝑦 , then its total differential :
𝜕𝑓 𝜕𝑓
𝑑𝑧 = 𝑑𝑥 + 𝑑𝑦 (i)
𝜕𝑥 𝜕𝑦
𝜕𝑓 𝜕𝑓
So if we let 𝑀 = and 𝑁 = , then
𝜕𝑥 𝜕𝑦
𝜕 𝜕
(ii) becomes 𝑀𝑑𝑥 + 𝑁𝑑𝑦 = 0 and is exact if 𝑀= 𝑁 by (iii).
𝜕𝑦 𝜕𝑥
Example 1
Solution
𝜕𝑀 𝜕𝑁
We see that =
𝜕𝑦 𝜕𝑥
5
𝜕𝑓
Integrating 𝑀 = with respect to 𝑥, we have
𝜕𝑥
⇒ 𝑔′ (𝑦) = −𝑦
𝜕𝑓
Integrating = 𝑀 with respect to 𝑥,
𝜕𝑥
6
𝜕𝑓
𝑐𝑜𝑠𝑥 𝑐𝑜𝑠𝑦 + 𝑔′ (𝑦) = ⇒ 𝑐𝑜𝑠𝑥 𝑐𝑜𝑠𝑦 + 𝑔′ (𝑦) = 𝑁 = 𝑐𝑜𝑠𝑥 𝑐𝑜𝑠𝑦
𝜕𝑦
⇒ 𝑔′ (𝑦) = 0
Integrating
𝑔(𝑦) = 𝑘
Examples
(1)
𝑑2𝑦 𝑑𝑦
2 −5 −3𝑦 =0 (i) , homogeneous equation.
𝑑𝑡 2 𝑑𝑡
⇒ 2𝑚2 − 5𝑚 − 3 = 0 since 𝑒 𝑚𝑡 ≠ 0.
𝑚1 = 3, 𝑚2 = −1/2
7
1
We get 𝑦1 = 𝑒 3𝑡 and 𝑦2 = 𝑒 −2𝑡 are independent/fundamental solutions.
1
The general solution is 𝑦(𝑡) = 𝐴𝑒 3𝑡 + 𝐵𝑒 −2𝑡 .
Case (i) If 𝑚1 and 𝑚2 are real , distinct , then the general solution is
Case (iii) If 𝑚1 and 𝑚2 are complex, say 𝛼 ∓ 𝑖𝛽, then the solution
Say, 𝑚 = −2 ∓ 3𝑖
Examples
𝑑2𝑦 𝑑𝑦
1. − 10 + 25𝑦 = 0
𝑑𝑡 2 𝑑𝑡
𝑑𝑦 𝑚𝑡
𝑑2𝑦
= 𝑚𝑒 , 2 = 𝑚2 𝑒 𝑚𝑡
𝑑𝑡 𝑑𝑡
8
Putting these into equation (ii) , we get
⇒ 𝑚2 − 10𝑚 + 25 since 𝑒 𝑚𝑡 ≠ 0.
⇒ (𝑚 − 5)2 = 0 ⇒ 𝑚 = 5,5
𝑚2 𝑒 𝑚𝑡 + 4 𝑚𝑒 𝑚𝑡 + 7𝑒 𝑚𝑡 = 0 ⇒ (𝑚2 + 4𝑚 + 7)𝑒 𝑚𝑡 = 0
⇒ 𝑚2 + 4𝑚 + 7 = 0 since 𝑒 𝑚𝑡 ≠ 0
−4 ∓ √16 − 28 −4 ∓ √−12 −4 ∓ 2𝑖 √3
⇒𝑚= = = = −2 ∓ 𝑖√3
2 2 2
Then the general solution is 𝑥 = 𝑒 −2𝑡 (𝐴𝑐𝑜𝑠 √3 𝑡 + 𝐵𝑠𝑖𝑛√3 𝑡).
𝑑2𝑥 𝑑𝑥
Example 3 4 +4 + 17𝑥 = 0, (𝑖𝑣) 𝑥(0) = −1, 𝑥 ′ (0) = 2 .
𝑑𝑡 2 𝑑𝑡
…….. (vi)
−1 = 𝐴
𝑑3𝑦 𝑑2𝑦
Example 4 +3 − 4𝑦 = 0 (vii)
𝑑𝑡 3 𝑑𝑡 2
(vii) becomes
𝑚3 𝑒 𝑚𝑡 + 3𝑚2 𝑒 𝑚𝑡 − 4𝑒 𝑚𝑡 = 0
⇒ 𝑚2 (𝑚 − 1) + 4𝑚(𝑚 − 1) + 4(𝑚 − 1) = 0
⇒ 𝑚 = 1, 𝑚 = 2, 2.
10
Exercise
11
Higher Order Nonhomogeneous Equations
12
METHOD OF UNDETERMINED COEFFICIENTS
The first of two ways we shall consider for obtaining a particular solution 𝑦𝑝 for a
nonhomogeneous linear DE is called the method of undetermined coefficients. The
underlying idea behind this method is a conjecture about the form of 𝑦𝑝 , an
educated guess really, that is motivated by the kinds of functions that make up the
input function 𝑔(𝑥).
Example 1
𝑑2𝑦 𝑑𝑦
+4 − 2𝑦 = 2𝑥 2 − 3𝑥 + 6 (ii)
𝑑𝑥 2 𝑑𝑥
Solution
𝑦𝑐 = 𝑐1 𝑒 (−2+√6)𝑥 + 𝑐2 𝑒 (−2−√6)𝑥
13
𝑦𝑝 = 𝐴𝑥 2 + 𝐵𝑥 + 𝐶
2𝐴 + 4(2𝐴𝑥 + 𝐵) − 2(𝐴𝑥 2 + 𝐵𝑥 + 𝐶) = 2𝑥 2 − 3𝑥 + 6
⇒ −2𝐴 = 2 ⇒ 𝐴 = −1
5
8𝐴 − 2𝐵 = −3 ⇒ 2𝐵 = −8 + 3 = −5 ⇒ 𝐵 = −
2
2𝐴 + 4𝐵 − 2𝐶 = 6 ⇒ −2 − 10 − 2𝐶 = 6 ⇒ 2𝐶 = −12 − 6 = −18 ⇒ 𝐶 = −9
5
∴ 𝑦𝑝 = −𝑥 2 − 𝑥 − 9
2
Step 3
Example 2
𝑑3𝑦 𝑑2𝑦
+ = 𝑒 𝑡 𝑐𝑜𝑠𝑡.
𝑑𝑡 3 𝑑𝑡 2
Solution
Step 1
𝑑3𝑦 𝑑2 𝑦
For homogeneous part + = 0 , let 𝑦 = 𝑒 𝑚𝑡 .
𝑑𝑡 3 𝑑𝑡 2
𝑚3 + 𝑚2 = 0 ⇒ 𝑚 = 0, 0, −1.
14
So 𝑦𝑐 = 𝑐1 + 𝑐2 𝑡 + 𝑐3 𝑒 −𝑡 .
Step 2
= 2𝑒 𝑡 (𝐵𝑐𝑜𝑠𝑡 − 𝐴𝑠𝑖𝑛𝑡)
𝑑 3 𝑦𝑝
= 2𝑒 𝑡 (𝐵𝑐𝑜𝑠𝑡 − 𝐴𝑠𝑖𝑛𝑡) + 2𝑒 𝑡 [−𝐵𝑠𝑖𝑛𝑡 − 𝐴𝑐𝑜𝑠𝑡] = 2𝑒 𝑡 [(𝐵 − 𝐴)𝑐𝑜𝑠𝑡 −
𝑑𝑥 3
(𝐴 + 𝐵)𝑠𝑖𝑛𝑡].
⇒ 2(𝐵 − 𝐴) + 2𝐵 = 1 ⇒ 4𝐵 − 2𝐴 = 1
and
𝐵 1 1
and 𝐴 = − = − =−
2 5.2 10
1 1
𝑦𝑝 = 𝑒 𝑡 [− 𝑐𝑜𝑠𝑡 + 𝑠𝑖𝑛𝑡]
10 5
Therefore the general solution is
1 1
𝑦 = 𝑦𝑐 + 𝑦𝑝 = 𝑐1 + 𝑐2 𝑡 + 𝑐3 e−t + 𝑒 𝑡 (− 𝑐𝑜𝑠𝑡 + 𝑠𝑖𝑛𝑡)
10 5
15
𝑑2𝑥 𝑑𝑥
Example 3 Solve +4 + 4𝑥 = (3 + 𝑡)𝑒 −2𝑡 , 𝑥(0) = 2, 𝑥 ′ (0) = 5
𝑑𝑡 2 𝑑𝑡
𝑑2𝑥
Example 4 + 𝜔2 𝑥 = 𝐹0 𝑠𝑖𝑛𝜔𝑡 , 𝑥(0) = 0, 𝑥 ′ (0) = 0 .
𝑑𝑡 2
𝑑2 𝑥 𝑑𝑥
Example 5 +3 + 2𝑥 = 4 𝑡 2
𝑑𝑡 2 𝑑𝑡
Solution
𝑑2𝑥 𝑑𝑥
Step 1 We solve the homogeneous : +3 + 2𝑥 = 0
𝑑𝑡 2 𝑑𝑡
⇒ 𝑚 = −1, −2
Step 2
Let 𝑥𝑝 = 𝐴 + 𝐵𝑡 + 𝐶𝑡 2
𝑑𝑥𝑝 𝑑 2 𝑥𝑝
Then = 𝐵 + 2𝐶𝑡 and = 2𝐶
𝑑𝑡 𝑑𝑡 2
𝑑2𝑥 𝑑𝑥
Therefore +3 + 2𝑥 = 4 𝑡 2 gives
𝑑𝑡 2 𝑑𝑡
⇒ 2𝐶 = 4 ⇒ 𝐶 = 2
6𝐶 + 2𝐵 = 0 ⇒ 2𝐵 = −6𝐶 ⇒ 𝐵 = −3𝐶 = −6
2𝐶 + 3𝐵 + 2𝐴 = 0 ⇒ 4 − 18 + 2𝐴 = 0 ⇒ 2𝐴 = 14 ⇒ 𝐴 = 7
Thus 𝑥𝑝 = 𝐴 + 𝐵𝑡 + 𝐶𝑡 2 = 7 − 6𝑡 + 2𝑡 2
16
𝑑2 𝑥 𝑑𝑥
Example 6 Find the solution of − 2 𝑑𝑡 + 𝑥 = 𝑒 𝑡
𝑑𝑡 2
Solution
So 𝑥𝑐 = 𝑐1 𝑒 𝑡 + 𝑐2 𝑡 𝑒 𝑡
Step 2
Then let 𝑥𝑝 = 𝐴 𝑡 2 𝑒 𝑡
𝑑𝑥𝑝
∴ = 2𝐴𝑡𝑒 𝑡 + 𝐴 𝑡 2 𝑒 𝑡
𝑑𝑡
𝑑 2 𝑥𝑝
2
= 2𝐴𝑒 𝑡 + 2𝐴 𝑡𝑒 𝑡 + 2𝐴𝑡𝑒 𝑡 + 𝐴 𝑡 2 𝑒 𝑡 = 2𝐴𝑒 𝑡 + 4𝐴𝑡𝑒 𝑡 + 𝐴 𝑡 2 𝑒 𝑡
𝑑𝑡
𝑑2𝑥 𝑑𝑥
Thus 2
−2 + 𝑥 = 𝑒 𝑡 becomes
𝑑𝑡 𝑑𝑡
Exercise 4.4
17
18