You are on page 1of 37

LECTURE 7:Finite Differences and Difference Equation

Lawal G.S

University of Ibadan
gslawal@hotmail.com

May 6, 2021

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 1 / 37


Overview

1 Finite Differences

2 Difference Equation

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 2 / 37


Finite Differences

Finite Differences:
Suppose the function y = f (x) has the values y0 , y1 , y2 , ..., yn for the
equally spaced x = x0 , x0 + h, x0 + 2h, ..., x0 + nh. If y = f (x) be any
function then the value of the independent variable 0 x 0 is called argument
and the corresponding value of dependent variable 0 y 0 is called entry.
Forward Differences:
The differences y1 − y0 , y2 − y1 , ..., yn − yn−1 , are called the first forward
differences of the function y = f (x) and we denote these differences by
∆y0 , ∆y1 , ..., ∆yn , respectively,where ∆ is called the descending or forward
difference operator.
In general, the First forward difference is defined by

∆yn = yn+1 − yn

The differences of the first forward difference are called the second
forward differences and denoted by ∆2 y0 , ∆2 y1 , etc.
Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 3 / 37
Finite Differences

Continuation of Forward difference...


Therefore, we have

∆2 y0 = ∆[y1 − y0 ] = ∆y1 − ∆y0


= (y2 − y1 ) − (y1 − y0 )
= y2 − 2y1 + y0

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 4 / 37


Finite Differences

Backward Differences:
The differences y1 − y0 , y2 − y1 , ..., yn − yn−1 , are called the first
backward differences of the function y = f (x) and we denote these
differences by ∇y1 , ∇y2 , ..., ∇yn , respectively,where ∇ is called the
ascending or Backward difference operator.
In general, the First Backward difference is defined by

∇yn = yn − yn−1

The differences of the first forward difference are called the second
forward differences and denoted by ∇2 y2 , ∇2 y3 , etc.

∇2 y2 = ∇(y2 − y1 ) = ∇y2 − ∇y1


= (y2 − y1 ) − (y1 − y0 ) = y2 − 2y1 + y0

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 5 / 37


Finite Differences

Continuation of Backward difference...


We have
∇2 yn = ∇yn − ∇yn−1
Again the differences of the second backward differences are called the
Third backward differences and are denoted by ∇3 y3 , ∇3 y4 etc. In
general, the r th backward difference is given by

∇r yn = ∇r −1 yn − ∇r −1 yn−1

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 6 / 37


Finite Differences

Central Differences:
The differences y1 − y0 = δy 1 , y2 − y1 = δy 3 , ..., yn − yn−1 = δyn+ 1 , are
2 2 2
called the Central differences of the function y = f (x) and δ is called
central difference operator.
Similarly,
δy 3 − δy 1 = δ 2 y1
2 2

δy 5 − δy 3 = δ 2 y2
2 2

and
δ 2 y2 − δ 2 y1 = δ 3 y 3
2

and so on.

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 7 / 37


Finite Differences

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 8 / 37


Finite Differences

Shift Operator, E

Shift Operator, E
The Shift(Increment) operator is defined as ;

Eyn = yn+1
E 2 yn = yn+2
.. ..
.=.
E r yn = yn+r

The Inverse Shift operator, E −1 is defined as

E −1 yn = yn−1

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 9 / 37


Finite Differences

Relations between the operators


(i) From the definition of Finite differences,

∆yn = yn+1 − yn
= Eyn − yn
∆yn = (E − 1)yn
∆=E −1
E =∆+1

(ii) Also we have

∇yn = yn − yn−1 = yn − E −1 yn
∇yn = (1 − E n )yn
∇ = 1 − E −1
E −1 = 1 − ∇

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 10 / 37


Finite Differences

Relations between the operators...


(iii) We have

E ∇yn = Eyn − yn−1 = E (yn − Eyn−1 )


= yn+1 − yn
E ∇yn = ∆yn
E∇ = ∆

(iv) We have the following

∇E = ∆
E ∇ = ∇E = ∆
1 1

δ = (E 2 − E 2 )

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 11 / 37


Difference Equation

Difference Equation

Definition 3.1.1
An equation which contains independent variable, dependent variable and
successive differences of the dependent variable is called the difference
equation.

