9.2 Secondorder difference equations
 Definition

A secondorder difference equation is an equation
x_{t+2} = f(t, x_{t}, x_{t+1}),where f is a function of three variables. A solution of the secondorder difference equation x_{t+2} = f(t, x_{t}, x_{t+1}) is a function x of a single variable whose domain is the set of integers such that x_{t+2} = f(t, x_{t}, x_{t+1}) for every integer t, where x_{t} denotes the value of x at t.
 Proposition
 For every pair of numbers x_{0} and x_{1}, every secondorder difference equation x_{t+2} = f(t, x_{t}, x_{t+1}) has a unique solution in which the value of x is x_{0} at 0 and x_{1} at 1.
Secondorder linear difference equations with constant coefficients
 Definition

A linear secondorder difference equation with constant coefficients is a secondorder difference equation that may be written in the form
x_{t+2} + ax_{t+1} + bx_{t} = c_{t},where a, b, and c_{t} for each value of t, are numbers. The equation is homogeneous if c_{t} = 0 for all t.
Thus we have the following result.
 Proposition

Let x be a solution of the linear secondorder ordinary difference equation with constant coefficients
x_{t+2} + ax_{t+1} + bx_{t} = c_{t}.Then y is a solution of this equation if and only if y_{t} = x_{t} + z_{t} for all t, where z is a solution of the (homogeneous) equationx_{t+2} + ax_{t+1} + bx_{t} = 0.
 Procedure for finding general solution of linear secondorder difference equation with constant coefficients

The solutions of the difference equation
x_{t+2} + ax_{t+1} + bx_{t} = c_{t}may be found as follows.
 Find the solutions of the associated homogeneous equation x_{t+2} + ax_{t+1} + bx_{t} = 0.
 Find a single solution of the original equation x_{t+2} + ax_{t+1} + bx_{t} = c_{t}.
 Add together the solutions found in steps 1 and 2.
1. Find the solutions of a homogeneous equation
You might guess that the homogeneous equation Proposition

Consider the homogeneous linear secondorder difference equation with constant coefficients
x_{t+2} + ax_{t+1} + bx_{t} = 0.The set of solutions of this equation depends on the character of the roots of the characteristic equation m^{2} + am + b = 0 as follows.
 Distinct real roots
 If a^{2} > 4b, in which case the characteristic equation has distinct real roots, say m_{1} and m_{2}, every solution of the equation has the form
Amtfor numbers A and B.
1 + Bmt
2  Single real root
 If a^{2} = 4b, in which case the characteristic equation has a single root, every solution of the equation has the form
(A + Bt)m^{t}for numbers A and B, where m = −(1/2)a is the root.
 Complex roots
 If a^{2} < 4b, in which case the characteristic equation has complex roots, every solution of the equation has the form
