Study and Productivity

Solving Linear Recurrence Relations with the Characteristic Equation

A worked guide to linear recurrences: characteristic roots, repeated and complex roots, particular solutions and fitting initial terms.

Saizul Amin
Saizul Amin7 Nov 2026 · 4 min read
Solving Linear Recurrence Relations with the Characteristic Equation

A recurrence relation tells you how to get the next term of a sequence from the ones before it. That is enough to compute terms one by one, but it does not tell you the hundredth term without computing the ninety-nine before it. For linear recurrences with constant coefficients there is a systematic way to find a closed form, a direct formula for a(n). This guide explains the method step by step, the special cases that catch people out, and how to check your answer against the free Recurrence Relation Solver.

Step one: the characteristic equation

Start with a homogeneous recurrence, one with no extra term, such as a(n) = 5a(n−1) − 6a(n−2). Guess that the solution looks like rⁿ for some number r. Substituting gives rⁿ = 5rⁿ⁻¹ − 6rⁿ⁻², and dividing by rⁿ⁻² leaves r² = 5r − 6, or r² − 5r + 6 = 0. This is the characteristic equation. Its roots are 2 and 3, so both 2ⁿ and 3ⁿ satisfy the recurrence, and so does any combination C1·2ⁿ + C2·3ⁿ.

For a recurrence of order k, the characteristic equation has degree k and the general solution has k constants.

Step two: fit the initial terms

The constants come from the starting values. With a(0) = 1 and a(1) = 4 we need C1 + C2 = 1 and 2C1 + 3C2 = 4. Solving gives C1 = −1 and C2 = 2, so a(n) = 2·3ⁿ − 2ⁿ. A quick check: a(2) should be 5·4 − 6·1 = 14, and the formula gives 18 − 4 = 14.

The solver writes out this system with the numbers substituted, then checks the closed form against direct iteration for every row of its table.

Irrational roots: the Fibonacci numbers

For a(n) = a(n−1) + a(n−2) the characteristic equation r² − r − 1 = 0 has roots (1 + √5)/2 and (1 − √5)/2. Nothing changes in the method, but the constants are now irrational too. With a(0) = 0 and a(1) = 1 they come out as √5/5 and −√5/5, which gives Binet's formula. The solver keeps these values in surd form rather than decimals, so the formula reads the way it appears in textbooks.

Repeated roots

If the characteristic equation has a repeated root, the powers alone are not enough. For a(n) = 4a(n−1) − 4a(n−2) the equation r² − 4r + 4 = 0 has the double root 2. The second solution is n·2ⁿ, so the general solution is (C1 + C2n)·2ⁿ. A root repeated three times adds n²·rⁿ as well. With a(0) = 1 and a(1) = 6 the constants are 1 and 2, giving a(n) = 2ⁿ + 2n·2ⁿ.

Complex roots

Roots can also be complex. For a(n) = 2a(n−1) − 2a(n−2) the roots are 1 ± i. Written in polar form, they have modulus √2 and angle π/4. Instead of complex powers, the real solutions are (√2)ⁿ cos(nπ/4) and (√2)ⁿ sin(nπ/4). The sequence oscillates while its size grows like (√2)ⁿ, which the solver's chart shows clearly: with initial terms 1 and 2 it runs 1, 2, 2, 0, −4, −8, −8, 0.

Non-homogeneous recurrences

When the recurrence includes an extra term g(n), such as a(n) = 2a(n−1) + 1, the solution is the homogeneous solution plus one particular solution. For a constant g try a constant, for a polynomial try a polynomial of the same degree, and for sⁿ try a multiple of sⁿ. Substitute the trial form and match coefficients. For the Towers of Hanoi recurrence the constant trial gives −1, and with a(1) = 1 the closed form is 2ⁿ − 1.

There is one important exception. If s is already a root of the characteristic equation, the trial form solves the homogeneous part and gives 0, so it cannot match g. Multiply the trial form by n, or by n² if s is a double root. In a(n) = 5a(n−1) − 6a(n−2) + 2ⁿ the base 2 is a root, so the trial is B·n·2ⁿ and matching gives B = −2. The solver detects this resonance and states the power of n it used.

Typing recurrences into the solver

Write the relation as you would on paper, with an equals sign and terms like a(n-1), a_(n-2) or a[n-3]. Shifted forms such as a(n+2) = 3a(n+1) − 2a(n) are converted automatically. List as many initial terms as the order of the recurrence and choose whether the sequence starts at a(0) or a(1). The solver then shows the standard form, the characteristic equation, its roots, the homogeneous and particular solutions, the constants and the closed form, and lets you evaluate the formula at any n. If the table shows a mismatch, the most common cause is an initial term entered at the wrong index.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages