Difference Equation
Difference Equation
April 3, 2025
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 1 / 62
Table of Contents
1 Introduction
4 Fibonacci sequence
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 2 / 62
Introduction
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 3 / 62
What is a difference equation?
Definition (Difference Equation)
A difference equation is a relation between various differences of an unknown func-
tion at one or more values of the argument which is always non-negative.
Example
For example,
∆yn+1 + 3yn = 2, ∆2 yn−1 + ∆yn+1 = 5
are all difference equations where
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 5 / 62
Example
The order of the difference equation (1) is
n+2−n
=2
1
and the order of the difference equation (2) is
(n + 2) − (n − 1)
= 3.
1
Similarly, the order of the difference equation ∆2 yn+1 + 3∆yn + 4yn = 2 is
n+3−n
= 3.
1
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 6 / 62
Formation of difference equation
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 7 / 62
Example
Form the difference equation for the sequence {yn } where yn = a3n + b5n , where a
and b are arbitrary constants.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 8 / 62
Example
Form the difference equation for the sequence {yn } where yn = a3n + b5n , where a
and b are arbitrary constants.
Solution
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 9 / 62
Example
Find the difference equations for the family of curves y (x) = Ax + B2x , where A
and B are unknowns.
Solution
yx = Ax + B2x (6)
x+1
=⇒ yx+1 = A(x + 1) + B2 (7)
x+2
=⇒ yx+2 = A(x + 2) + B2 (8)
yx+1 − 2yx 1
A= and B= [xyx+1 − (x + 1)yx ]
1−x 2x (x − 1)
Exercise 2:
Form the difference equation generated by the family of curves given by
yx = ax + b2x . Ans. (x − 1)yx+2 − (3x − 2)yx+1 + 2xyx = 0.
Exercise 3:
Form the difference equation corresponding to the family of curves y = ax + bx 2 .
Ans. x(x + 1)yx+2 − (2x 2 + 4x)yx+1 + (x 2 + 3x + 2)yx = 0.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 10 / 62
Definition(Linear difference equations with constant coefficients)
A linear difference equation is that in which yn , yn+1 , yn+2 , . . . etc. occur to the first
degree only and are not multiplied together.
If the coefficients yn , yn+1 , yn+2 , . . . etc. are constants then the linear difference
equation is called linear difference equation with constant coefficients. A linear
difference equation with constant coefficients has the following form
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 11 / 62
Definition(Linear difference equations with constant coefficients)
A linear difference equation is that in which yn , yn+1 , yn+2 , . . . etc. occur to the first
degree only and are not multiplied together.
If the coefficients yn , yn+1 , yn+2 , . . . etc. are constants then the linear difference
equation is called linear difference equation with constant coefficients. A linear
difference equation with constant coefficients has the following form
Shifting operator E
Let y = f (x) be given function of x. Let y0 , y1 , y2 , . . . , yn be the values of y at
x = x0 , x1 , x2 , . . . , xn . Then the shifting operator E is defined as
E r yn + a1 E r −1 yn + a2 E r −2 yn + · · · + an yn = f (n)
=⇒ [E r + a1 E r −1 + a2 E r −2 + · · · + an ]yn = f (n) (10)
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 12 / 62
Then (9) can be expressed in terms of shifting operator as following
E r yn + a1 E r −1 yn + a2 E r −2 yn + · · · + an yn = f (n)
=⇒ [E r + a1 E r −1 + a2 E r −2 + · · · + an ]yn = f (n) (10)
Now we shall deal with linear difference equations with constant coefficients
only. Their properties are analogous to those of linear differential equations
with constant coefficients.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 12 / 62
Complementary function and Particular integral
Un = c1 u1 (n) + · · · + cr ur (n)
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 13 / 62
Complementary function and Particular integral
Un = c1 u1 (n) + · · · + cr ur (n)
yn = C.F. + P.l.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 13 / 62
Rule to find the Complementary function
[E r + a1 E r −1 + a2 E r −2 + · · · + an ]yn = 0
The equation
mr + a1 mr −1 + a2 mr −2 + · · · + an = 0
is called Auxiliary Equation (A.E.) of difference equation (10). Since, it is
a polynomial of degree r hence it has r roots say λ1 , λ2 , · · · , λr .
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 14 / 62
Case-I If all the roots are real and distinct, then the General Solution of the difference
equation (11) is given by
yn = c1 λ1 n + c2 λ2 n + · · · + cr λr n
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 15 / 62
Case-I If all the roots are real and distinct, then the General Solution of the difference
equation (11) is given by
yn = c1 λ1 n + c2 λ2 n + · · · + cr λr n
Case-II If two roots are equal (i .e. λ1 = λ2 ), then the General Solution of the
difference equation (11) is given by
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 15 / 62
Case-I If all the roots are real and distinct, then the General Solution of the difference
equation (11) is given by
yn = c1 λ1 n + c2 λ2 n + · · · + cr λr n
Case-II If two roots are equal (i .e. λ1 = λ2 ), then the General Solution of the
difference equation (11) is given by
ase-III If one pair of roots be imaginary, i .e. λ1 = α + iβ, λ2 = α − iβ, then the
General Solution of the difference equation (11) is given by
yn = R n [c1 cos nθ + c2 sin nθ] + c3 λ3 n + · · · + cr λr n ,
β
p
where R = α2 + β 2 and θ = tan−1 α .
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 15 / 62
Example
Solve the difference equation yn+3 − 4yn+2 + yn+1 + 6yn = 0.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 16 / 62
Example
Solve the difference equation yn+3 − 4yn+2 + yn+1 + 6yn = 0.
Solution
The given difference equation can be written as
(E 3 − 4E 2 + E + 6)yn = 0.
Thus, the roots of the auxiliary equation are −1, 2, 3, which are real and distinct.
Hence the solution to given difference equation is
yn = c1 (−1)n + c2 2n + c3 3n .
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 16 / 62
Example
Solve the difference equation un+2 − 2un+1 + un = 0.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 17 / 62
Example
Solve the difference equation un+2 − 2un+1 + un = 0.
Solution
The given difference equation can be written in symbolic form as
(E 2 − 2E + 1)un = 0.
m2 − 2m + 1 = 0 =⇒ (m − 1)2 = 0
Thus, the roots of the auxiliary equation are 1, 1, which are real and equal. Hence,
the solution to given difference equation is
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 17 / 62
Example
Solve the difference equation yn+2 + 2yn+1 + 4yn = 0.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 18 / 62
Example
Solve the difference equation yn+2 + 2yn+1 + 4yn = 0.
Solution
The given difference equation can be written in symbolic form as
(E 2 + 2E + 4)un = 0.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 19 / 62
Fibonacci sequence
Fibonacci Number: In the year 1202, an Italian mathematician Leonardo of Pisa,
better known as Fibonacci, posed the following problem in his book Liber Abaci :
A male and a female rabbit are born at the beginning of the year. We assume the
following conditions:
1 After reaching the age of two months, each pair produces a mixed pair, (one
male, one female), and then another mixed pair each month thereafter.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 19 / 62
Fibonacci sequence
Fibonacci Number: In the year 1202, an Italian mathematician Leonardo of Pisa,
better known as Fibonacci, posed the following problem in his book Liber Abaci :
A male and a female rabbit are born at the beginning of the year. We assume the
following conditions:
1 After reaching the age of two months, each pair produces a mixed pair, (one
male, one female), and then another mixed pair each month thereafter.
2 No deaths occur during the year.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 19 / 62
Fibonacci sequence
Fibonacci Number: In the year 1202, an Italian mathematician Leonardo of Pisa,
better known as Fibonacci, posed the following problem in his book Liber Abaci :
A male and a female rabbit are born at the beginning of the year. We assume the
following conditions:
1 After reaching the age of two months, each pair produces a mixed pair, (one
male, one female), and then another mixed pair each month thereafter.
2 No deaths occur during the year.
How many rabbits will there be at the end of the year?
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 19 / 62
Fibonacci sequence
Fibonacci Number: In the year 1202, an Italian mathematician Leonardo of Pisa,
better known as Fibonacci, posed the following problem in his book Liber Abaci :
A male and a female rabbit are born at the beginning of the year. We assume the
following conditions:
1 After reaching the age of two months, each pair produces a mixed pair, (one
male, one female), and then another mixed pair each month thereafter.
2 No deaths occur during the year.
How many rabbits will there be at the end of the year?
Mathematically, Let yn denote the number of rabbit pairs at the beginning of
month n, then we have
y0 = 1, y1 = 1, y2 = 2, y3 = 3, y4 = 5, . . . (Look at the diagram) and, in general,
yn = yn−1 + yn−2
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 19 / 62
Fibonacci sequence
Fibonacci Number: In the year 1202, an Italian mathematician Leonardo of Pisa,
better known as Fibonacci, posed the following problem in his book Liber Abaci :
A male and a female rabbit are born at the beginning of the year. We assume the
following conditions:
1 After reaching the age of two months, each pair produces a mixed pair, (one
male, one female), and then another mixed pair each month thereafter.
2 No deaths occur during the year.
How many rabbits will there be at the end of the year?
Mathematically, Let yn denote the number of rabbit pairs at the beginning of
month n, then we have
y0 = 1, y1 = 1, y2 = 2, y3 = 3, y4 = 5, . . . (Look at the diagram) and, in general,
yn = yn−1 + yn−2
In particular, at the end of the first year (n=12), there will 144 rabbits.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 21 / 62
Example
Solve the Fibonacci difference equation yn = yn−1 + yn−2 , n > 2.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 22 / 62
Example
Solve the Fibonacci difference equation yn = yn−1 + yn−2 , n > 2.
Solution
The Fibonacci difference equation can be written as yn+2 − yn+1 − yn = 0, n > 0.
The given difference equation can be written in symbolic form as
(E 2 − E − 1)yn = 0.
c1 + c2 = 1 (12)
when n = 1, yn = 1. Therefore
√ ! √ !
1+ 5 1− 5
c1 + c2 =1 (13)
2 2
Therefore
√ !n+1 √ !n+1
1 1+ 5 1 1− 5
yn = √ −√
5 2 5 2
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 23 / 62
Exercise 4:
Solve the following difference equations
(a) yn+3 − 2yn+2 − 5yn+1 + 6yn = 0
(b) ∆2 yn + 2∆yn + yn = 0
(c) un+3 − 3un+1 + 2un = 0, where u1 = 0, u2 = 8, u3 = −2
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 24 / 62
Exercise 5:
Solve the following difference equation
(a) yk+2 − 7yk+1 + 6yk = 0 Ans: yk = c1 6k + c2 ,
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 25 / 62
Rules for finding the Particular Integral
There are many ways for finding Particular Integral. Some of these are :
1 Operator Method
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 26 / 62
Method of Undetermined Coefficients
(2) The method depends for its success on recognizing the general form of a
function that when substituted into the left-hand side of (14) yields the general
form of the non-homogeneous term Q(n) on the right-hand side.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 27 / 62
(3) Undetermined coefficients are involved because although the general form of a
particular integral yp can be guessed from the function Q(n), any multiplicative
constants (the undetermined coefficients) involved will not be known.
(4) Their values are found by substituting the possible form for yp into the left-
hand side of (14) and equating the undetermined coefficients of terms on the
left of the equation to the known coefficients of corresponding terms in Q(n)
on the right.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 28 / 62
Choice Rules for the Method of Undetermined Coefficients
(a) Basic Rule. If Q(n) in (14) is one of the functions in the first column in
Table 1, choose in the same line and determine its undetermined coefficients
by substituting into (14).
(c) Sum Rule. If Q(n) is a sum of functions in the first column of Table 1, choose
for the sum of the functions in the corresponding lines of the second column.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 29 / 62
If Q(n) has a term And if Then include this expres-
that is a constant sion in the trial function for
multiple of. . . yp
β is not a root of the auxiliary equation Aβ n
βn β is a single root of the auxiliary equation Anβ n
β is a double root of the auxiliary equa- An2 β n
tion
1 is not a root of the auxiliary equation An2 + Bn + C
2
pn +qn+r 1 is a single root of the auxiliary equation An3 + Bn2 + Cn
1 is a double root of the auxiliary equa- An4 + Bn3 + Cn2
tion
p(n)β n , here p(n) β is not a root of the auxiliary equation [a0 + a1 n + · · · + ar nr ]β n
is a polynomial of β is a single root of the auxiliary equation n[a0 + a1 n + · · · + ar nr ]β n
the degree r in n β is a double root of the auxiliary equa- n2 [a0 + a1 n + · · · + ar nr ]β n
and β is a constant tion
If cos βn and sin βn do not appear in the A cos βn + B sin βn
cos βn or sin βn complementary function
If cos βn or sin βn appear in the comple- An cos βn + Bn sin βn
mentary function
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 30 / 62
Example
Solve the difference equation yn+2 + 5yn+1 + 6yn = 3n2 .
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 31 / 62
Example
Solve the difference equation yn+2 + 5yn+1 + 6yn = 3n2 .
Solution
The given difference equation can be written in symbolic form as
(E 2 + 5E + 6)yn = 3n2
m2 + 5m + 6 = 0 =⇒ (m + 2)(m + 3) = 0
Thus, the roots of the auxiliary eqution are −2, −3, which are real and distinct.
Hence, the complementary function of given difference equation is
yh = c1 (−2)n + c2 (−3)n
Vn = An2 + Bn + C
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 31 / 62
Solution cont. . .
This gives
Vn+1 = A(n + 1)2 + B(n + 1) + C and Vn+2 = A(n + 2)2 + B(n + 2) + C
Since, Vn is a solution of the given differential equation. Therefore
Vn+2 + 5Vn+1 + 6Vn = 3n2
=⇒ A(n + 2)2 + B(n + 2) + C + 5[A(n + 1)2 + B(n + 1) + C ] + 6[An2 + Bn + C ] = 3n2
=⇒ 12An2 + (14A + 12B)n + (9A + 7B + 12C ) = 3n2
Comparing the respective coefficients, we get
3 1 7 5
A= = , 14A+12B = 0 =⇒ B = − , 9A+7B +12C = 0 =⇒ C = −
12 4 24 288
So the particular solution is
1 2 7 5
n − n− Vn =
4 24 288
Hence the general solution of the given difference equation
1 7 5
yn = c1 (−2)n + c2 (−3)n + n2 − n −
4 24 288
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 32 / 62
Example
Solve the difference equation yn+2 − 6yn+1 + 5yn = 2n with y0 = 0, y1 = 0.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 33 / 62
Example
Solve the difference equation yn+2 − 6yn+1 + 5yn = 2n with y0 = 0, y1 = 0.
Solution
The auxiliary equation of the given difference equation is
m2 − 6m + 5 = 0 =⇒ (m − 1)(m − 5) = 0
Thus, the roots of the auxiliary equations are 1, 5, which are real and distinct.
Hence, the complementary function is given by
yh = c1 (1)n + c2 5n = c1 + c2 5n
Let the particular integral of the given difference equation be
Vn = A2n
This gives
Vn+1 = A2n+1 and Vn+2 = A2n+2
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 33 / 62
Since Vn is a solution of the given difference equation. Therefore
Vn+2 − 6Vn+1 + 5Vn = 2n
=⇒ A2n+2 − 6A2n+1 + 5A2n = 2n
1
=⇒ − 3A2n = 2n =⇒ A = −
3
So, the particular integral is
1
Vn = − 2n
3
Hence, the general solution of the given difference equation is given by
1
yn = c1 + c2 5n − 2n
3
Since y0 = 0 and y1 = 0 therefore
1 2
c1 + c2 = c1 + 5c2 =
3 3
Solving c1 = 41 , c2 = 1
12 . Then
1 1 1
yn = + 5n − 2n
4 12 3
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 34 / 62
Example
Solve the recurrence relation yn+2 − 4yn+1 + 4yn = 2n .
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 35 / 62
Example
Solve the recurrence relation yn+2 − 4yn+1 + 4yn = 2n .
Solution
The auxiliary equation of the given recurrence relation is given by
m2 − 4m + 4 = 0 =⇒ (m − 2)2 = 0,
which has two real equal roots 2, 2. Therefore the complementary function is given
by
yh = (c1 + c2 n)2n
Since 2 is a double root of the auxiliary equation and hence let the particular integral
be
Vn = An2 2n
This gives
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 35 / 62
Solution cont. . .
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 36 / 62
Example
Find the particular integral of the following recurrence relation
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 37 / 62
Example
Find the particular integral of the following recurrence relation
Solution
Since 1 is a root of the auxiliary equation of the given difference equation, therefore
let the particular integral be
Vn = An2 + Bn,
which gives
−6A + 4B = 1 −A + B = 0
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 38 / 62
Example
Find the general solution of the following difference equation
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 39 / 62
Example
Find the general solution of the following difference equation
Solution
The complementary function of the given difference equation is given by
yn (H) = c1 + c2 2n ,
which do not contain sin 3n or cos 3n. Therefore, the particular solution to given
difference equation can be written
This gives
A = 0.337, B = 0.039,
Therefore
yn (P) = 0.337 sin(3n) + 0.039 cos(3n).
Thus, the general solution of the given difference equation is
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 41 / 62
Exercise 6:
Solve the following recurrence relation using method of undetermined coefficients
(a) yn+1 + yn = 3n2n .
(b) yn+2 − 4yn+1 + 4yn = (n + 1)2n .
(c) yn+2 − 5yn+1 + 6yn = n + 2n .
Exercise 7:
Solve the following difference equation using method of undetermined coefficients
(a) yk+2 − 5yk+1 + 6yk = 2 + 4k Ans: yk = c1 3k + c2 2k + 4 + 2k
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 42 / 62
Method of Z -Transforms
Z -transforms can also be used to find the solution of difference equations. The
following steps are required to solve a difference equation using method of Z -
transform:
Step 4. Take inverse Z -transform on both sides which results in the given sequence.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 43 / 62
Example
(a) Using the Z -transform, solve the difference equation yn+1 + 3yn = 0, y0 = 1.
(b) Solve the difference equation
given that y0 = 0, y1 = 1.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 44 / 62
Solution
(a) Taking Z -transform on both sides, we get
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 45 / 62
Solution cont. . .
(b) Taking Z -transform on both sides, we get
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 46 / 62
Solution cont. . .
Y (z) 1 5 3
= − +
z 24(z − 3) 12(z + 3) 8(z + 1)
1 1 5 1 3 1
=⇒ Y (z) = − +
24 z − 3 12 z + 3 8 z +1
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 47 / 62
Example
Using Z-transform, solve the difference equation yn+2 − 4yn+1 + 3yn = 5n with
y0 = y1 = 1.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 48 / 62
Solution
Taking Z -transform on both sides of given difference equation yields
Y (z) 9 1 1 1 1 1
= + −
z 8z −1 8z −5 4z −3
9 z 1 z 1 z
=⇒ Y (z) = + −
8 z −1 8 z −5 4 z −3
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 50 / 62
Example
Solve the following difference equation using Z -transform
yn+2 − 2yn+1 + yn = n, y0 = 1, y1 = 1
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 51 / 62
Example
Solve the following difference equation using Z -transform
yn+2 − 2yn+1 + yn = n, y0 = 1, y1 = 1
Solution
Taking Z -transform on both sides of the given difference equation, we get
1 z 3 + 4z 2 + z
2
1 z +z 1 z z
Y (z) = − + +
6 (z − 1)4 2 (z − 1)3 3 (z − 1)2 z −1
Now, taking inverse Z -transform, we get
1 3 1 2 n
yn = n − n + +1
6 2 3
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 52 / 62
Example
Solve the following difference equation using Z -transform method.
(a) yk+2 = 56 yk+1 − 16 yk + 3k , y0 = 0, y1 = 1
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 53 / 62
Solution
(a) Taking Z -transform of both sides of given difference equation, we get
5 1
Z (yk+2 ) = Z (yk+1 ) − Z (yk ) + Z (3k )
6 6
Denote Z (yk ) by Y (z), then
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 54 / 62
Decomposing the R.H.S. into partial fraction we get
Y (z) 3 1 15 1 18 1
= − +
z 20 z − 3 4 z − 1/3 5 z − 1/2
3 z 15 z 18 z
=⇒ Y (z) = − +
20 z − 3 4 z − 1/3 5 z − 1/2
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 55 / 62
Substituting these values
z
z 2 Y (z) + 6zY (z) + 9Y (z) =
z −2
Y (z) 1
=⇒ =
Z (z − 2)(z + 3)2
Y (z) 1 1 1 1 1 1
= − −
z 25 z − 2 25 z + 3 5 (z + 3)2
1 z 1 z 1 z
=⇒ Y (z) = − −
25 z − 2 25 z + 3 5 (z + 3)2
1 z 1 z 1 (−3z)
=⇒ Y (z) = − +
25 z − 2 25 z + 3 15 (z + 3)2
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 56 / 62
Exercise 8:
Solve the following difference equation using Z -transform.
(a) yn+1 − 5yn = 0 Ans: yn = y0 5n , where a0 is arbitrary
(b) yn+2 − 3yn+1 + 2yn = 0, y0 = −1, y1 = 2 Ans: yn = 3(2n ) − 4
(c) yk+2 + 5yk+1 4yk = 2k , y0 = ‘, y1 = −4
19
Ans: yk = 18 (−4)
k
− 19 (−1)k + 1 k
18 (2 )
1
(d) yk+2 − 6yk+1 + 9yk = 3k , y0 = 0, y1 = 1 Ans: yn = 18 (5n + n2 )3n
(e) yn+2 + 10yn+1 + 25yn = n, y0 = 1, y1 = −5
1
Ans: yn = 540 [(545 − 3n)(−5)n + 5(3n − 1)]
(−1)n 2n
(f) yn+2 + 4yn+1 + 3yn = 2n , y0 = 0, y1 = 1 Ans: yn = 3 + 15 − 25 (−3)n
(g) yn+2 − 4yn+1 + 4yn = 2n , y0 = 0, y1 = 1 Ans: yn = n2n−1 + n(n − 1)2n−3
n(n−1)(n+3)
(h) yn+2 − 2yn+1 + yn = 3n + 5, y0 = y1 = 0 Ans: yn = 2
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 57 / 62
Finance: Compound interest
Example
If Raju invests Rs 1000 at 6% interest compounded quarterly, how many month
must he wait for his money to double (Note that Raju can not withdraw the money
before the quarter is up). How many months it trebles.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 58 / 62
Finance: Compound interest
Example
If Raju invests Rs 1000 at 6% interest compounded quarterly, how many month
must he wait for his money to double (Note that Raju can not withdraw the money
before the quarter is up). How many months it trebles.
Solution
Annual interest rate is 6% so the quarterly rate is
6% 3 3
= %= = 0.015.
4 2 200
For 0 ≤ n ≤ 4, Pn denotes the value of Raju’s deposit at the end of n quarters.
Then Pn+1 = Pn + 0.015Pn where 0.015Pn is the interest earned on Pn during
(n + 1)th quarter. Here P0 = 1000. The solution of the difference equation
Pn+1 − 1.015Pn = 0 is
Pn = P0 (1.015)n = 1000(1.015)n .
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 58 / 62
Solution cont. . .
=⇒ n = 46.56 ≈ 47 quarters.
So money doubles in 47 × 3 = 141 months.
If money trebles then
ln 3
3000 = 1000(1.015)n =⇒ n = = 73.80 ≈ 74,
ln(1.015)
74 × 3 = 222.
Thus, money trebles in 222 months.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 59 / 62
Application to Deflection of a Loaded String
Consider a light string of length l stretched tightly between A and B . Let the forces
P1 be acting at its equispaced points xi (i = 1, 2, . . . , n−1) and perpendicular to AB
resulting in small transverse displacements yi ; at these points (Fig. 1). Assuming
the angle θi made by the portion between xi and xi+1 with the horizontal, to be
small, we have
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 60 / 62
Cont. . .
If T be the tension of the string at xi , then T cos θi = T , i.e., the tension may be
taken as uniform. Taking xi+1 − xi = h, we have
hPi
yi+1 − 2yi + yi−1 = − (18)
T
which is a difference equation and its solution gives the displacements yi . To
obtain the arbitrary constants in the solution, we take y0 = yn = 0 as the boundary
conditions, since the ends A and B of the string are fixed.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 61 / 62
Example
A light wing stretched between two fixed nails 120 cm apart, carries 11 loads of
weight 5 gm each at equal intervals and the resulting tension is 500 gm weight.
Show that the sag at the mid point is 1.8cm.
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 62 / 62
Example
A light wing stretched between two fixed nails 120 cm apart, carries 11 loads of
weight 5 gm each at equal intervals and the resulting tension is 500 gm weight.
Show that the sag at the mid point is 1.8cm.
Solution
Taking h = 10cm, Pi = 5gm and T = 500gm wt., the above equation (18) becomes
10 × 5 1
yi+1 − 2yi + yi−1 = − =−
500 10
The solution of above difference equation is given by
1
yi = c 1 + c 2 i + (i − i 2 )
20
11
∵ y0 = 0 =⇒ c1 = 0 and ∵ y12 = 0 =⇒ c2 =
20
Hence
11 1
yi = i + (i − i 2 )
20 20
Dr. Juhi Kesarwani & Dr. Ashish Kesarwany (VITB) Difference Equations April 3, 2025 62 / 62