Linear homogenous recurrence relations. I'm having trouble solving linear homogenous recurrence relations. I've searched for guides and seen a few video's on how to solve them. I'm confused to how it's done, some suggest matrices, solving them like two linear equations etc...


*

*Given the difference equation $x_{n+2}-2x_{n+1}-2x_n=0$ with  $x_0 = 1$ and $x_1=2$
2.Show that the general solution is $x_n=C(1-\sqrt3)^n+D(1+\sqrt3)^n $ And that the initial values $x_0=1$ and $x_1=1-\sqrt3$ decides that the final solution is $x_n=(1-\sqrt3)^n$
I know that we can write $x_{n+2} -2x_{n+1}-2x_n =0 $ can be written as $r^2-2r-2=0$ and with completing the square we get $r_1r_2=1\pm\sqrt3$ thus, $x^h_n=C(1-\sqrt3)^n+D(1+\sqrt3)^n$ 
But how do I show that the initial values decides that the final solution is $(1-\sqrt3)^n$
ps:


*

*$x_0=C+D=1$

*$x_1=C-C\sqrt3+D+D\sqrt3$ =$1-\sqrt3$
 A: Just note that $C=1, D=0$ satisfies those two equations.
A: If $x_0=1,\;x_1=2$ then from the general solution $x_n=C(1-\sqrt3)^n+D(1+\sqrt3)^n$
put $n=0$ and get $C+D=1\to D=1-C$
put $n=1$ and get $C(1-\sqrt3)+D(1+\sqrt3)=2$
substitute and get $C(1-\sqrt3)+(1-C)(1+\sqrt3)=2$
$C-C\sqrt{3}+1+\sqrt{3}-C-C\sqrt{3}=2$
$-2C\sqrt{3}=-\sqrt{3}+1$
$C=\dfrac{\sqrt{3}-1}{2\sqrt 3}=\dfrac{3-\sqrt{3}}{6}$
$D=1-C=1-\dfrac{3-\sqrt{3}}{6}=\dfrac{3+\sqrt 3}{6}$
The solution is then
$x_n=\dfrac{3-\sqrt{3}}{6}(1-\sqrt3)^n+\dfrac{3+\sqrt 3}{6}(1+\sqrt3)^n$
$x_n=\dfrac{1}{6} \left[\left(\sqrt{3}+3\right) \left(1+\sqrt{3}\right)^n-\left(\sqrt{3}-3\right) \left(1-\sqrt{3}\right)^n\right]$
A: What you need is a general equation that parameterizes the results for any generalized Fibonacci-type sequence of the type $f_n=af_{n−1}+bf_{n−2}$ in terms of the initial conditions.
We have developed just such a solution that is applicable to any values of $a$ and $b$ as well as any initial conditions.
Using the methods described here, it is relatively straightforward to show that
$$
\begin{align}f_n
&=\left(f_1-\frac{af_0}{2}\right) \frac{\alpha^n-\beta^n}{\alpha-\beta}+\frac{af_0}{2} \frac{\alpha^n+\beta^n}{\alpha+\beta}\\
&= \left(f_1-\frac{af_0}{2}\right)F_n+\frac{af_0}{2}L_n\\
&=\frac{\left( {{f}_{1}}-{{f}_{0}}\beta  \right)\,{{\alpha }^{n}}-\left( {{f}_{1}}-{{f}_{0}}\alpha\right)\,{{\beta }^{n}}}{\alpha -\beta}\\
\end{align}$$
where 
$$
\alpha,\beta=(a\pm\sqrt{a^2+4b})/2\\
F_n=\frac{\alpha^n-\beta^n}{\alpha-\beta}\\
L_n=\frac{\alpha^n+\beta^n}{\alpha+\beta}
$$
Specializing to the present case, we find that
$$
\alpha,\beta=1\pm\sqrt{3}\\
x_n=\frac{(1+\sqrt{3})^{n+1}-(1-\sqrt{3})^{n+1}}{2\sqrt{3}}
$$
This result differs from that of @Raffaele, but I have verified it numerically.
