Difference Equations

Leaving Cert Higher Level Applied Maths revision notes with diagrams, key terms and self-check questions.

12 min readHigher LevelBy Studytok
Practise this topic — free →

A difference equation is a rule that tells you how to get the next value in a sequence from the value or values before it — for example, 'next year's population is 1.02 times this year's, minus 150'. Because the rule only applies at whole-numbered steps, difference equations suit anything that is counted or updated at fixed intervals: yearly breeding seasons, monthly repayments, daily case numbers. In this topic you will learn to write such a rule from a description in words, to find a formula for u_n directly in terms of n, to work out terms numerically when no such formula exists, and to say what the answer means for the situation being modelled.

Discrete Change, Sequences, and Differences

Many things in biology, finance, and economics only change at set times — once a year, once a month, or once a day. We number the steps n=0,1,2,3,…n = 0, 1, 2, 3, \dots and write unu_n for the value at step nn, so u0u_0 is the starting value, u1u_1 is the value after one step, and so on.

Why a Difference Equation?

When an exam question asks why a difference equation is appropriate rather than a differential equation, state two facts:

  1. The quantity is recorded and updated at separate, fixed times (such as annually, monthly, or per generation), so the model produces one distinct value for each whole-numbered step.
  2. A differential equation would be used instead if the quantity changed continuously and smoothly at every instant, such as a cooling liquid or motion under a variable force.

Sequence Differences

The first difference measures the change between consecutive terms:

Δun=un+1−un\Delta u_n = u_{n+1} - u_n

Taking the difference of consecutive first differences gives the second difference:

Δ2un=Δun+1−Δun=(un+2−un+1)−(un+1−un)=un+2−2un+1+un\Delta^2 u_n = \Delta u_{n+1} - \Delta u_n = (u_{n+2} - u_{n+1}) - (u_{n+1} - u_n) = u_{n+2} - 2u_{n+1} + u_n

Looking at differences lets us identify the underlying formula of a data table:

  • Constant first differences (Δun=d\Delta u_n = d): linear sequence, un=u0+ndu_n = u_0 + nd.
  • Constant second differences (Δ2un=2a\Delta^2 u_n = 2a): quadratic sequence, un=an2+bn+cu_n = an^2 + bn + c.
  • Constant third differences: cubic sequence (an3+bn2+cn+dan^3 + bn^2 + cn + d).
  • Constant ratio (un+1/un=ru_{n+1}/u_n = r): geometric sequence, un=u0rnu_n = u_0 r^n.

For example, consider the sequence 2, 7, 18, 41, 82:

  • First differences: 7−2=57 - 2 = 5, 18−7=1118 - 7 = 11, 41−18=2341 - 18 = 23, 82−41=4182 - 41 = 41
  • Second differences: 11−5=611 - 5 = 6, 23−11=1223 - 11 = 12, 41−23=1841 - 23 = 18
  • Third differences: 12−6=612 - 6 = 6, 18−12=618 - 12 = 6

Because the third differences are constant (+6+6), the sequence is cubic. We can work forward: the next second difference is 18+6=2418 + 6 = 24, the next first difference is 41+24=6541 + 24 = 65, so the next term is u5=82+65=147u_5 = 82 + 65 = 147.

Classification and Model Setup

Before solving an equation, you must classify it. In exams, classification marks depend on giving clear reasons rather than just stating labels.

  • Order: The difference between the highest and lowest subscripts of the sequence variable. For example, un+1=1.04un−80u_{n+1} = 1.04u_n - 80 is first order (subscripts differ by 1), whereas un+2−4un+1+3un=0u_{n+2} - 4u_{n+1} + 3u_n = 0 is second order (subscripts differ by 2).
  • Linearity: An equation is linear if every sequence term (un,un+1,un+2u_n, u_{n+1}, u_{n+2}) appears only to the first power, terms are not multiplied together, and no sequence term is inside a function like a square root or sine. For example, un+2−3un+1+2un=n2u_{n+2} - 3u_{n+1} + 2u_n = n^2 is linear because n2n^2 depends only on the step number nn, not on uu. If an equation contains un2u_n^2 or unun+1u_n u_{n+1}, it is non-linear.
  • Homogeneity: Collect all terms containing the sequence variable on the left-hand side. If the right-hand side is zero, the equation is homogeneous because there is no term independent of uu. If an isolated constant, an exponential term, or a polynomial in nn remains on the right, the equation is inhomogeneous.

Setting Up Timelines and Incremental Models

Always define your timeline before writing an equation: 'Let PnP_n be the population at the start of year nn, with n=0n = 0 at the start of 2024, so P0=8000P_0 = 8000.'

Follow the chronological order of events described in the problem:

  • If interest is added first and then a payment RR is deducted: Bn+1=(1+i)Bn−RB_{n+1} = (1 + i)B_n - R.
  • If the payment is deducted at the start of the period before interest is applied: Bn+1=(1+i)(Bn−R)B_{n+1} = (1 + i)(B_n - R).

A common Leaving Certificate formulation involves successive changes: 'the increase on any day is twice the increase on the previous day'. Translate this directly using first differences:

un+2−un+1=2(un+1−un)u_{n+2} - u_{n+1} = 2(u_{n+1} - u_n)

Rearranging into standard form gives un+2−3un+1+2un=0u_{n+2} - 3u_{n+1} + 2u_n = 0, which is a second-order linear homogeneous equation.

First-Order Linear Difference Equations

The general first-order linear difference equation with constant coefficients is:

un+1=pun+qu_{n+1} = p u_n + q

where pp is the proportional growth or decay multiplier, qq is a constant added or subtracted at each step, and u0u_0 is the given initial value.

Homogeneous Form (q=0q = 0)

When q=0q = 0, un+1=punu_{n+1} = p u_n. This generates a geometric sequence with closed-form solution:

un=u0pnu_n = u_0 p^n

If p>1p > 1, the sequence grows without bound. If 0<p<10 < p < 1, it decays towards zero. If p<0p < 0, terms alternate in sign.

Inhomogeneous Form (q≠0,p≠1q \neq 0, p \neq 1)

When a constant amount is added or removed each step, the sequence may possess an equilibrium value (steady state), denoted u∗u^*. Setting un+1=un=u∗u_{n+1} = u_n = u^* gives:

u∗=pu∗+q  ⟹  u∗=q1−pu^* = p u^* + q \implies u^* = \frac{q}{1 - p}

Let vn=un−u∗v_n = u_n - u^*, which measures the distance between the sequence and its equilibrium. Then vn+1=pvnv_{n+1} = p v_n, meaning this gap changes by a factor of pp at every step. In terms of nn, vn=(u0−u∗)pnv_n = (u_0 - u^*)p^n. Adding u∗u^* back gives the general solution:

un=(u0−q1−p)pn+q1−pu_n = \left(u_0 - \frac{q}{1 - p}\right)p^n + \frac{q}{1 - p}

This formula is provided in the official Formulae and Tables booklet. You can quote and apply it directly in examinations.

Stability and Long-Term Behaviour

  • If ∣p∣<1|p| < 1, pn→0p^n \to 0 as n→∞n \to \infty. The sequence approaches u∗=q1−pu^* = \frac{q}{1 - p}, making the equilibrium stable. If 0<p<10 < p < 1, the values move smoothly towards u∗u^*. If −1<p<0-1 < p < 0, the sequence oscillates around u∗u^* with shrinking swings.
  • If ∣p∣>1|p| > 1, pnp^n grows in magnitude, so the sequence diverges away from u∗u^* (unless u0=u∗u_0 = u^* exactly). The equilibrium is unstable.
  • If p=1p = 1, the relation becomes un+1=un+qu_{n+1} = u_n + q, which is an arithmetic sequence solved by un=u0+nqu_n = u_0 + nq.

Second-Order Homogeneous Difference Equations

A second-order linear homogeneous difference equation with constant real coefficients has the form:

aun+2+bun+1+cun=0,a≠0a u_{n+2} + b u_{n+1} + c u_n = 0, \quad a \neq 0

Because each step depends on two previous values, finding a unique solution requires two initial conditions, typically u0u_0 and u1u_1.

Trying a trial geometric solution un=rnu_n = r^n leads directly to the characteristic equation:

ar2+br+c=0a r^2 + b r + c = 0

The structure of the general solution depends on the roots of this quadratic:

Nature of RootsCharacteristic RootsGeneral Solution Structure
Real and Distinctr1≠r2r_1 \neq r_2un=A(r1)n+B(r2)nu_n = A(r_1)^n + B(r_2)^n
Real and Equal (Repeated)r1=r2=rr_1 = r_2 = run=(A+Bn)rnu_n = (A + Bn)r^n

Every second-order difference equation examined in this course has a characteristic quadratic that factorises over the real numbers. If your quadratic produces a negative discriminant, stop and check your algebra; an error in signs during rearrangement is the usual cause.

When one root is r=1r = 1, the term A(1)nA(1)^n simplifies simply to the constant AA. To evaluate the arbitrary constants AA and BB, substitute n=0n = 0 and n=1n = 1 using your known values u0u_0 and u1u_1, and solve the two simultaneous linear equations.

Second-Order Inhomogeneous Difference Equations

When an external input or function of nn appears on the right-hand side, the equation is inhomogeneous:

aun+2+bun+1+cun=f(n)a u_{n+2} + b u_{n+1} + c u_n = f(n)

The complete general solution is made up of two parts:

un=un(c)+un(p)u_n = u_n^{(c)} + u_n^{(p)}

where un(c)u_n^{(c)} is the complementary solution (the solution to the homogeneous equation when the right side is replaced by 0), and un(p)u_n^{(p)} is a particular solution satisfying the full equation.

Trial Forms for the Particular Solution

Choose a trial form that matches the family of f(n)f(n):

Right-Hand Side f(n)f(n)Standard Trial un(p)u_n^{(p)}Modification if Trial Clashes with un(c)u_n^{(c)}
Constant kkCCCnC n (if r=1r = 1 is a single root); Cn2C n^2 (if r=1r = 1 is a repeated root)
Linear kn+mk n + mCn+DC n + D(Cn+D)n(C n + D)n (if r=1r = 1 is a characteristic root)
Exponential kλnk \lambda^nCλnC \lambda^nCnλnC n \lambda^n (if λ\lambda is a single root); Cn2λnC n^2 \lambda^n (if λ\lambda is repeated)

Substitute the trial into the inhomogeneous equation and equate coefficients to find the constants C,D,…C, D, \dots

Order of operations: combine the complementary and particular solutions into un=un(c)+un(p)u_n = u_n^{(c)} + u_n^{(p)} first, and only then substitute u0u_0 and u1u_1 to find AA and BB. If you evaluate AA and BB before adding un(p)u_n^{(p)}, your constants will be incorrect.

Note: This complementary-plus-particular method works for first-order equations too. For example, un+1−3un=8u_{n+1} - 3u_n = 8 has complementary solution A(3)nA(3)^n. Trialling un(p)=Cu_n^{(p)} = C gives C−3C=8  ⟹  C=−4C - 3C = 8 \implies C = -4, so un=A(3)n−4u_n = A(3)^n - 4, which matches the equilibrium method.

Numerical Iteration and Spreadsheet Solutions

You do not always need an explicit algebraic formula to solve a difference equation. If you know the starting value, you can generate terms step by step through numerical iteration.

Take the loan repayment recurrence Bn+1=1.01Bn−300B_{n+1} = 1.01 B_n - 300 with starting balance B0=10000B_0 = 10000:

nnBnB_n1.01Bn1.01 B_nBn+1=1.01Bn−300B_{n+1} = 1.01 B_n - 300
010,000.0010,100.009,800.00
19,800.009,898.009,598.00
29,598.009,693.989,393.98
39,393.989,487.929,187.92

After four payments, the balance is €9,187.92.

Essential Habits for Numerical Work

  • Keep full calculator precision throughout intermediate steps, rounding only the final requested answer.
  • After finding a closed-form formula, verify it against your table. Using Bn=30000−20000(1.01)nB_n = 30000 - 20000(1.01)^n for n=2n = 2 gives 30000−20000(1.0201)=959830000 - 20000(1.0201) = 9598, confirming the algebra in seconds.
  • When asked to use digital tools or a spreadsheet, place the step index nn in column A and the state variable in column B. Entering =1.01*B2 - 300 and filling down demonstrates the computational procedure.

Non-Linear Difference Equations and Epidemic Models

When interactions between variables depend on capacity limits or contact rates, the equations become non-linear. Characteristic equations cannot solve non-linear equations; we analyse them by determining equilibria algebraically and calculating terms numerically.

Discrete Restricted (Logistic) Growth

When a population experiences resource limitations, growth is constrained by an environmental carrying capacity KK:

Pn+1=Pn+rPn(1−PnK)P_{n+1} = P_n + r P_n\left(1 - \frac{P_n}{K}\right)

Expanding introduces a Pn2P_n^2 term, confirming non-linearity. Setting Pn+1=Pn=P∗P_{n+1} = P_n = P^* yields the equilibria:

P∗=P∗+rP∗(1−P∗K)  ⟹  rP∗(1−P∗K)=0P^* = P^* + r P^*\left(1 - \frac{P^*}{K}\right) \implies r P^*\left(1 - \frac{P^*}{K}\right) = 0

