Mathwords logoMathwords

Linear Difference Equation — Definition, Formula & Example

A linear difference equation is a recurrence in which each unknown term an,an+1,…a_n, a_{n+1}, \dots appears only to the first power. The unknown terms are never multiplied together or placed inside functions like sin⁡\sin or a square root.

A difference equation of order kk is linear if it can be written as ∑i=0kci(n) an+i=g(n)\sum_{i=0}^{k} c_i(n)\,a_{n+i} = g(n). Here the coefficients ci(n)c_i(n) and the forcing term g(n)g(n) depend only on nn, and ck(n)≠0c_k(n) \neq 0 and c0(n)≠0c_0(n) \neq 0. The equation is homogeneous when g(n)=0g(n) = 0 for all nn. The solutions of the homogeneous equation form a kk-dimensional vector space. Every solution of the full equation equals one particular solution plus a homogeneous solution.

Key Formula

ck(n) an+k+ck−1(n) an+k−1+⋯+c0(n) an=g(n),an=hn+pnc_k(n)\,a_{n+k} + c_{k-1}(n)\,a_{n+k-1} + \cdots + c_0(n)\,a_n = g(n), \qquad a_n = h_n + p_n
Where:
  • ana_n = The unknown sequence, indexed by the integer n
  • kk = The order: the largest gap between indices in the equation
  • ci(n)c_i(n) = Coefficients, which may depend on n but never on the terms ana_n
  • g(n)g(n) = The forcing (nonhomogeneous) term; g(n) = 0 gives a homogeneous equation
  • hnh_n = General solution of the homogeneous equation, with k arbitrary constants
  • pnp_n = Any one particular solution of the full equation

Worked Example

Problem: Solve the first-order linear difference equation an+1=2an−na_{n+1} = 2a_n - n with a0=3a_0 = 3. Find ana_n in closed form.
Step 1: Drop the forcing term −n-n to get the homogeneous equation an+1=2ana_{n+1} = 2a_n. Each term doubles the one before, so the homogeneous solution is a geometric sequence with one free constant.
hn+1=2hn  ⟹  hn=C⋅2nh_{n+1} = 2h_n \implies h_n = C\cdot 2^n
Step 2: The forcing term is linear in nn, so guess a particular solution pn=rn+sp_n = rn + s. Substitute it into the full equation and match coefficients. The nn terms give r=2r−1r = 2r - 1, so r=1r = 1. The constant terms give r+s=2sr + s = 2s, so s=1s = 1.
r(n+1)+s=2(rn+s)−n  ⟹  pn=n+1r(n+1) + s = 2(rn + s) - n \implies p_n = n + 1
Step 3: By linearity, the general solution is the homogeneous part plus the particular part. Apply the initial condition only after adding them.
an=C⋅2n+n+1,a0=C+0+1=3  ⟹  C=2a_n = C\cdot 2^n + n + 1, \qquad a_0 = C + 0 + 1 = 3 \implies C = 2
Answer: an=2n+1+n+1a_n = 2^{n+1} + n + 1. Check: the recurrence gives a1=2(3)−0=6a_1 = 2(3) - 0 = 6 and a2=2(6)−1=11a_2 = 2(6) - 1 = 11. The formula gives 4+1+1=64 + 1 + 1 = 6 and 8+2+1=118 + 2 + 1 = 11.

Why It Matters

Linear difference equations model anything updated in discrete steps, such as a loan balance with monthly payments or a population counted each year. In electrical engineering, every linear digital filter in audio and image processing is a linear difference equation. Discrete math courses use them to solve counting recurrences, and the superposition structure here parallels linear differential equations.

Common Mistakes

Mistake: Applying the initial condition to the homogeneous part alone. In the example, this means solving C⋅20=3C\cdot 2^0 = 3 and getting C=3C = 3.
Correction: The initial condition constrains the whole solution, not one piece of it. Add the particular solution first, then solve C+1=3C + 1 = 3 to get C=2C = 2. The wrong value gives a1=6+1+1=8a_1 = 6 + 1 + 1 = 8, but the recurrence gives a1=6a_1 = 6.

Related Terms