Basic Tools of the Trade 37
to solve a system of two equations, we obtain c
1
=1/
√
5 and c
2
= −1/
√
5,
and thus
F
n
=
1
√
5
1+
√
5
2
n
−
1 −
√
5
2
n
. (2.4)
This formula for the Fibonacci sequence is somewhat surprising, as the pow-
ers of irrational numbers balance in just the correct way to give an integer
result for any value of n (seeExercise2.9). This formula was first derived
by Abraham De Moivre
5
, and independently by Daniel Bernoulli
6
.Forthe
derivation of the explicit formula for the Lucas sequence see Exercise 2.8. We
can find the explicit formula for F
n
by using the following Maple code:
rsolve({a(n)=a(n-1)+a(n-2),a(0)=0,a(1)=1},a(n));
Using the corresponding Mathematica code
RSolve[{a[n]==a[n - 1] + a[n - 2], a[0]==0, a[1]==1},a[n],n]
does not result in an explicit formula, but rather in the answer that a
n
is the
n-th Fibonacci number, a function that is defined in Mathematica:
{{a[n] -> Fibonacci[n]}}.
Now we are ready to indicate how to solve a linear nonhomogeneous recur-
rence relation with constant coefficients. Theorem 2.26 gives the form of the
general solution, which consists of two parts.
Theorem 2.26 The general solution of the nonhomogeneous linear recur-
rence relation with constant coefficients of order r as given in (2.2) is of the
form h(n)+p(n),whereh(n) is the general solution of the associated homo-
geneous recurrence relation (2.3),andp(n) is any solution of (2.2).
The solution p(n) in Theorem 2.26 is called the particular solution. To find
the general solution for a nonhomogeneous recurrence relation, we need to use
the following steps:
1. Find the general solution for the associated homogeneous recurrence
relation.
2. Guess a particular solution.
3. Use the initial conditions to determine the specific solution.
The difficult part is to find the particular solution, which often involves
guess and check. There is no approach that works for all types of functions
that may occur on the right-hand side of (2.2). However, for certain common
functions, the form of the particular function is known. If p(n)isaconstant
5
http://www-groups.dcs.st-and.ac.uk/∼history/Mathematician/De Moivre.html
6
http://www-groups.dcs.st-and.ac.uk/∼history/Mathematicians/Bernoulli Daniel.html
© 2010 by Taylor and Francis Group, LLC