Examples 3.1.2
1 yn+2 − 6yn+1 + 9yn = 0
2 (E 2 + 6E + 9)yn = 2n i.e yn+2 + 6yn+1 + 9yn = 2n
3 (∆2 + 3∆ + 2)yn = 1 or ∆2 yn + 3∆yn + 2yn = 1
or (yn+2 − 2yn+1 + yn ) + 3(yn+1 − yn ) + 2yn = 1
or yn+2 + yn+1 = 1

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 12 / 37


Difference Equation

Order of a difference equation:


Definition 3.1.3
The order of the difference equation is the difference between the largest
and smallest arguments occurring in the difference equation divided by the
unit of argument.
Thus, the order of the difference equation is
largest argument - smallest argument
=
unit of argument

Example 3.1.4
The order of the difference equation yn+2 − 7yn = 5 is

(n + 2) − n
=2
1

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 13 / 37


Difference Equation

Definition 3.1.5

Degree of a difference equation


The highest degree of yn0 s in the difference equation is called the Degree
of the difference equation.

Example i:
n+2−n
The order and degree of yn+2 + 4yn+1 + 4yn = 2n are = 2 and 1
1
respectively.

Example ii:
2 n+3−n
The order and degree of yn+3 + 3yn+2 + 3yn+1 + yn = 0 are =3
1
and 2 respectively.

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 14 / 37


Difference Equation

Definition 3.1.6

Solution of Difference Equation


Any function which satisfies the given difference equation is called the
solution of the difference equation.

General solution of the difference equation


A solution in which the number of arbitrary constants is equal to the order
of the difference equation is called the general solution of the difference
equation.

Particular solution
A solution which can be obtained from the general solution by assigning
particular values is called particular solution.

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 15 / 37


Difference Equation

Formation of difference equation:


Example I: Write the difference equation ∆3 yn + ∆2 yn + ∆yn + yn = 0 in
the subscript notation.
Solution:
∆yn = yn+1 − yn

∆2 yn = yn+2 − 2yn+1 + yn

∆3 yn = yn+3 − 3yn+2 + 3yn+1 − yn


substituting these into the given difference equation, we obtain

(yn+3 − 3yn+2 + 3yn+1 − yn ) + (yn+2 − 2yn+1 + yn ) + (yn+1 − yn ) + yn = 0

yn+3 − 2yn+2 + 2yn+1 = 0


Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 16 / 37
Difference Equation

Example II: Form a difference equation from


yn = A2n + B(−2)n

Solution:
yn = A2n + B(−2)n =⇒ yn − A2n − B(−2)n = 0

yn+1 = A2n+1 + B(−2)n+1 =⇒ yn+1 − 2A2n + 2B(−2)n = 0

yn+2 = A2n+2 + B(−2)n+2 =⇒ yn+2 − 4A2n − 4B(−2)n = 0


Eliminating A and B, we obtain,

yn+2 − 4yn = 0

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 17 / 37


Difference Equation

Definitions :

Linear Difference Equation


A difference equation in which yn , yn+1 , yn+2 , ..., occur to the first degree
only and not multiplied together is called the Linear difference equation.
A linear difference equation of order k is an equation of the form

a0 yn+k + a1 yn+k−1 + a2 yn+k−2 + ... + ak yn = R(n) 1.1.6

If R(n) = 0, then the equation 1.1.6 is called linear homogeneous


difference equation, otherwise it is called non-homogeneous difference
equation.

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 18 / 37


Difference Equation

Homogeneous Linear Difference Equation with constant


coefficient
The equation of the form
(a0 E k + a1 E k−1 + a2 E k−2 + ... + an−1 E + an I )yn = 0
or
φ(E )yn = 0
where a0 , a1 , ..., an are all constants is known as homogeneous linear
difference equation with constant coefficient.
Let yn = mn be the solution of the difference equation, then we have
a0 mn+k + a1 mn+k−1 + ... + an mn = 0

=⇒ (a0 mk + a1 mk−1 + ... + an )mn = 0 3.1.7


which shows that mn is the solution of 3.1.7 if m satisfies
a0 mk + a1 mk−1 + ... + an = 0 3.1.8
Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 19 / 37
Difference Equation

Continuation...
Equation 3.1.8 is known as the auxiliary equation. This equation has
k-roots m1 , m2 , m3 , ..., mk .Some cases may arise;
Case I: When the roots are real and distinct
If m1 , m2 , m3 , ..., mk are real and distinct roots of auxiliary equation
(3.1.8), then the solution is

