Recurrence Relations
Recurrence Relations
r2 − s1 r − s2 = 0.
We have three possibilities for the roots of this quadratic equation: two distinct real roots
a and b, a unique double root a or two complex conjugate roots a + ib and a − ib. The
solutions to the recurrence relation will depend on these roots of the quadratic equation.
Suppose first that the recurrence relation has two distinct real roots a and b, then the
solution of the recurrence relation will be an = c1 an + c2 bn . We use a1 = k1 and a2 = k2 to
solve the recurrence relation. Since these give us values to solve a system of equations in
two variables c1 and c2 :
k1 = c1 a + c2 b
k2 = c1 a2 + c2 b2 .
Example 1.2 Let a1 = 3 and a2 = 7 and an = 2an−1 +3an−2 for n ≥ 3. The corresponding
quadratic equation is r2 − 2r − 3 = 0 which has roots 3 and −1. So our solution should have
the form an = c1 3n + c2 (−1)n . We must now solve the system of equations
3 = 3c1 − c2
7 = 9c1 + c2 .
Adding the two equations together we obtain 10 = 12c1 or c1 = 65 . So c2 = 3( 56 ) − 3 = − 12 .
So our solution is
5 1
an = 3n − (−1)n
6 2
or
5 1
an = 3n−1 + (−1)n−1 .
2 2
If our recurrence relation has a unique double root a, then our solution will have the
form an = (c1 + c2 n)an this distinguishes us from the order one case since each quadratic
has two roots. Again we use the k1 and k2 to set up a system of equations in c1 and c2 to
find the solution of an .
Example 1.3 Let a1 = 2 and a2 = 5 and an = 6an−1 −9an−2 for n ≥ 3. The corresponding
quadratic equation is r2 − 6r + 9 = 0 which has a unique double root 3. So our solution
should have the form an = (c1 + nc2 )3n . We must now solve the system of equations
2 = 3c1 + 3c2
5 = 9c1 + 18c2 .
Subtracting 3 times the first equation from the second we obtain −1 = 9c2 or c2 = − 19 . So
c1 = 19 + 32 = 79 . So our solution is
7 1
an = 3n − n3n
9 9
or
an = 7(3n−2 ) + −n(3n−2 ).
If our recurrence relation has two complex conjugate roots, we could write our solution
the way we did in the case where we had two real roots: an = c1 (a + bi)n + c2 (a − bi)n .
However, there is a more compact √ way to write our solution in terms of real numbers. We
can write a + bi = re where r = a2 + b2 and θ = tan−1 ab . Then a − bi = re−iθ . Using
iθ
Example 2.2 Suppose an = 2an−1 − 2n for n ≥ 2 and a1 = 3. Since f (n) = −2n and
ahn = c2n , then we will guess that apn = bn2n . We now plug this into the recurrence relation
to solve for b. Since bn2n = 2b(n − 1)2n−1 − 2n we see that bn = b(n − 1) − 1 or b = −1.
Thus apn = −n2n . Now we can solve for the c. Since a1 = 3 = 2c − 2 we see that c = 25 and
an = 5(2n−1 ) − n2n .
Note if we did not choose our particular solution to be bn2n but b2n in the above
example, then we would get b2n = b2n − 2n or 0 = −2n and we cannot solve for b.
nπ nπ (n)π π nπ π nπ π nπ π nπ
a sin + b cos = a(sin cos( ) − cos (sin )) + b(cos cos + sin sin ) + sin
2 2 2 2 2 2 2 2 2 2 2
nπ nπ nπ
= −a cos + b sin + sin
2 2 2
.
Simplifying we get
nπ nπ nπ
(a − b) sin + (a + b) cos = sin
2 2 2
which implies that a−b = 1 and a+b = 0 so a = 12 and b = − 12 and apn = 12 sin nπ 1 nπ
2 − 2 cos 2 .
1 3
Now we solve for c using a1 = −1 and −1 = c + 2 implies that c = − 2 So
3 1 nπ 1 nπ
an = − + sin − cos .
2 2 2 2 2