Chapter 2 (Higher Order)
Chapter 2 (Higher Order)
TEC 3301
Lecture 2
ELECTRICAL ENGINEERING
DEPARTMENT BUK
CONTENTS
Dr.N. Magaji ODE -2nd and high order
Basic Concepts .
Homogeneous Differential Equations
Nonhomogeneous Differential Equations .
Undetermined Coefficients
Variation of Parameters
4
Dr.N. Magaji ODE -2nd and high order
○ Linear second-order differential equation
y P( x) y Q( x) y R( x)
Nonlinear: e.g., y P( x, y) y Q( x, y) R( x, y)
5
Dr.N. Magaji ODE -2nd and high order 2 Solving a second order differential equation
The simplest second order differential equation we come across is of the form:
d2y dy
a 2 b cy 0
dx dx
where a, b and c are numbers. To solve this we start by assuming that the solution is
y emx . As a guess substitute y emx it into the above equation and find:
am2emx bmemx ce mx 0
As every term is multiplied by e mx we can divide everywhere by e mx , leaving us with:
am2 bm c 0
This is known as the auxiliary equation. We use the quadratic formula to solve for
values of m :
b b 2 4ac
m1, 2
2a
The solution is one of three possible positions:
Dr.N. Magaji ODE -2nd and high order Solving a second order differential equation(cont.)
1) Distinct real roots
As long as b2 4ac is a positive number the auxiliary equation will yield two real
numbers m1 and m2 . Solve the characteristic equation for the two roots, to form the
general solution y Ae m1x Be m2 x .
If we have been supplied with boundary conditions we can solve for A and B to give
a particular solution.
2) Repeated real roots
If b 2 4ac is zero then m1 will be the same as m2 , i.e. m1 m2 , so we may as well
drop the subscript and call the single solution to the auxiliary equation simply m . To
make the two general solutions different we multiply one by x and form a solution of
the form: y A Bx emx
3) Imaginary roots
If b 2 4ac is negative then the only way to solve the quadratic is with imaginary
numbers. The two roots will be complex conjugates of each other, that is, both
solutions have the same numbers in their real and imaginary parts but one will have a
positive imaginary part and the other a minus:
m1 i , m2 i .
Here and are just numbers once again; This allows us to form the solution as:
y ex A cosx B sinx
Dr.N. Magaji ODE -2nd and high order Solving a second order differential equation(cont.)
Steps for solving
d2y dy
Starting from: a 2 b cy 0
dx dx
Form the auxiliary equation: am2 bm c 0
b b 2 4ac
Solve the auxiliary equation: m1, 2
2a
Then form the solution according to the following possibilities:
Finally, solve for constants if you have been given initial conditions.
Worked examples:
Example 1
Dr.N. Magaji ODE -2nd and high order
Find the general solution to the differential equation:
d2y dy
2 3y 0
dx 2 dx
and also the particular solution given initial conditions y0 0 and y' 0 1 .
Solution
First we form the auxiliary equation:
m2 2m 3 0.
In this instance it is simple to see that this can be factorised with ease giving:
m 3m 1 0,
so we can read off the solutions m1 3 and m2 1 . As we have two distinct real roots
we can say that the general solution is simply:
yx Ae 3 x Be x .
As we have been given initial conditions we can also find the particular values of A and
B. The first initial condition tells us that y 0 when x 0 ; substituting these values
into our general solution we get:
0 Ae30 Be 0 A B 0
(as e0 1)
The second initial condition tell us that the differential of y is 1 when x is 0. The
differential of the general solution is:
y' x 3 Ae 3 x Be x ,
substituting in the initial conditions we get: 1 3 A B.
Dr.N. Magaji ODE -2nd and high order Worked examples(cont.)
We can now solve these two equations simultaneously (see the simultaneous equation
1 1
help sheet and videos) to find: A ,B
4 4
y x e3 x e x
1 1
Thus the particular solution is:
4 4
Example 2
Find the general solution to the equation:
4 y' '4 y' y 0
and then find the particular solution that solves the boundary conditions y0 0,
y2 e .
Solution
First notice that the question has been given to us using dash notation; this question is
the same as:
d2y dy
4 4 y0
dx dx
Therefore we have the auxiliary equation:
4m2 4m 1 0
which isn’t obviously factorisable so we can use the quadratic formula:
m1, 2
4 42 4 4 1
24
we can see that 4 4 4 1 0 , therefore we only get one value for m which is
2
i.e. we have found that A 0 . From the second boundary condition we find:
2
y 2 2 Be
e 2
1
Dividing both sides by e we find: 2 B 1 B
2
x
1
Leaving us with the particular solution: y xe 2
2
Example 3
Find the general solution to the equation:
and then find the particular solution for the initial conditions y0 1 and y ' 0
1
.
2
Solution 3
We find the auxiliary equation to be:
2m2 6m 5 0
and once again a simple factorisation does not seem possible, so we use the quadratic
formula:
6 62 4 2 5
m1, 2 .
22
The first thing to notice is that 62 4 2 5 4 , so if we type this into a calculator we
will get an error. This means that the solutions are complex numbers:
3 1
m1, 2 i .
2 2
Dr.N. Magaji ODE -2nd and high order Worked examples Example 3 sol.(cont.)
3 1
This time we have complex roots with real part and the imaginary part .
2 2
Notice that we ignore the sign when reading off the second part. Looking back at the
table we can form the general solution:
x x x
3
yx e 2 A cos B sin .
2 2
To use the initial conditions to solve for the particular solution we will also need the
differential of the general solution:
3 2 x x x 2 x A x B x
3 3
y' x e A cos B sin e sin cos
2 2 2 2 2 2 2
Note that we had to use the product rule. From the first initial condition, y0 1 , we
find:
y0 e0 A cos0 B sin0 A 1
i.e. A 1 . From the second initial condition, y ' 0 , we find:
1
2
1
y' 0 e0 1 cos0 B sin 0 e0 sin 0 cos0 .
3 B 3 B 1
2 2 2 2 2 2
We can now solve this giving B 2 , therefore the particular solution is:
x x x
3
yx e 2 cos 2 sin .
2 2
Dr.N. Magaji ODE -2nd and high order Worked examples(cont.)
d2y dy
Example 4 Find the general solution to the equation: 2
3 0
dx dx
Solution 4
This equation looks a little different as it is missing a y term, but we can solve it in
the same way. First we form the auxiliary equation:
m2 3m 0,
which factorises to: mm 3 0
thus the solutions are m1 0 and m2 3 . It is common for people to ignore or forget
to include the m1 0 in the general solution. The correct general solution is:
yx Ae 0x Be 3 x
or simply: yx A Be 3 x .
Example 5 Find the general solution to the equation:
d2y dy
2
2y 0
dx dx
with the boundary conditions y 0 1 and y 0 .
Solution 5
Solving the differential equation should be fairly easy in this case. The auxiliary
equation is:
m2 m 2 0
which is factorised into: m 1m 2 0
and therefore the general solution is: yx Ae x Be 2 x .
Now we have to think about the boundary conditions we have been given. The second
condition imposes that as x gets very large y must approach zero. Looking at the
two terms in the general solution it is clear that the first one, Ae x , simply gets larger
and larger as x increases so we cannot include this in the particular solution.
Therefore we are forced to take A 0 . The second term, Be 2 x , does indeed get
smaller as x increases, therefore we can use the first boundary term to find B :
y0 Be 0 B 1,
Giving the particular solution: y x e 2 x .
d 2y dy
Example 6: Find the particular solution of
Dr.N. Magaji ODE -2nd and high order 2
4 13 0
dx dx
dy
given that when x 0, y 2 and 0
dx
4 42 4 113 4 36
m m m 2 3i
2 2
Step 3: General solution y e 2 x A cos 3x B sin 3x
Step 4: Use initial conditions to find A and B
2 e0 A cos 0 B sin 0 A 2
0
x 0, y 2
2 4
0 2 A 3B B
2 x 4
3 y e 2 cos 3x sin 3x
Particular Solution 3
3. NON-HOMOGENEOUS 2ND ORDER DIFFERENTIAL EQUATIONS
Dr.N. Magaji ODE -2nd and high order
Now we will take a look at NON-HOMOGENEOUS second order linear
d2y dy
differential equations which are of the form a 2 b cy Q( x)
dx dx
where Q(x) 0.
Method 1 Undetermined coefficient
To solve these, we begin in the same way as the homogeneous case
Step 1:Create an auxiliary equation.
Step 2:Solve the auxiliary equation (3 scenarios).
Step 3:State the general solution complementary function (3 scenarios). then
Step 4:Substitute the particular integral (*see below) into the original equation.
Step 5:Equate coefficients to get the particular integral (*see below).
Step 6:State the general solution = complementary function + particular integral
Example 7:
d 2 y dy
Find the general solution of 2 12 y x given that the particular integral is of
dx dx
the form y = Cx + D.
Dr.N. Magaji ODE -2nd and high order NON-HOMOGENEOUS 2ND ORDER DIFFERENTIAL EQUATIONS
Auxiliary equation is
m 2 m 12 0
(m 4)(m 3) 0
m 4 or m 3
Roots are real and distinct
therefore complementary function is y Ae4 x Be3x
dy d2y
We know that the particular integral is of the form y = Cx + D, so C and 0.
dx dx 2
Substituting back into the original equation gives
0 C 12 Cx D x
12Cx C 12D x and so by equating coefficients
12C 1 and C 12D 0
C 1 and D 1
12 144
y Ae4 x Be3x 1 x 1 .
12 144
Dr.N. Magaji ODE -2nd and high order NON-HOMOGENEOUS 2ND ORDER DIFFERENTIAL QUATIONS(cont.)
Finding the Particular Integral for non-homogeneous second order linear differential equations
This is best found by inspection (and should be relatively easily found). Then use substitution to
find any arbitrary constants.
(but note, if m = 0 is a root of the auxiliary function increase n by 1 and for double roots increase n
by 2).
(but note, if complementary function is of the form Asinx + Bcosx then use
y = Cx sinx + Dx cosx).
Hence, the general solution is y Ae4 x Be2 x 1 132 sin x 154 cos x .
85
NON-HOMOGENEOUS 2ND ORDER DIFFERENTIAL
Dr.N. Magaji ODE -2nd and high order EQUATIONS(cont.)
Tutorial 2
d2y dy
Q1Find the general solution of 2
8 16 y 6e4 x .
dx dx
d2y
Q2 Find the general solution of 2
16 y 4 x 2 .
dx
Q3 The acceleration, a ms-2, of a particle in a straight line is given by a = – 4x + 2 cos 2t, where
x is the displacement at time t seconds.
(b) Find an approximate value for the time when velocity is first equal to zero.
NON-HOMOGENEOUS 2ND ORDER
Dr.N. Magaji ODE -2nd and high order
DIFFERENTIAL EQUATIONS(cont.)
Method 2 variation of Parameters
Consider a nonhomogeneous equation:
y p( x ) y q( x ) y g( x )
(1)
y p( x ) y q( x ) y 0
(2)
Since we are looking for a particular solution of second order equation, there are two arbitrary
parameters or constraints. The first will be to satisfy (1), the second:
(u1 y1 u2 y2 ) 0
(4)
Then
yp u1 y1 u2 y2 u1 y1 u2 y2
Substitution into (1) yields
u1 y1 u2 y2 0
u1 y1 u2 y2 g
Solving this system gives:
y2 g y1 g
u1 u2
W ( y1 , y2 ) W ( y1 , y2 )
Combining it all, we get:
y1 ( t ) y2 ( x ) y1 ( x ) y2 ( t )
x
y p ( x) g( t )dt
y1 ( t ) y2 ( x ) y1 ( x ) y2 ( t )
Step 4
We now construct the determinants W1andW2 given by 0 y2 y 0
W1 ,W2 1
f ( x) y2 y1 f ( x)
Step 5
Next we determine the derivatives of the unknown variables u1andu2 through the relations
W1 W
u1 , u 2 2
Math for CS
W Lecture 9 W 24
Dr.N. Magaji ODE -2nd and high order
The Method of variation of Parameters(Cont.)
Step 6
Integrate the derivatives u1andu2 to find the unknown variables . So that
u1andu2
W W
u1 1 d x , u2 2 d x
W W
Step 7
Write a particular solution of the given non-homogeneous equation as
y p u1 y1 u 2 y 2
Step 8
The general solution of the differential equation is then given by
y yc y p c1 y1 c2 y2 u1 y1 u2 y2
Constants of Integration
We don’t need to introduce the constants of integration, when computing the indefinite
integrals in step 6 to find the unknown functions of u andu . For, if we do introduce these
y p (u1 a1 ) y1 (u2 b1 ) y2
1 2
constants, then
or
Math for CS
y c1 a1 y1 c2 b1 y2Lecture
u1 y91 u2 y2 25
Dr.N. Magaji ODE -2nd and high order If we replace c1 a1with C1 and c2 b1 with C2, we obtain
y C1 y1 C2 y2 u1 y1 u2 y2
This does not provide anything new and is similar to the general
solution found in step 8, namely y c y c y u y u y
1 1 2 2 1 1 2 2
Example 9 Solve y 4 y 4 y x 1 e2 x .
Solution:
Step 1
To find the complementary function
y 4 y 4 y 0
y e mx , y memx , y m 2 e mx
Put
m 2 4m 4 0
Then the auxiliary equation is
m 2 0, m 2, 2
2
Step 2
By the inspection of the complementary function , we make the
identification y e 2 x and y xe 2 x
1 2
Dr.N. Magaji ODE -2nd and high order
Therefore
W y1 , y2 e , xe
2x 2x
2e2xe2x
2x
xe 2 x
2 xe e 2x
e 4x
0, x
Step 3
The given differential equation is y 4 y 4 y x 1e2 x
Since this equation is already in the standard form
y Pxy Qxy f x
Therefore, we identify the function as f x x 1 e 2 x
Step 4
We now construct the determinants
0 xe2 x
W1 x 1 xe4 x
x 1 e2 x 2 xe2 x e2 x
e2 x 0
W2 x 1 e4 x
2e 2x
x 1 e 2x
Step 5 We determine the derivatives of the functionsu andu in
Dr.N. Magaji ODE -2nd and high order
1 2
We’ll leave it to you to verify that the complementary solution for this differential equation is
So, we have
dny d n 1 y
dy
an ( x ) n
a n 1 ( x )
n 1
....... a1 ( x )
a0 ( x ) y 0
dx dx dx
Find n linearlyindependent functions satisfy it, so
yc ( x ) c1 y1 ( x ) c2 y2 ( x ) ..... cn yn ( x )
For n functions to be linearlyindependent over an interval, there
must existconstants c1 , c2 , c3 ,........cn
c1 y1 ( x ) c2 y2 ( x ) c3 y3 ( x ) ...... cn yn ( x ) 0
and c1 c2 c3 ...... cn 0
Dr.N. Magaji ODE -2nd and high order
Higher-order ordinary differential equation(cont.)
An equal statementsare
c1 y1 ( x ) c2 y2 ( x ) ....... cn yn ( x ) 0
c1 y1' ( x ) c2 y2' ( x ) ....... cn yn' ( x ) 0
. . . . .
c1 y1( n1) ( x ) c2 y2( n1) ( x ) .... cn yn( n1) ( x ) 0
for c1 c2 c3 ....... cn 0, the n functions yi ( x ) are
linearlyindependent such that
y1 y2 ... yn
y1' y2' ... yn'
W ( y1 , y2 ,... yn ) 0
... ... ... ...
y1( n1) ... ... yn( n1)
W is called the Wronskian of the set of functions
* Note : W 0 does not guarantee that the functions are linearlydependent.
2. For particular integral y p ( x ) with f ( x ) 0
Genaral solution y(x) yc ( x ) y p ( x )
Dr.N. Magaji ODE -2nd and high order
Higher-order ordinary differential equation(cont.)
Example 11
y iv y 0
Solution
The characteristic equation is r 4 - r = (r 2 +1)(r+1) (r-1) = 0,
which has roots r = 1,-1,i,-i. Hence, the general solution is
y = C1e t +C2 te-t + C3cost+C 4sint.
Example 12
y5 - 3y4 + 3y3 - y'' = 0
The characteristic equation is rr 5 -3r 4 +3r 3 - r 2 = r 2 (r - 1)3 = 0
which has roots r = 0 (a double root), and 1 (a triple root). Hence, the
general solution is