To derive this expression, we can start with the Fibonacci rule.
F0=0,F1=1,Fn=Fn−1+Fn−2.
Because the recurrence has constant coefficients, we try an exponential form Fn=rn, since shifting n just multiplies by r. Now the recurrence turns into an algebra equation for r.
rn=rn−1+rn−2
Factor out and cancel rn−2, given rn−2=0:
rn−2(r2)=rn−2(r+1)r2=r+1r2−r−1=0.
Solving for the roots of r2−r−1=0 gives us 21±5, the golden ratio and its conjugate:
φ=21+5,ψ=21−5
At this point, we know we have two basic sequences that each obey Xn=Xn−1+Xn−2: namely Xn=φn and Xn=ψn. Because the rule is just adding previous terms, any weighted sum of two valid sequences is also valid.
So the most general sequence that follows the Fibonnaci rule has the form Xn=Aφn+Bψn. We can choose A,B so that X0=0 and X1=1 to model the Fibonacci sequence.
Given F0=0:
0=Aφ0+Bψ0=A+B⇒B=−A
Given F1=1:
1=Aφ+Bψ=Aφ−Aψ=A(φ−ψ)
Given φ−ψ=5:
A=51,B=−51
Substituting the values for A and B, we get the closed-form expression for the Fibonnaci sequence: