How to Solve Difference Equations: Video Tutorial
Solve linear difference equations using characteristic roots, initial conditions and particular solutions. Follow Fibonacci and repeated-root examples and verify each formula.

On this page
Difference equations, also known as recurrence relations, are similar to differential equations. The difference is that they are defined in discrete domains, such as discrete time or space. They describe a sequence in which each term depends on the terms before it.
This video tutorial presents the general form of linear difference equations and recurrence relations. It explains a solution approach based on eigenfunctions and eigenvalues. Several examples are worked out, including the Fibonacci series. The tutorial also covers the case of repeated (non-distinct) roots of the characteristic equation. Finally, it discusses non-homogeneous difference equations through the concepts of general and particular solutions.
Mostapha Kalami Heris teaches the 35 minute 59 second video. Follow the worked recurrences to see how initial conditions determine the constants in each solution.
A first example
The video starts with the simple equation . Its solution is , where the constant comes from the initial condition. With the sequence is , and with it is the same sequence shifted by two. As with differential equations, the equation gives the structure of the solution, and the initial values select one solution.
The characteristic equation method
Consider the second order linear equation
with given values of and . The key idea is that plays the same role for differences as plays for derivatives. If , then trying gives , so and the solution is . In this sense, is an eigenfunction of the shift (time delay) operation.
For the second order equation, the same trial solution gives the characteristic equation:
If its roots and are distinct, the general solution is a linear combination of the two eigenfunctions:
The constants and come from the initial conditions. The same method works for any order : the characteristic equation has degree , and its roots give the terms of the solution.
Worked example: the Fibonacci sequence
The Fibonacci sequence is defined by , and , which gives . The characteristic equation is , and its roots are
The initial conditions give two linear equations, and . Their solution is and , so
This closed form is known as Binet’s formula. The video checks it in MATLAB (from 10:40): it finds the roots of the characteristic polynomial with roots, defines the formula as a function of , and computes the first terms of the sequence.
The closed form also proves a well known fact. Since , the second term vanishes as grows, so the ratio tends to , the golden ratio .
Repeated roots
When the characteristic equation has a repeated root, the formula above does not give enough independent terms. The video uses the example (from 18:18). Its characteristic equation has the double root . As in differential equations, the second term is multiplied by :
With and , this gives and . For a root repeated three times, the terms are multiplied by , and , and so on.
Non-homogeneous equations
When the equation has a term that does not contain , such as , the solution has two parts (from 20:58):
The general solution solves the homogeneous equation, here . The particular solution is any one solution of the full equation. For the polynomial forcing in this example, the video tries and matches the coefficients of both sides. This gives , and , so . With , the full solution is
The video starts with a polynomial of higher degree than needed on purpose. A trial polynomial that is too low in degree can lead to inconsistent coefficient equations. If the trial overlaps a homogeneous solution, multiply it by a suitable power of before matching coefficients. Extra terms are harmless in this example, but a trial form must still account for repeated roots and overlap.
A final example with both cases
The last example (from 28:47) combines a repeated root with a non-homogeneous term:
The characteristic equation has the double root , so the general solution is . The trial gives the particular solution . With and , the constants are and , and the solution is
Where difference equations are used
Difference equations appear wherever a quantity is updated in discrete steps: digital signal processing and digital control, the analysis of recursive algorithms in computer science, discrete time models in economics and population models.
Who this tutorial is for
- Math students
- Computer science students
- Engineering students
- Anyone interested in mathematics
The tutorial needs only basic mathematics.
Check a closed form
Verify the initial conditions first, then substitute the expression into the recurrence. For the Fibonacci example, compute several small integer terms and compare them with direct iteration. Binet’s formula is exact symbolically, but powers and subtraction in floating point arithmetic can lose accuracy for large indices.
Watch online
The video tutorial is available to watch online on the Yarpiz YouTube channel.
How to cite
If you use this code or tutorial in your work, articles or publications, please cite it.
Mostapha Kalami Heris, How to Solve Difference Equations: Video Tutorial (YPTDEQ190520), Yarpiz, 2019. https://yarpiz.com/how-to-solve-difference-equations-yptdeq190520@misc{yarpiz-yptdeq190520,
author = {{Mostapha Kalami Heris}},
title = {{How to Solve Difference Equations: Video Tutorial}},
howpublished = {Yarpiz},
year = {2019},
note = {Code YPTDEQ190520},
url = {https://yarpiz.com/how-to-solve-difference-equations-yptdeq190520}
}Published Updated

Comments