This gives two equilibrium states: extinction at P∗=0P^* = 0, and sustainable capacity at P∗=KP^* = K.

Discrete SIR Epidemic Model

A population of size NN is divided into Susceptible (SS), Infectious (II), and Recovered (RR) individuals across discrete time periods (such as days or weeks):

Sn+1=Sn−βSnInS_{n+1} = S_n - \beta S_n I_nIn+1=In+βSnIn−γInI_{n+1} = I_n + \beta S_n I_n - \gamma I_nRn+1=Rn+γInR_{n+1} = R_n + \gamma I_n

Here β\beta is the transmission parameter and γ\gamma is the recovery fraction per period. The product SnInS_n I_n reflects the rate of contact between susceptible and infectious individuals. The total population N=Sn+In+RnN = S_n + I_n + R_n stays constant at every step because anyone leaving one category enters another (Sn+1+In+1+Rn+1=Sn+In+RnS_{n+1} + I_{n+1} + R_{n+1} = S_n + I_n + R_n).

For example, with N=1000N = 1000, S0=990S_0 = 990, I0=10I_0 = 10, R0=0R_0 = 0, β=0.0005\beta = 0.0005, and γ=0.2\gamma = 0.2:

  • S1=990−0.0005(990)(10)=990−4.95=985.05S_1 = 990 - 0.0005(990)(10) = 990 - 4.95 = 985.05
  • I1=10+4.95−0.2(10)=12.95I_1 = 10 + 4.95 - 0.2(10) = 12.95
  • R1=0+0.2(10)=2.00R_1 = 0 + 0.2(10) = 2.00

Notice that 985.05+12.95+2.00=1000985.05 + 12.95 + 2.00 = 1000, confirming total population conservation.

Graphical Analysis, Cobweb Diagrams, and Model Evaluation

Two graphical methods are valuable for discrete models:

Three schematic point plots show monotonic convergence, alternating convergence and divergence relative to an equilibrium level.
Three schematic point plots show monotonic convergence, alternating convergence and divergence relative to an equilibrium level.

1. Plot of Terms Versus Time Index

Plot nn on the horizontal axis and unu_n on the vertical axis as individual points. Do not join them with a continuous line, as the system only exists at whole-number steps. A sequence flattening towards a horizontal line indicates convergence to a stable equilibrium; points alternating above and below a level line reveal oscillation; points curving outward show divergence.

2. Staircase and Cobweb Diagrams

For any first-order relation un+1=f(un)u_{n+1} = f(u_n), sketch the curve y=f(u)y = f(u) and the diagonal line y=uy = u on the same axes. The intersection where f(u)=uf(u) = u identifies the equilibrium u∗u^*.

To trace the sequence from an initial value u0u_0 on the horizontal axis:

  1. Move vertically to the curve y=f(u)y = f(u); the vertical height is u1u_1.
  2. Move horizontally to the diagonal line y=uy = u; this shifts the value u1u_1 onto the horizontal coordinate.
  3. Move vertically back to the curve to find u2u_2, and continue the process.
A vertical-then-horizontal cobweb path spirals inward between a decreasing recurrence line and the diagonal, approaching their equilibrium intersection.
A vertical-then-horizontal cobweb path spirals inward between a decreasing recurrence line and the diagonal, approaching their equilibrium intersection.

If the curve has a slope between −1-1 and +1+1 at the crossing point, the steps spiral or step inwards towards u∗u^* (a stable equilibrium). If the magnitude of the slope exceeds 1, the path moves away (an unstable equilibrium).

In agricultural economics, current supply depends on the previous season's price (Sn=c+dPn−1S_n = c + d P_{n-1}), while demand depends on current price (Dn=a−bPnD_n = a - b P_n). Equating Dn=SnD_n = S_n produces the cobweb model:

Pn=−dbPn−1+a−cbP_n = -\frac{d}{b} P_{n-1} + \frac{a - c}{b}

Because the slope −d/b-d/b is negative, the path forms a rectangular spiral around the equilibrium P∗=a−cb+dP^* = \frac{a - c}{b + d}. The market converges if d<bd < b (supply is less sensitive to price changes than demand).

Interpreting and Criticising Models