Ar^{t} cos(θt + ω)for numbers A and ω, where r = √b and cos θ = −a/(2√b). This solution may alternatively be expressed asC_{1}r^{t} cos(θt) + C_{2}r^{t} sin(θt),where C_{1} = A cos ω and C_{2} = −A sin ω (using the formula cos(x+y) = (cos x)(cos y) − (sin x)(sin y).
 Source
 For a proof, see Goldberg (1958), pp. 134–142.
 Example

Consider the equation
x_{t+2} + x_{t+1} − 2x_{t} = 0.The roots of the characteristic equation are 1 and −2 (real and distinct). Thus every solution has the formx_{t} = A + B(−2)^{t}.
 Example

Consider the equation
x_{t+2} + 6x_{t+1} + 9x_{t} = 0.The single root of the characteristic equation is −3. Thus every solution has the formx_{t} = (A + Bt)(−3)^{t}.
 Example

Consider the equation
x_{t+2} − x_{t+1} + x_{t} = 0.The roots of the characteristic equation are complex. We have r = 1 and cos θ = 1/2, so θ = (1/3)π. So every solution has the formx_{t} = Acos((1/3)πt + ω).The frequency of the oscillations is (π/3)/2π = 1/6 and the growth factor is 1, so the oscillations are neither damped nor explosive.
2. Find a solution of a nonhomogeneous equation
For other forms of c_{t}, the method used to find a solution of a nonhomogeneous secondorder differential equation can be used. For example, if c_{t} is a linear combination of terms of the form q^{t}, t^{m}, cos(pt), and sin(pt), for constants q, p, and m, and products of such terms, then guess that the equation has a solution that is a linear combination of such terms; substitute such a function into the equation and see whether there are coefficients that generate a solution. If the c_{t} you find happens to satisfy the homogeneous equation, then a different approach must be taken, which I do not discuss.
 Example

Consider the equation
x_{t+2} − 5x_{t+1} + 6x_{t} = 2t − 3.To find a solution, guess that there is one of the form at + b. For this function to be a solution, we needa(t+2) + b − 5[a(t+1) + b] + 6(at + b) = 2t − 3.Equating the coefficients of t and the constant on each side, we have a = 1 and b = 0. Thus x_{t} = t for all t is a solution.
 Example

Consider the equation
x_{t+2} − 5x_{t+1} + 6x_{t} = 4^{t} + t^{2} + 3.To find a solution, tryx_{t} = C4^{t} + Dt^{2} + Et + F.Substituting this potential solution into the equation and equating the coefficients of 4^{t}, t^{2}, and the constant on each side we find thatC = 1/2, D = 1/2, E = 3/2, and F = 4.
Thus a solution of the equation is
x_{t} = (1/2)4^{t} + (1/2)t^{2} + (3/2)t + 4.
3. Add together the solutions found in steps 1 and 2
 Example

Consider the equation
x_{t+2} − 5x_{t+1} + 6x_{t} = 2t − 3.The associated homogeneous equation isx_{t+2} − 5x_{t+1} + 6x_{t} = 0.The characteristic equation has two real roots, 2 and 3, so by a previous result, every solution of the equation has the form A2^{t} + B3^{t}.
By a previous example, a solution of the original equation is x_{t} = t for all t.
We conclude that every solution of the equation has the form
x_{t} = A2^{t} + B3^{t} + t.
 Example

Consider the equation
x_{t+2} − 5x_{t+1} + 6x_{t} = 4^{t} + t^{2} + 3.As in the previous example, every solution of the associated homogeneous equation has the form A2^{t} + B3^{t}.
By a previous example, a solution of the original equation is
x_{t} = (1/2)4^{t} + (1/2)t^{2} + (3/2)t + 4.Thus every solution of the original equation has the form
x_{t} = A2^{t} + B3^{t} + (1/2)4^{t} + (1/2)t^{2} + (3/2)t + 4.
Equilibrium and stability
The notions of equilibrium and stability for a secondorder difference equation are analogous to the ones for a differential equation. Definition

An equilibrium of the linear secondorder difference equation with constant coefficients
x_{t+2} + ax_{t+1} + bx_{t} = cis a number x* such that x_{t} = x* for all t is a solution of the equation. An equilibrium x* is stable if every solution of the equation converges to x*.
Also, from a previous result we know that every solution of
 Characteristic equation has distinct real roots
 Every solution of the difference equation has the form
Amtfor numbers A and B. These solutions converge to zero if and only if m_{1} < 1 and m_{2} < 1.
1 + Bmt
2  Characteristic equation has single real root
 Every solution of the difference equation has the form
(A + Bt)m^{t}for numbers A and B, where m = −(1/2)a is the root. These solutions converge to zero if and only if m < 1. (The function tm^{t} converges to zero if and only if m < 1.)
 Characteristic equation has complex roots
 Every solution of the equation has the form
Ar^{t} cos(θt + ω)for numbers A and ω, where r = √b and cos θ = −a/(2√b). These solutions converge to zero if and only if r < 1.
If the characteristic equation has complex roots, then, using the formula for the roots of a quadratic equation, these roots are −a/2 ± i√(b − a^{2}/4). Thus the modulus of each root is √(a^{2}/4 + b − a^{2}/4) = √b. The modulus of a real number is simply its absolute value (the complex number α + βi is real if and only if β = 0), so the conditions we found for every solution of the homogeneous equation to converge to zero are, in every case, simply that the modulus of each root of the characteristic equation is less than 1.
We have the following result.
 Proposition
 For any value of c, an equilibrium of the linear secondorder difference equation with constant coefficients x_{t+2} + ax_{t+1} + bx_{t} = c is stable if and only if the modulus of each root of the characteristic equation m^{2} + am + b = 0 is less than 1, or, equivalently, if and only if a < 1 + b and b < 1.
 Proof

The arguments preceding the statement establish that a necessary and sufficient for the equilibrium to be stable is that the modulus of each root is less than 1.
I now show that this condition is equivalent to the conditions a < 1 + b and b < 1.
Note that the second condition is equivalent to the two conditions a < 1 + b, or b > a − 1, and −a < 1 + b, or b > −a − 1. In the following figure, b > a − 1 if b is above the blue line and b > −a − 1 if b is above the red line. Thus the set of values of (a, b) satisfying the conditions a < 1 + b and b < 1 is the shaded triangle. The characteristic equation has real roots if b lies below the black curve b = a^{2}/4 and complex roots if b lies above this curve. The figure is useful in following the logic of the subsequent slightly intricate algebra.
First consider the case in which the roots of the characteristic equation are real. Then the roots are −a/2 ± √(a^{2} − 4b)/2, so the modulus of each root is less than 1 if and only if
−1 < −a/2 + √(a^{2} − 4b)/2 < 1 −1 < −a/2 − √(a^{2} − 4b)/2 < 1 −2 + a < √(a^{2} − 4b) < 2 + a −2 + a < −√(a^{2} − 4b) < 2 + a. √(a^{2} − 4b) < 2 + a −2 + a < −√(a^{2} − 4b). a^{2} − 4b < (2 + a)^{2} = 4 + 4a + a^{2}or1 + a + b > 0.For the second inequality to hold, we need a < 2 (because the righthand side is negative) and, squaring both sides,(−2 + a)^{2} > a^{2} − 4b(both sides are negative, so the inequality changes), or4 − 4a + a^{2} > a^{2} − 4bor1 − a + b > 0.In summary, if the roots of the characteristic equation are real, which is true if and only if a^{2} > 4b, then the modulus of each root is less than 1 if and only if−2 < a < 2, 1 + a + b > 0, and 1 − a + b > 0.Now, if b < 1 then the last two inequalities imply −2 < a < 2. Further, −2 < a < 2 and a^{2} > 4b imply b < 1. Thus if the roots of the characteristic equation are real, then the modulus of each root is less than 1 if and only ifb < 1, 1 + a + b > 0, and 1 − a + b > 0.Now consider the case in which the roots of the characteristic equation are complex. Then a^{2} < 4b, so that b > 0, and, as noted previously, the modulus of each root is √b. Thus the modulus of each root is less than 1 if and only if b < 1. Now, a^{2} < 4b and b < 1 imply that a < 2, so that (a − 2)^{2} > 0. But (a − 2)^{2} = a^{2} − 4a + 4, so a^{2} > 4a − 4, or a^{2}/4 > a − 1. Given a^{2} < 4b, we have b > a − 1, or 1 − a + b > 0. The inequality a < 2 implies also that (a + 2)^{2} > 0, so that a^{2} + 4a + 4 > 0, or a^{2} > −4a − 4, or a^{2}/4 > −a − 1. Thus given a^{2} < 4b, we have b > −a − 1, or 1 + a + b > 0. Thus if the modulus of each root of the characteristic equation is less than 1, we haveb < 1, 1 + a + b > 0, and 1 − a + b > 0.In conclusion, whether the roots of the characteristic equation are real or complex, the modulus of each root is less than 1 if and only if
b < 1, 1 + a + b > 0, and 1 − a + b > 0.