<s>[INST] Spivak's Calculus - Fibonacci Sequence In one of the questions in Spivak's Calculus he defines a Fibonacci sequence $a_1$, $a_2$, $a_3$ as:
$$a_1 = 1$$
$$a_2 = 1$$
$$a_n = a_{n-1} + a_{n-2}$$
for $n\ge3$
and proves $$a_n = \frac{(\frac{1+\sqrt5}{2})^n - (\frac{1-\sqrt5}{2})^n}{\sqrt{5}}$$
According to his proof:

But from his proof I don't quite understand how he got from the second line to the third and from the third to the fourth. What throws me off here is where he got the $(1+\frac{1+\sqrt5}{2})$ from and the sudden n, $(1+\frac{1-\sqrt5}{n})$ under the last fraction. For someone who understands what Spivak did, could you please explain this to me, thanks.
 [/INST] Going from the second line to the third line, he uses that
\begin{align*}
\left(\frac{1 + \sqrt{5}}{2}\right)^2 &= \frac{1 + 2 \sqrt 5 + 5}{4} \\
&= \frac{4 + (2 + 2 \sqrt 5)}{4} \\
&= 1 + \frac{1 + \sqrt 5}{2}
\end{align*}
Going from line three to four is just using the fact that
$$a^{n - 2} a^2 = a^{n - 2 + 2} = a^n$$
</s>