yn = c1 (m1 )n + c2 (m2 )n + ... + ck (mk )n

Case II: When some of the roots are equal


If two roots are equal, i.e m1 = m2 , then the solution is

yn = (c1 + c2 n)(m1 )n + c3 (m3 )n + ... + ck (mk )n

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 20 / 37


Difference Equation

Continuation...

If three roots are equal, i.e m1 = m2 = m3 , then the solution is

yn = (c1 + c2 n + c3 n2 )(m1 )n + c4 (m4 )n + ... + ck (mk )n

If k-roots are equal, i.e m1 = m2 = m3 = ... = mk , then the solution is

yn = [c1 + c2 n + c3 n2 + c4 n3 + ... + ck nk−1 ](m1 )n

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 21 / 37


Difference Equation

Continuation...

Case III: When the roots are complex number


If complex roots occur then they must be complex conjugate. i.e If
(α + iβ) is the root, then (α − iβ) is also a root where α and β are real.
Then the solution is

yn = c1 (α + iβ)n + c2 (α − iβ)n

which can be written as

yn = γ n (A1 cos nθ + A2 sin nθ)


 
β
p
where γ = α2 + β 2 , A1 = c1 + c2 , A2 = i(c1 − c2 and θ = arctan α .

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 22 / 37


Difference Equation

Example I:
Solve the difference equation yn+2 − 2yn+1 − 8yn = 0
Solution:
This equation can also be written as

(E 2 − 2E − 8)yn = 0

Let yn = mn , then

yn+2 − 2yn+1 − 8yn = mn+2 − 2mn+1 − 8mn = 0

m2 − 2m − 8 = 0 =⇒ (m − 4)(m + 2) = 0
m = 4 and m = 2. Hence

yn = c1 (4)n + c2 (−2)n

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 23 / 37


Difference Equation

Example II:

Solve the difference equation yn+3 + yn+2 − 8yn+1 − 12yn = 0


Solution:
The given difference equation can be written as

(E 3 + E 2 − 8E − 12)yn = 0

Let yn = mn , then the auxiliary equation becomes

m3 + m2 − 8m − 12 = 0

The roots are m = −2, −2, 3


Hence the solution is

yn = (c1 + c2 n)(−2)n + c3 3n

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 24 / 37


Difference Equation

Example III:
Solve the difference equation yn+2 + 16yn = 0
Solution:
The given difference equation can be written as

(E 2 + 16)yn = 0

Let yn = mn , then the auxiliary equation becomes

m2 + 16 = 0

The roots are m = ±4i


Hence the solution is

yn = (c1 (4i)n + c2 (−4i)n

yn = 4n {c1 (i)n + c2 (−i)n }


Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 25 / 37
Difference Equation

Continuation...

π n π n
     
n π π
= 4 c1 cos + i sin + c2 cos − i sin
2 2 2 2
    
nπ nπ nπ nπ
= 4n c1 cos + i sin + c2 cos − i sin
2 2 2 2
 
n nπ nπ
= 4 (c1 + c2 ) cos + i(c1 − c2 ) sin
2 2
 
n nπ nπ
= 4 A cos + B sin
2 2

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 26 / 37


Difference Equation

Non-homogeneous linear difference equation with constant


coefficient

The equation of the form

(a0 E k + a1 E k−1 + a2 E k−2 + ... + an−1 E + an I )yn = R(n) 3.1.9

or
φ(E )yn = R(n)
where a0 , a1 , ..., an are all constants is known as non-homogeneous linear
difference equation with constant coefficient.
The general solution of (3.1.9) consist of two parts, the complementary
function and the particular integral.
The complementary function is the general solution of the homogeneous
1
equation of (3.1.9) and the Particular Integral = R(n)
φ(E )

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 27 / 37


Difference Equation

Rules for obtaining the Particular Integral

Case I:R(n) = an
1 n 1 n
P.I = a = a
φ(E ) φ(a)
provided φ(a) 6= 0
If φ(a) = 0, then for the equation

(E − a)k yn = an ; k is a positive integer.

1 n(n − 1)(n − 2)...(n − (k − 1)) n−k n


P.I = k
an = a = Ck an−k
(E − a) k!
When k = 1
1
P.I = an = nan−1
E −a

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 28 / 37


Difference Equation

Continuation...
When k = 2,
1 n n(n − 1)an−2
P.I = a =
(E − a)2 2!

Case II: When R(n) = sin an or cos an


1 1 e ian − e −ian
P.I = sin an =
φ(E ) φ(E ) 2i
 
1 1 ia n 1 −ia n
= (e ) − (e )
2i φ(E ) φ(E )

 
1 1 1
= e ian − e −ian
2i ia
φ(e ) φ(e −ia )
provided φ(e ia ) 6= 0 and φ(e −ia ) 6= 0
Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 29 / 37
Difference Equation

Case III: When R(n) = nk


1 k 1
P.I = n = nk
φ(E ) φ(1 + ∆)
since E = 1 + ∆.
= [φ(1 + ∆)]−1 nk
Expansion of φ(1 + ∆)]−1 in the ascending powers of ∆ by the Binomial
theorem as far as the term in ∆k , and distributing it into each term of
the expansion.

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 30 / 37


Difference Equation

Example I:
Solve the difference equation yn+2 − 4yn+1 + 3yn = 5.4n
This equation can also be written as
(E 2 − 4E + 3)yn = 5.4n
Solving the homogeneous equation yn+2 − 4yn+1 + 3yn = 0 , we obtain a
complementary solution
yn = c1 + c2 (3)n
To determine the Particular integral P.I, we have
1 1 5.4n
P.I = 5.4n = 5. 2 4n =
φ(E ) 4 − 4(4) + 3 3

Hence the general solution is


5
yn = c1 + c2 (3)n + 4n
3

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 31 / 37


Difference Equation

Example II:

Solve the difference equation yn+2 − 3yn+1 + 2yn = 6.2n


This equation can also be written as

(E 2 − 3E + 2)yn = 6.2n

Solving the homogeneous equation yn+2 − 3yn+1 + 2yn = 0, we obtain a


complementary solution
c1 + c2 (2)n
To determine the particular integral, P.I, we have
1 1
P.I = 6.2n = 6. 2 2n
φ(E ) E − 3(E ) + 2

but φ(2) = 0, therefore we have

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 32 / 37


Difference Equation

Continuation...

1 1 1
= 6. .2n = 6. .2n = 6. .2n
(E − 1)(E − 2) (2 − 1)(E − 2) (E − 2)

= 6.n2n−1 = 3n2n
Hence the general solution is

yn = c1 + c2 (2)n + 3n2n

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 33 / 37


Difference Equation

Example III:
Solve the difference equation yn+2 − 6yn+1 + 8yn = 3n2 + 2
The given difference equation can be written as

(E 2 − 6E + 8)yn = 3n2 + 2

Ṫhe complementary solution is

yn = c1 2n + c2 4n

The particular solution is


1 1
P.I = (3n2 + 2) = (3n2 + 2)
E2 − 6E + 8 2
(1 + ∆) − 6(1 + ∆) + 8

1
= (3n2 + 2)
1 + 2∆ + ∆2 − 6 − 6∆ + 8
Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 34 / 37
Difference Equation

Continuation...

1 1 1
= (3n2 + 2) = 2
2 (3n + 2)
∆2 − 4∆ + 3 3 (1 − 4∆−∆
)
3
−1
4∆ − ∆2
 
1
= 1− (3n2 + 2)
3 3

4∆ − ∆2 (4∆ − ∆2 )2
 
1
= 1+ + + ... (3n2 + 2)
3 3 9
8 44
= n2 + n +
3 9
Hence the general solution is
8 44
y n = c 1 2n + c 2 4n + n 2 + n +
3 9

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 35 / 37


Difference Equation

Tutorial Questions

Solve the following difference equations


1 (E 2 − 2E − 8)yn = 0
2 2yn+2 − 5yn+1 + 2yn = 0
3 yn+2 − 4yn+1 + 3yn = 4n
4 yn+2 − 4yn = 5.3n
5 2yn+2 − 5yn+1 + 2yn = 0, y0 = 0, y1 = 1
6 yn+2 − 4yn+1 + 4yn = 2n
7 yn+2 − 4yn = n2 + n + 1

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 36 / 37


Difference Equation

THANK YOU FOR LISTENING

Lawal G.S (Department of Mathematics) MAT 241 May 6, 2021 37 / 37

You might also like