Exam questions routinely ask you to evaluate your model. Address these three areas:

  • Meaning: State what the numbers predict in context with units (e.g. 'predicts 8,110 animals after 10 years').
  • Assumptions: Identify assumptions made to create the model (such as a constant growth rate, unchanging repayment terms, or a closed population without migration).
  • Limitations: Note where the model breaks down. Linear models with p>1p > 1 predict infinite growth, which is impossible in a finite environment; a logistic model with a carrying capacity provides a more realistic long-term model.

Key terms

difference equation
An algebraic relation linking the terms of a sequence at discrete intervals, expressing future values in terms of one or more previous values.
order
The difference between the highest and lowest subscripts of the sequence variable appearing in a difference equation.
linear
A difference equation where all sequence terms appear to the first power, are not multiplied together, and do not sit inside non-linear functions.
non-linear
A difference equation containing products, powers, or non-linear functions of sequence terms, such as products or squared terms.
homogeneous
A difference equation where, after collecting all terms containing the sequence variable on one side, the opposite side is zero.
inhomogeneous
A difference equation that contains a non-zero forcing term (constant, polynomial in n, or exponential) independent of the sequence variable.
first difference
The change between consecutive terms of a sequence, given by Δu_n = u_(n+1) - u_n.
second difference
The difference between consecutive first differences, given by Δ²u_n = u_(n+2) - 2u_(n+1) + u_n.
characteristic equation
The quadratic equation a r^2 + b r + c = 0 formed from a second-order linear homogeneous difference equation, whose roots determine the complementary solution.
complementary solution
The general solution to the associated homogeneous equation obtained by setting any external forcing terms to zero.
particular solution
A specific sequence satisfying the complete inhomogeneous difference equation, matching the mathematical form of the forcing term.
equilibrium value
A constant steady-state value u such that if u_n = u, then u_(n+1) = u for all future steps; for u_(n+1) = p u_n + q, u = q / (1 - p).
stable
An equilibrium state that the sequence converges toward over time, which occurs in first-order linear models when the multiplier satisfies |p| < 1.
unstable
An equilibrium state that the sequence moves away from over time, occurring in first-order linear models when |p| > 1.
carrying capacity
The maximum sustainable population size K that an environment can support in a restricted growth model.
cobweb model
An economic recurrence model where supply responds to prior prices and demand responds to current prices, generating stepped or spiralling price paths around equilibrium.

Check yourself

  1. What is the characteristic equation and roots for u_(n+2) - 5u_(n+1) - 14u_n = 0?

    The characteristic equation is r^2 - 5r - 14 = 0, which factorises as (r - 7)(r + 2) = 0. The roots are r = 7 and r = -2.

  2. Find the equilibrium value of u_(n+1) = 0.75u_n + 25, and determine whether it is stable.

    Set u = 0.75u + 25, giving 0.25u = 25, so u = 100. Because |p| = 0.75 < 1, the equilibrium is stable and the sequence converges to 100 as n tends to infinity.

  3. A sequence begins 3, 8, 17, 30, 47. Calculate its first and second differences, and classify the sequence type.

    First differences: 5, 9, 13, 17. Second differences: 4, 4, 4. Because the second differences are constant (+4), the sequence is quadratic.

  4. State the trial form for the particular solution of u_(n+2) - 4u_(n+1) + 4u_n = 3(2)^n.

    The characteristic equation is (r - 2)^2 = 0, so r = 2 is a repeated root. Because 2^n and n(2)^n already appear in the complementary solution, the trial particular solution is u_n^(p) = C n^2 (2)^n.

  5. In the supply and demand cobweb model P_n = -0.4 P_(n-1) + 42, describe how price behaves over time.

    Because p = -0.4 is negative, prices oscillate around the equilibrium. Because |-0.4| < 1, the oscillations dampen and converge to P* = 42 / (1 - (-0.4)) = 42 / 1.4 = 30.

  6. Iterate x_(n+1) = 0.5 x_n (4 - x_n / 10) starting from x_0 = 10 for three steps, and describe what is happening.

    x_1 = 0.5(10)(4 - 1) = 15; x_2 = 0.5(15)(4 - 1.5) = 18.75; x_3 = 0.5(18.75)(4 - 1.875) = 19.92. The values are increasing with shrinking increments, converging towards the non-zero equilibrium x* = 20.

You've read the theory
Now turn it into exam marks.

Practise difference equations as questions and flashcards in Studytok, with explanations when you get stuck.

Continue for free →
  1. ✓
    Read the notes
    8 sections
  2. 2
    Test yourself
    Questions marked instantly
  3. 3
    Keep revising
    Flashcards and exam-style practice