Mathwords logoMathwords

Difference Equation — Definition, Formula & Examples

A difference equation is an equation that expresses the value of a sequence at one index in terms of its values at earlier indices. It is the discrete counterpart of a differential equation, replacing continuous derivatives with differences between successive terms.

A difference equation (or recurrence relation) of order kk is an equation of the form F(n,an,an1,,ank)=0F(n,\, a_n,\, a_{n-1},\, \dots,\, a_{n-k}) = 0, where {an}\{a_n\} is an unknown sequence defined for integer nn and FF is a given function. The equation is solved by finding all sequences satisfying it, typically subject to kk initial conditions.

Key Formula

an+1can=da_{n+1} - c\,a_n = d
Where:
  • ana_n = The value of the sequence at index $n$
  • cc = A constant multiplier (coefficient)
  • dd = A constant forcing term (may be zero for the homogeneous case)
  • nn = A non-negative integer index

How It Works

You start with one or more initial values and then use the difference equation to compute each subsequent term from previous ones. For a first-order linear difference equation an+1=can+da_{n+1} = c\,a_n + d, you need one initial value a0a_0. For a second-order equation like the Fibonacci recurrence, you need two. Solving a difference equation analytically means finding a closed-form expression for ana_n, often by assuming a solution of the form an=rna_n = r^n and solving the resulting characteristic equation.

Worked Example

Problem: Solve the difference equation an+1=3an+4a_{n+1} = 3a_n + 4 with a0=1a_0 = 1. Find ana_n in closed form.
Find the fixed point: Set a=3a+4a^* = 3a^* + 4 to find the equilibrium value.
a=3a+4    2a=4    a=2a^* = 3a^* + 4 \implies -2a^* = 4 \implies a^* = -2
Substitute: Let bn=ana=an+2b_n = a_n - a^* = a_n + 2. Then bn+1=an+1+2=3an+4+2=3(an+2)=3bnb_{n+1} = a_{n+1} + 2 = 3a_n + 4 + 2 = 3(a_n + 2) = 3b_n. This is a simple geometric recurrence.
bn+1=3bn    bn=b03nb_{n+1} = 3\,b_n \implies b_n = b_0 \cdot 3^n
Back-substitute: Since b0=a0+2=3b_0 = a_0 + 2 = 3, we get:
an=bn2=33n2=3n+12a_n = b_n - 2 = 3 \cdot 3^n - 2 = 3^{n+1} - 2
Answer: an=3n+12a_n = 3^{n+1} - 2. Verify: a0=32=1a_0 = 3 - 2 = 1 and a1=92=7=3(1)+4a_1 = 9 - 2 = 7 = 3(1) + 4.

Why It Matters

Difference equations model any process that evolves in discrete steps: population growth by generation, compound interest by period, or digital signal processing sample by sample. They appear throughout discrete mathematics, economics, and computer science, and mastering them prepares you for the study of differential equations in continuous settings.

Common Mistakes

Mistake: Confusing the order of the equation with the number of initial conditions needed.
Correction: A kkth-order difference equation requires exactly kk initial conditions. For instance, an+2=an+1+ana_{n+2} = a_{n+1} + a_n is second-order and needs both a0a_0 and a1a_1.