The difference equation is a formula for computing an output sample at time n based on past and present input samples and past output samples in the time domain.
A general first-order difference equation takes the form
xt = f (t, xt−1) for all t.
We can solve such an equation by successive calculation: given x0 we have
x1 = f (1, x0)
x2 = f (2, x1) = f (2, f (1, x0))
and so on.
First-order linear difference equations with constant coefficient
A first-order difference equation with constant coefficient takes the form xt = axt−1 + bt where bt for t = 1, are constants.
In general, the starting point x0, the value of xt changes with t.
x* = b/(1 − a)
We call x* the equilibrium value of x. We can write the solution as xt = at(x0 − x*) + x*.
The qualitative behaviour of the solution path depends on the value of a.
|a| < 1
xt converges to x*: the solution is stable. There are two sub cases:
0 < a < 1
−1 < a < 0
|a| > 1
a > 1
a < −1
The solution of the equation xt = atxt−1 + bt. can be found, as before, by successive calculation. We obtain
xt = (Πs=1tas)x0 + ∑k=1t(Πs=k+1tas)bk
Where a product with no terms (e.g. from t+1 to t) is 1.
A general second-order difference equation takes the form xt+2 = f (t, xt, xt+1).
As for a first-order equation, a second-order equation has a unique solution: by successive calculation we can see that given x0 and x1 there exists a uniquely determined value of xt for all t ≥ 2.
Consider the equation
xt+2 − 5xt+1 + 6xt = 2t − 3.
The associated homogeneous equation is
xt+2 − 5xt+1 + 6xt = 0.
Two solutions of this equation are ut = 2t and vt = 3t. These are linearly independent:
To find a solution of the original equation we can takes the form u*t = at + b.
In order for u*t to be a solution we need
a(t+2) + b − 5[a(t+1) + b] + 6(at + b) = 2t−3.
Equating coefficients, we have a = 1 and b = 0.
Thus u*t = t is a solution.
We conclude that the general solution of the equation is xt = A2t + B3t + t.
A second-order linear equation with constant coefficients takes the form
xt+2 + axt+1 + bxt = ct.
The strategy for solving such an equation is very similar to the strategy for solving a second-order linear differential equations with constant coefficients. We first consider the associated homogeneous equation
xt+2 + axt+1 + bxt = 0.
The homogeneous equation:
We need to find two solutions of the homogeneous equation
xt+2 + axt+1 + bxt = 0.
We can guess that a solution takes the form ut = mt. In order for ut to be a solution, we need
mt(m2 + am + b) = 0
or, if m ≠ 0,
m2 + am + b = 0.
This is the characteristic equation of the difference equation. Its solutions are
−(1/2)a ± √((1/4)a2 − b).