general solution to linear second order difference equation Is there a general solution to difference equations of the form:
$$
u(n+2) + a(n)u(n+1) + b(n)u(n) = 0
$$
Thank you in advance

Besides linear ODEs (http://en.wikipedia.org/wiki/Abel%27s_identity#Proof_using_Liouville.27s_formula)(Does this ODE question have closed form solution?), linear difference equations also have similar tricks:
In fact $u(n+2)+a(n)u(n+1)+b(n)u(n)=0$ can rewrite to the matrix form
$\begin{pmatrix}u(n+1)\\u(n+2)\end{pmatrix}=\begin{pmatrix}0&1\\-b(n)&-a(n)\end{pmatrix}\begin{pmatrix}u(n)\\u(n+1)\end{pmatrix}$
$\begin{pmatrix}u(n)\\u(n+1)\end{pmatrix}=\begin{pmatrix}0&1\\-b(n-1)&-a(n-1)\end{pmatrix}\begin{pmatrix}u(n-1)\\u(n)\end{pmatrix}$
This becomes to a matrix difference equation.
For the discrete version $\begin{pmatrix}u_n\\u_{n+1}\end{pmatrix}=\begin{pmatrix}0&1\\-b(n-1)&-a(n-1)\end{pmatrix}\begin{pmatrix}u_{n-1}\\u_n\end{pmatrix}$ ,
$\begin{pmatrix}u_n\\u_{n+1}\end{pmatrix}=\prod_{k=n-1}^c\begin{pmatrix}0&1\\-b(k)&-a(k)\end{pmatrix}\begin{pmatrix}u_c\\u_{c+1}\end{pmatrix}$
$\therefore u_n=C_1f(n)+C_2g(n)$ , where $C_1$ and $C_2$ are arbitrary constants, $f(n)$ and $g(n)$ are the top-left and top-right elements of the simplified matrix expression $\prod_{k=n-1}^c\begin{pmatrix}0&1\\-b(k)&-a(k)\end{pmatrix}$ respectively.
Now for the continuous version $\begin{pmatrix}u(n)\\u(n+1)\end{pmatrix}=\begin{pmatrix}0&1\\-b(n-1)&-a(n-1)\end{pmatrix}\begin{pmatrix}u(n-1)\\u(n)\end{pmatrix}$
$\therefore u(n)=T_1(n)f(n)+T_2(n)g(n)$ , where $T_1(n)$ and $T_2(n)$ are arbitrary periodic functions with period $1$, $f(n)$ and $g(n)$ are the top-left and top-right elements of the simplified and continuous extended matrix expression $\prod_{k=n-1}^c\begin{pmatrix}0&1\\-b(k)&-a(k)\end{pmatrix}$ respectively.
But the simplification process and the continuous extension process of $\prod_{k=n-1}^c\begin{pmatrix}0&1\\-b(k)&-a(k)\end{pmatrix}$ are super complicated.
