11. Solving linear recurrences with constant coefficients#
In the previous note, we saw that many counting problems lead naturally to recurrence relations. For example, the number of tilings of a
We seek a closed formula: an explicit expression for
After studying these notes, you will be able to do the following.
Classify a recurrence by order, linearity, coefficient type, and homogeneity.
Form the characteristic polynomial of a linear homogeneous recurrence with constant coefficients.
Solve homogeneous recurrences whose characteristic roots are real, including repeated roots.
Explain why a root of multiplicity
contributes the terms . Find a particular solution for a driving term
, accounting for whether is a characteristic root. Combine a particular solution with the general homogeneous solution before applying initial conditions.
Express solutions arising from complex roots in terms of a radius, an argument, sines, and cosines.
11.1 Review: classifying recurrence relations#
A recurrence relation expresses the general term
The order is the difference between the highest and lowest indices that appear in the equation. For example, the recurrence
has order because the index difference is , even though the intermediate terms and do not appear. The recurrence is linear if it can be written in the form
where and . In words, every sequence term appears only to the first power, no sequence terms are multiplied together, and no sequence term appears inside nonlinear functions such as square roots or exponents. A linear recurrence has constant coefficients if the coefficients
are constants that do not depend on . If any coefficient depends on , the recurrence has variable coefficients. A linear recurrence is homogeneous if the driving term
is zero for all , so that every nonzero term involves the sequence. It is nonhomogeneous if for at least one .
The terms homogeneous and nonhomogeneous describe linear recurrences in this note. A nonlinear recurrence requires different techniques and is not assigned either label here.
Consider the following recurrences.
The recurrence
has order . It is linear, has constant coefficients, and is homogeneous. The characteristic-root method applies directly. The recurrence
also has order and constant coefficients, but it is nonhomogeneous. Its driving term is . We find one particular solution to account for this driving term, and then add the solutions of the corresponding homogeneous recurrence. The recurrence
is linear, homogeneous, and of order , but it has variable coefficients because the coefficient changes with the index. The constant-coefficient method in this note does not apply. The recurrence
has order and is nonlinear because two earlier sequence terms are multiplied together. It does not possess a characteristic polynomial. The recurrence
has order , not order : the coefficient of is zero, but the equation still reaches back to . It is linear, has constant coefficients, and is nonhomogeneous with constant driving term .
We consider finite-order linear recurrences with constant coefficients, beginning with the homogeneous case where every term involves the sequence and the driving term is zero.
11.2 Homogeneous recurrences with real characteristic roots#
We consider a linear homogeneous recurrence of order
A first-order recurrence
Substituting
The characteristic polynomial of the recurrence (11.1) is
Notice the signs in
11.2.1 Distinct real roots and the opening problem#
Suppose the characteristic polynomial
Because the recurrence is linear and homogeneous, the principle of superposition applies: any linear combination of solutions is also a solution. If
We must also confirm that (11.2) accounts for all solutions to the recurrence. An order-
Find a closed-form formula for the number of tilings
Solution:
Moving all terms to the left gives
This formula is known as Binet’s formula (shifted by one index because
Although
appears in both terms, every value is an integer. For instance, at , which matches . Because
, the second term decays exponentially to zero as increases. For large , is the nearest integer to , showing that the number of tilings grows exponentially at the golden ratio rate .
Solve
Solution:
Moving all terms to the left gives
We now fit the three initial values:
11.2.2 Repeated real roots and the shift operator#
When the characteristic polynomial has repeated roots, a single characteristic root does not provide enough independent solutions. Consider the recurrence
We multiply the geometric sequence by
The shift operator explains why polynomial factors appear systematically whenever a root is repeated.
For a sequence
Let
Consequently, each application of
Let the distinct real roots of the characteristic polynomial
In particular, a root
Solve
Solution:
Moving all terms to the left gives
Substituting the initial conditions produces the linear system:
The recurrence
11.2.3 Summary of the homogeneous solution procedure#
For a homogeneous linear recurrence with constant coefficients and specified initial values, the calculation follows four steps:
Form the characteristic polynomial. Move all sequence terms to one side, replace each term
by , and set . Find all roots and their multiplicities. Factor
completely and record the multiplicity of each root. Write the general solution with unknown coefficients. Each distinct real root
of multiplicity contributes a polynomial in of degree multiplied by . Fit the initial data. Substitute the
given initial values into the general solution and solve the resulting system of linear equations for the unknown constants.
Initial conditions must always be applied to the complete general solution in Step 4, never to an incomplete form before all roots and their multiplicities are accounted for.
11.3 Nonhomogeneous polynomial–exponential driving terms#
We now consider recurrences with an external driving term:
If
Because
Conversely, suppose
Theorem 2 establishes the solution procedure for nonhomogeneous recurrences:
Find one particular solution
satisfying the nonhomogeneous equation, ignoring the initial conditions. Write down the general solution
of the associated homogeneous recurrence with unknown constants. Form the complete sum
, and only then substitute the initial conditions to determine the constants.
Initial conditions must never be fitted to
11.3.1 Choosing the trial form: undetermined coefficients#
To find a particular solution for a driving term
Two cases arise based on whether
Nonresonance (
): If is not a characteristic root, the trial form is simply . Resonance (
): If is a characteristic root of multiplicity , the trial form must be multiplied by .
The factor
If the driving polynomial
11.3.2 Case 1: the exponential base is not a characteristic root#
When the base
Solve
Solution:
First, solve the homogeneous equation
Next, find a particular solution. The driving term is
The full solution is the sum of the particular and homogeneous solutions:
11.3.3 Case 2: the exponential base is a characteristic root#
When the base
Solve
Solution:
The characteristic polynomial is again
The driving term is
The full solution is
Solve
Solution:
The characteristic polynomial is
The driving term is
The general solution is
11.4 Complex characteristic roots#
A polynomial with real coefficients need not factor completely into real linear factors. For example, the equation
11.4.1 Complex numbers, radius, and argument#
A complex number is written in Cartesian form as
For
Taking powers in polar form is governed by De Moivre’s formula:
Compute
Solution:
The radius of
11.4.2 Conjugate roots produce real sine and cosine terms#
Because the coefficients of the characteristic polynomial
This expression reveals the geometric role of the polar coordinates:
The radius factor
controls the amplitude growth or decay: if , the terms grow exponentially; if , they decay to zero; if , the amplitude remains constant. The trigonometric factors
and cause the terms to oscillate in sign and value, with a period determined by the angle .
Let the characteristic polynomial of an order-
Each real root of multiplicity
Solve
Solution:
Moving all terms to the left gives
The two roots form a single simple conjugate pair, so the real general solution is
We check the first few terms against the recurrence:
From the recurrence:
From the formula:
The formula matches the recurrence values exactly. The sequence values
11.5 A complete solution checklist#
To solve any linear constant-coefficient recurrence with specified initial conditions, follow these steps in order:
Classify the recurrence. Confirm that the recurrence is linear with constant coefficients, and determine its order
. Form the characteristic polynomial. Move all homogeneous sequence terms to one side, replace each term
by , and write . Find all roots and multiplicities. Factor
completely. Identify real roots and their multiplicities, and express any nonreal roots as conjugate pairs in polar form . Write the general homogeneous solution.
Each real root
of multiplicity contributes . Each complex conjugate pair of multiplicity
contributes , where and are polynomials of degree .
Find a particular solution if nonhomogeneous. For a driving term
with , use the trial form , where and is the multiplicity of as a characteristic root ( if is not a root). Substitute into the recurrence and solve for the unknown coefficients of . Add the solutions. Form the full solution
. Fit the initial data. Substitute the
initial values into and solve the resulting linear system for the unknown constants in . Verify the solution. Test the resulting formula against the initial values and at least one subsequent term computed directly from the recurrence.