Example (Fibonacci sequence)

Solve $$ y_{n+2} - y_{n+1} - y_n = 0, \quad y_0=y_1=1. $$

Try $y_n=k^n$, then $$ k^2 - k - 1 = 0 $$ so the two roots are $$ \phi_1 = \frac{1+\sqrt 5}{2}, \quad \phi_2 = \frac{1-\sqrt 5}{2}. $$ So the general solution is $$ y_n = A\phi_1^n + B\phi_2^n. $$

Substituting in initial conditions, $$ 1 = y_0 = A+B \implies B=1-A. $$ $$\begin{align*} 1 = y_1 &= A\phi_1 + B\phi_2 \\ &= \frac12 \big(A(1 + \sqrt5) + (1-A)(1-\sqrt5)\big) \\ 2 &= A + \sqrt5 A + 1 - \sqrt5 - A + \sqrt5 A \\ A &= \frac{1+\sqrt5}{2\sqrt5} = \frac{\phi_1}{\sqrt5} \\ B &= \frac{2\sqrt5 - 1 - \sqrt5}{2\sqrt5} = -\frac{\phi_2}{\sqrt5} \end{align*}$$

Therefore $$ y_n = \frac{\phi_1^{n+1} - \phi_2^{n+1}}{\sqrt5}. $$