Skip to content

Second-Order Linear Difference Equation


Definition

A second-order linear difference equation with constant coefficients is

xt+2+a1xt+1+a0xt=gt,x_{t+2}+a_1x_{t+1}+a_0x_t=g_t,

for t=0,1,2,…t=0,1,2,\ldots, with real constants a1a_1 and a0≠0a_0\ne0 and a given sequence (gt)(g_t). Its homogeneous version has gt=0g_t=0. Write r1,r2r_1,r_2 for the roots of the characteristic polynomial p(r)=r2+a1r+a0p(r)=r^2+a_1r+a_0. The general solution of the homogeneous equation is, with arbitrary constants c1,c2c_1,c_2:

  • distinct real roots r1≠r2r_1\ne r_2: xt=c1r1t+c2r2tx_t=c_1r_1^t+c_2r_2^t;
  • a repeated root r1=r2=rr_1=r_2=r: xt=(c1+c2t) rtx_t=(c_1+c_2t)\,r^t;
  • nonreal roots ρe±iθ\rho \mathrm{e}^{\pm\mathrm{i}\theta} with ρ>0\rho>0, 0<θ<π0<\theta<\pi: xt=ρt(c1cos⁡(θt)+c2sin⁡(θt))x_t=\rho^t\big(c_1\cos(\theta t)+c_2\sin(\theta t)\big).

Interpretation

The next value depends on the two most recent values, so two initial values x0,x1x_0,x_1 are needed to fix a solution; they determine c1,c2c_1,c_2. Unlike the first-order case, where the only oscillation is the sign alternation caused by a<0a<0, the solutions can oscillate with any frequency, because the roots may be nonreal complex numbers. The real form in the third case comes from combining the conjugate solutions (ρeiθ)t(\rho \mathrm{e}^{\mathrm{i}\theta})^t and (ρe−iθ)t(\rho \mathrm{e}^{-\mathrm{i}\theta})^t; ρ\rho sets growth or decay and θ\theta the frequency.

Two stem plots show solutions: on the left 1, 4, 14, 46 for x_t = 2·3^t − 2^t, and on the right the period-4 sequence 1, 0, −1, 0 on the dashed curve cos(πt/2).

In both panels the two orange values x0,x1x_0,x_1 are given, and every later value follows from the recursion. On the left, the distinct roots 22 and 33 of the first example below give xt=2⋅3t−2tx_t=2\cdot3^t-2^t, which grows like 3t3^t. On the right, the nonreal roots ±i\pm\mathrm{i} (ρ=1\rho=1, θ=π/2\theta=\pi/2) with x0=1x_0=1, x1=0x_1=0 give c1=1c_1=1, c2=0c_2=0, so xt=cos⁡(πt/2)x_t=\cos(\pi t/2): an oscillation with frequency set by θ\theta and constant amplitude ρt=1\rho^t=1.

The repeated-root case is a standard trap: c1rt+c2rtc_1r^t+c_2r^t is only a one-parameter family, so a second solution t rtt\,r^t is needed.

For a constant input gt=bg_t=b with p(1)=1+a1+a0≠0p(1)=1+a_1+a_0\ne0, the constant x∗=b/p(1)x^*=b/p(1) is a particular solution, and the general solution is x∗x^* plus the homogeneous solution.


Key Results

  • Every choice of x0,x1x_0,x_1 gives exactly one solution; the homogeneous solutions form a two-dimensional space with the basis of solutions listed above.
  • General solution of the inhomogeneous equation = one particular solution + general homogeneous solution.
  • Root relations: r1+r2=−a1r_1+r_2=-a_1 and r1r2=a0r_1r_2=a_0; the roots are nonreal if and only if a12<4a0a_1^2<4a_0.
  • If 11 is a simple root of pp (so p(1)=0p(1)=0, 2+a1≠02+a_1\ne0) and gt=b≠0g_t=b\ne0, there is no equilibrium; xt=Ctx_t=Ct with C=b/(2+a1)C=b/(2+a_1) is a particular solution. If instead b=0b=0, every constant sequence is an equilibrium.
  • All solutions tend to x∗x^* if and only if ∣r1∣<1\lvert r_1\rvert<1 and ∣r2∣<1\lvert r_2\rvert<1, equivalently ∣a0∣<1\lvert a_0\rvert<1 and ∣a1∣<1+a0\lvert a_1\rvert<1+a_0 (see stability).

Examples

Distinct roots. xt+2−5xt+1+6xt=0x_{t+2}-5x_{t+1}+6x_t=0, x0=1x_0=1, x1=4x_1=4. Then p(r)=(r−2)(r−3)p(r)=(r-2)(r-3), so xt=c12t+c23tx_t=c_12^t+c_23^t with c1+c2=1c_1+c_2=1, 2c1+3c2=42c_1+3c_2=4, giving c2=2c_2=2, c1=−1c_1=-1: xt=2⋅3t−2tx_t=2\cdot3^t-2^t. Check: x2=18−4=14=5⋅4−6⋅1x_2=18-4=14=5\cdot4-6\cdot1.

Constant input. xt+2−5xt+1+6xt=4x_{t+2}-5x_{t+1}+6x_t=4: p(1)=2p(1)=2, so x∗=2x^*=2 and xt=2+c12t+c23tx_t=2+c_12^t+c_23^t.

Complex roots. xt+2+xt=0x_{t+2}+x_t=0 has p(r)=r2+1p(r)=r^2+1 with roots ±i=e±iπ/2\pm\mathrm{i}=\mathrm{e}^{\pm\mathrm{i}\pi/2}, so ρ=1\rho=1, θ=π/2\theta=\pi/2 and xt=c1cos⁡(πt/2)+c2sin⁡(πt/2)x_t=c_1\cos(\pi t/2)+c_2\sin(\pi t/2). With x0=1x_0=1, x1=0x_1=0: 1,0,−1,0,1,…1,0,-1,0,1,\ldots, period 44, neither growing nor decaying.


Prerequisites



Sources

Aliases: Second Order Linear Difference Equation, second-order linear recurrence, linear second-order difference equation, linear difference equation of order two Keywords: x_{t+2} + a_1 x_{t+1} + a_0 x_t = g_t, two initial values, distinct, repeated and complex roots, r^t and t r^t, rho^t cos(theta t) Symbols: pi, rho, theta

Last updated: 27 October 2026 11:52