General solution of recurrence relation if two equal roots Consider the recurrence relation
$$
ax_{n+1}+bx_n+cx_{n-1}=0
$$
If the characteristic equation
$$
a\lambda^2+b\lambda+c=0
$$
has two equal roots, then the general solution is given by
$$
x_n=(A+nB)\alpha^n.
$$
Could you please explain that to me, I do not see that!

Let $D$ be defined as $(Dx)_n = x_{n+1}$. Assuming $a \neq 0$, we have
$x_{n+2}+{b \over a} x_{n+1} + {c \over a}x_n = 0$, or
$(D^2 +{b \over a} D + {c \over a}I)x = 0$. Suppose $\lambda$ is the repeated root of the quadratic $y^2+{b \over a} y + {c \over a} = 0$, then we can write the difference equation as
$(D-\lambda)^2 x = 0$.
We see that $(D-\lambda) x = 0$ iff $x_n = x_0 \lambda^n$ for some $x_0$ (with the convention that $0^n = \delta_{0n}$).
Also note that if $c$ is a constant, then $(D-1)x = c$ iff
$x_n = x_0 +nc$ for some $x_0$.
We can write the equation $(D-\lambda)^2 x = 0$ as the pair of equations $(D-\lambda)y = 0$, $(D-\lambda) x = y$.
The first gives $y_n = y_0 \lambda^n$ for some $y_0$.
If $\lambda = 0$, then solving $(D x)_n = y_0 \delta_{0n}$ gives $x_n = x_0 \delta_{0 n}+ y_0 \delta_{1 n}$ for some $x_0,y_0$ (that is, the sequence
$x=(x_0,y_0,0,...)$).
If $\lambda \neq 0$, then we have ${1 \over \lambda^n}((D-\lambda)x)_n = y_0$. Let $l$ denote the function $l_n = \lambda^n$, then we have
${ 1\over l} (D-\lambda) x = y_0$. Expanding gives
${1 \over l} Dx - {1 \over l} \lambda x = \lambda D {x \over l} - \lambda {x \over l} = \lambda (D-1) {x \over l} = y_0$, or $(D-1) {x \over l} = { y_0 \over \lambda}$.
Noting that $n \mapsto { y_0 \over \lambda}$ is a constant function, we see that this gives $({x \over l})_n = {x_n \over \lambda^n} = x_0 + n {y_0 \over \lambda}$, or $x_n = (x_0 + n {y_0 \over \lambda}) \lambda^n$, which is the desired form.
