5Second-order differential equations
IA Differential Equations
5.4 Difference equations
Consider an equation of the form
ay
n+2
+ by
n+1
+ cy
n
= f
n
.
We can solve in a similar way to differential equations, by exploiting linearity
and eigenfunctions.
We can think of the difference operator
D
[
y
n
] =
y
n+1
. This has an eigen-
function y
n
= k
n
. We have D[y
n
] = D[k
n
] = k
n+1
= k · k
n
= ky
n
.
To solve the difference equation, we first look for complementary functions
satisfying
ay
n+2
+ by
n+1
+ cy
n
= 0
We try y
n
= k
n
to obtain
ak
n+2
+ bk
n+1
+ ck
n
= 0
ak
2
+ bk + c = 0
from which we can determine
k
. So the general complementary function is
y
c
n
= Ak
n
1
+ Bk
n
2
if k
1
6= k
2
. If they are equal, then y
c
n
= (A + Bn)k
n
.
To find the particular integral, we guess.
f
n
y
p
n
k
n
Ak
n
if k 6= k
1
, k
2
k
n
1
nk
n
1
n
p
An
p
+ Bn
p−1
+ ··· + Cn + D
Example (Fibonacci sequence). The Fibonacci sequence is defined by
y
n
= y
n−1
+ y
n−2
with y
0
= y
1
= 1.
We can write this as
y
n+2
− y
n+1
− y
n
= 0
We try y
n
= k
n
. Then k
2
− k − 1 = 0. Then
k
2
− k − 1 = 0
k =
1 ±
√
5
2
We write k = ϕ
1
, ϕ
2
. Then y
n
= Aϕ
n
1
+ Bϕ
n
2
. Our initial conditions give
A + B = 1
Aϕ
1
+ Bϕ
2
= 1
We get A =
ϕ
1
√
5
and B =
−ϕ
2
√
5
. So
y
n
=
ϕ
n+1
1
− ϕ
n+1
2
√
5
=
ϕ
n+1
1
−
−1
ϕ
1
n+1
√
5