CALENG3 - Lecture 5 - N-TH Order Nonhomogeneous Linear ODE-1
CALENG3 - Lecture 5 - N-TH Order Nonhomogeneous Linear ODE-1
Differential
Equations
Lecture 5
n-th Order Non-homogeneous Linear Ordinary
Differential Equations
2
Method of Undetermined
Coefficients
Consider an ODE with constant coefficients
dny d n 1 y dy
f ( D ) y a0 n a1 n1 ... a n1 a n y R( x ) f 1 ( x ) f 2 ( x )
dx dx dx
f ( D ) y R( x )
3
Method of Undetermined
Coefficients
• To use the Method of Undetermined Coefficients, R(x)
must be a solution to a homogeneous or convertible to
one.
• Which of the following functions is a solution to a
homogeneous linear ODE and what are the roots that
correspond to them?
2
( )
𝑅 𝑥 =5 𝑥+ 3 𝑥 𝑅 ( 𝑥 )=3 𝑥 cos (4 𝑥)
𝑅 ( 𝑥 )=4 𝑒
−8 𝑥
sin (2 𝑥) 𝑅 ( 𝑥 )=3 ln (𝑥)
7 𝑅 ( 𝑥 )=cosh (3 𝑥)
𝑅 ( 𝑥 )=
𝑥 𝑅 ( 𝑥 )=sin ( 𝑥 ) cos ( 𝑥 )
4
Finding the Annihilating Operator
Given a function R(x), then if L is a linear differential
operator with constant coefficients, then if
L(R(x)) = 0
then L is the annihilating operator of R(x).
To find the annihilating operator
1. Determine the roots: m1, m2,… mn of the characteristic
equation that would correspond to f(x)
2. Construct the characteristic equation f(m) that would
give the roots: m1, m2,… mn
3. Obtain the Annihilating Operator L = f(D)
Thus, for the non-homogeneous differential equation,
5
Finding the Annihilating Operator
2
( )
𝑅 𝑥 =5 𝑥+ 3 𝑥
Recall that solutions of the form correspond to the repeated roots,
m1=m2=…= mn=a.
6
Finding the Annihilating Operator
−8 𝑥
( )
𝑅 𝑥 =4 𝑒 sin (2 𝑥)
Recall, solutions of the form:
correspond to the roots and
7
Finding the Annihilating Operator
𝑅 ( 𝑥 )=3 𝑥 cos 4 𝑥
Recall, solutions of the form:
8
Finding the Annihilating Operator 3𝑥 −3 𝑥
𝑅 ( 𝑥 )=cosh (3 𝑥) 𝑒 +𝑒
𝑅 ( 𝑥 )=
2
Recall, solutions of the form:
9
Finding the Annihilating Operator
sin 2 𝑥
𝑅 ( 𝑥 )=sin ( 𝑥 ) cos ( 𝑥 ) 𝑅 ( 𝑥 )=
2
Recall, solutions of the form:
correspond to the roots and
10
Method of Undetermined Coefficients
Example 𝑦 + 𝑦 ′−2 𝑦 =2 𝑥 −40 cos (2 𝑥
complementary solution
𝑦 + 𝑦 ′−2 𝑦 =
(𝐷¿¿2+𝐷 − 2) 𝑦=0¿
2
𝑚 +𝑚 − 2=0
(𝑚 −1)(𝑚+ 2)=0
𝑚1= 1 𝑚2 =−2
𝑥 − 2𝑥
𝑦 𝑐 =𝑐 1 𝑒 + 𝑐2 𝑒
11
Method of Undetermined Coefficients
Example 𝑦 + 𝑦 ′−2 𝑦 =2 𝑥 −40 cos (2 𝑥
particular solution
𝑅 (𝑥 )=2 𝑥 − 40 cos (2 𝑥)
obtain the annihilating operator
12
Method of Undetermined Coefficients
Example 𝑦 + 𝑦 ′−2 𝑦 =2 𝑥 −40 cos (2 𝑥
solve the resulting homogeneous differential equation
𝑚1= 𝑚2= 0 𝑚3 =2 𝑖 𝑚4 =− 2𝑖 𝑚5 =1 𝑚6 =− 2
𝑦 =𝑐 1 +𝑐 2 𝑥 +𝑐 3 cos 2 𝑥 +𝑐 3 sin 2 𝑥 +𝑐 5 𝑒 𝑥 + 𝑐6 𝑒 −2 𝑥
13
Method of Undetermined Coefficients
Example 𝑦 + 𝑦 ′−2 𝑦 =2 𝑥 −40 cos (2 𝑥
need to find the constants A, B,
𝑦 𝑝 = 𝐴+ 𝐵𝑥+ 𝐸 cos 2 𝑥 + 𝐹 sin 2 𝑥 E and F that would satisfy the
differential equation
′
𝑦 𝑝 =𝐵− 2 𝐸 sin 2 𝑥 +2 𝐹 cos 2 𝑥
′′
𝑦 𝑝 =− 4 𝐸 cos 2 𝑥 − 4 𝐹 sin 2 𝑥
14
Method of Undetermined Coefficients
Example 𝑦 + 𝑦 ′−2 𝑦 =2 𝑥 −40 cos (2 𝑥
complementary solution
( 𝐷 +9 ) 𝑦= 0
2
2
𝑚 + 9= 0
𝑚1= 3 𝑖𝑚2 =−3 𝑖
𝑦 𝑐 =𝑐 1 cos 3 𝑥+ 𝑐2 sin 3 𝑥
16
Example ( 𝐷 2 +9 ) 𝑦=5 𝑒 𝑥 −162 𝑥
particular solution
′′ 𝑥
𝑦 𝑝 + 9 𝑦 𝑝 =5 𝑒 − 162 𝑥
𝑥 𝑥 𝑥
𝑥
𝑅 ( 𝑥 )=5 𝑒 −162 𝑥 𝐴 𝑒 + 9( 𝐴 𝑒 + 𝐵+ 𝐸𝑥)=5 𝑒 −162 𝑥
𝑥 𝑥
′
𝑚1= 1 0
10 𝐴 𝑒 + 9 𝐵+9 𝐸𝑥=5 𝑒 − 162 𝑥
1
10 𝐴=5 𝐴=
𝑥
𝑦 𝑝 = 𝐴 𝑒 + 𝐵 + 𝐸𝑥 2
′ 𝑥
9 𝐵=0 𝐵 =0
𝑦 = 𝐴𝑒 +𝐸
𝑝 9 𝐸=−162 𝐸 =−18
′′ 𝑥
𝑦 𝑝= 𝐴 𝑒
1 𝑥
𝑦 𝑝= 𝑒 − 18 𝑥
2
2 ′
𝑚 −3 𝑚 − 4=0 𝑚1= − 1
−𝑥
(𝑚 − 4)(𝑚+ 1)=0 𝑦 𝑝= 𝐴 𝑒
𝑚1= 4 𝑚2 =− 1 𝑦 ′𝑝 =− 𝐴 𝑒− 𝑥
4𝑥 −𝑥 𝑦 ′𝑝′ = 𝐴 𝑒 − 𝑥
𝑦 𝑐 =𝑐 1 𝑒 +𝑐 2 𝑒
′′ ′ −𝑥
𝑦 𝑝 −3 𝑦 𝑝 − 4 𝑦 𝑝 =𝑒
−𝑥 −𝑥 −𝑥 −𝑥
𝐴 𝑒 − 3(− 𝐴𝑒 )− 4 𝐴𝑒 =𝑒
−𝑥
0=𝑒
Oops, something’s wrong.
𝑚+1=0 ( 𝐷+ 1 ) 𝑦= 0 𝑦 𝑝 = 𝐴 𝑥𝑒− 𝑥
𝐿= 𝑓 ( 𝐷 ) =𝐷+1 𝑦 ′ 𝑝 = 𝐴 𝑒− 𝑥 − 𝐴𝑥 𝑒− 𝑥 = 𝐴 ( 1− 𝑥 ) 𝑒 −𝑥
−𝑥 −𝑥
−𝑥 𝑦 ′ ′ 𝑝 =− 𝐴 ( 1 − 𝑥 ) 𝑒 + 𝐴 ( −1 ) 𝑒
(𝐷¿¿2−3 𝐷 − 4) 𝑦=𝑒 ¿ −𝑥 −𝑥
𝑦 ′ ′ 𝑝 =− 2 𝐴 𝑒 + 𝐴𝑥 𝑒
( 𝐷+1 ) (𝐷¿¿ 2− 3 𝐷 − 4) 𝑦= ( 𝐷+1 ) 𝑒 −𝑥 ¿ ′′ ′ −𝑥
𝑦 𝑝 −3 𝑦 𝑝 − 4 𝑦 𝑝 =𝑒
( 𝐷+1 ) (𝐷¿¿ 2− 3 𝐷 − 4) 𝑦=0 ¿
( 𝑚+1 ) (𝑚¿¿ 2 −3 𝑚− 4)=0 ¿
(𝑚+1)(𝑚+ 1)(𝑚 − 4 )=0 −𝑥 −𝑥 𝐴=−
1
′
𝑚1= 4
−5 𝐴 𝑒 =𝑒 5
1 −𝑥
′ ′
𝑚2 =𝑚3 =− 1 𝑦 𝑝 =− 𝑥𝑒
5
4𝑥 −𝑥 1 −𝑥
𝑦 =𝑐 1 𝑒 +𝑐 2 𝑒 − 𝑥𝑒
5
general solution 19
Example 2
𝑑 𝑦
+ 𝑦 =12 𝑐𝑜𝑠 2
𝑥
2
𝑑𝑥
𝑅 ( 𝑥 )=12 ¿ ¿
Using a trig identity, yes.
20
Method of Undetermined Coefficients
(A shortcut if R(x) = constant)
Find the particular solution:
0 +0 − 0+0 − 2 𝐴=9
9
𝐴=−
2
9
𝑦 𝑝 =−
2
21
Variation of Parameters
There are many functions for which an annihilating
operator cannot be found. For example:
For these, we use another technique called Variation of
Parameters.
It is important that Variation of Parameters be used only
when the Method of Undetermined Coefficients cannot be
used, because, as you will see, there are definite integrals
to be obtained in the end and these can be difficult to do.
22
Variation of Parameters
Given the differential equation f ( D ) y R( x )
with the complementary solution
yc c1 f1 ( x ) c2 f 2 ( x ) ... cn f n ( x )
The variation of parameters technique proposes that a
particular solution of the form
y p c1 ( x ) f 1 ( x ) c2 ( x ) f 2 ( x ) ... cn ( x ) f n ( x )
𝑦+ 𝑦 =
( 𝐷 2 +1 ) 𝑦 =0
2
𝑚 +1=0
𝑚1= 𝑖 𝑚2 =−𝑖
𝑦 𝑐 =𝑐 1 sin 𝑥 +𝑐 2 cos 𝑥
particular solution
(1)
′
𝑦 𝑝 =𝑐1 ( 𝑥 ) cos 𝑥 − 𝑐 2 ( 𝑥 ) sin ( 𝑥 ) (2)
25
(1)
(2)
(1)
+
(2)
𝑢=cos 𝑥
𝑑𝑢=−sin 𝑥 𝑑𝑥
26
plug into
(1)
2
′ sin 𝑥 2
𝑐 ( 𝑥 )=−
2 2
=− tan 𝑥
cos 𝑥
c1 ' ( x) f1 ( x) c2 ' ( x) f 2 ( x) 0
c1 ' ( x) f1 ' ( x) c2 ' ( x) f 2 ' ( x) Rx
28
Example
2 2𝑥
𝑑 𝑦 𝑑𝑦 𝑒
−3 +2 𝑦 = 2𝑥
𝑑𝑥
2
𝑑𝑥 1+ 𝑒
complementary solution
𝑑2 𝑦 𝑑𝑦
−3 +2 𝑦 =0
𝑑𝑥 2
𝑑𝑥
(𝐷¿¿2−3 𝐷+2) 𝑦=0¿
2
𝑚 − 3 𝑚+ 2= 0
(𝑚 −2)(𝑚 −1)=0
𝑚1 =𝑚 2 2 =1
𝑦 𝑐 =𝑐 1 𝑒 2 𝑥 +𝑐 2 𝑒 𝑥
particular solution
2𝑥 𝑥
𝑦 𝑝 =𝑐1 ( 𝑥 )𝑒 +𝑐 2 ( 𝑥) 𝑒
29
2𝑥 𝑥
𝑦 𝑝 =𝑐1 ( 𝑥 )𝑒 +𝑐 2 ( 𝑥) 𝑒
(2)
-
(1)
2𝑥
′ 2𝑥 𝑒 substitute into (1)
𝑐 ( 𝑥 )𝑒
1 = 2𝑥
1+ 𝑒 (1)
′ 1
𝑐 1 ( 𝑥 )= 2𝑥
1+𝑒
30
1 1
𝑐 1 ( 𝑥 )=ln|𝑢|− ln ¿𝑢 +1∨¿¿
′ 2
𝑐 ( 𝑥 )=
1 2𝑥
1+𝑒 2
1
1 𝑐 1 ( 𝑥 )=ln|𝑒 |− ln¿ 𝑒 +1∨¿¿
𝑥 2𝑥
𝑐 1 𝑥 =∫
( ) 2𝑥
𝑑𝑥 2
1+𝑒
1 2𝑥
𝑢=𝑒
𝑥
𝑑𝑢=𝑒 𝑑𝑥
𝑥
𝑐 1 ( 𝑥 )=𝑥 − ln ¿ 𝑒 +1∨¿ ¿
𝑥
2
𝑒
𝑐 1 ( 𝑥 )=∫ 𝑑𝑥
( 1+𝑒 ) 𝑒
2𝑥 𝑥
1
𝑐 1 ( 𝑥 )=∫ 𝑑𝑢
( 1+𝑢 ) 𝑢
2
𝑥 𝑥
𝑢=𝑒 𝑑𝑢=𝑒 𝑑𝑥
1= 𝐴 ( 𝑢 + 1 ) + ( 𝐵𝑢+ 𝐶 ) 𝑢
2
𝑐 1 ( 𝑥 )=∫
( 1 𝑢
− 2
𝑢 𝑢 +1
𝑑𝑢
)
31
1 2𝑥
𝑐 1 ( 𝑥 )=𝑥 − ln ¿ 𝑒 +1∨¿ ¿
2
𝑦 𝑝 =𝑐1 ( 𝑥 )𝑒 2 𝑥 +𝑐 2 ( 𝑥) 𝑒 𝑥
𝑦 𝑝 =¿
2𝑥 1 2𝑥 2𝑥 𝑥 −1 𝑥
𝑦 𝑝 =𝑥 𝑒 − 𝑒 ln ¿ 𝑒 +1∨¿ − 𝑒 tan ( 𝑒 ) ¿
2
2𝑥 𝑥
𝑦 𝑐 =𝑐 1 𝑒 +𝑐 2 𝑒
2𝑥 𝑥 2𝑥 1 2𝑥 2𝑥 𝑥 −1 𝑥
𝑦 =𝑐 1 𝑒 +𝑐 2 𝑒 + 𝑥 𝑒 − 𝑒 ln ¿ 𝑒 + 1∨¿ − 𝑒 tan ( 𝑒 ) ¿
2
general solution
32
wolframalpha.com
• y”-3y’+2y=cos(e^(-x))
33