# Solving coupled recurrence equations with non-constant coefficients

I've been looking at this way too long on this problem now, and perhaps I'm just not seeing it clear but I can't figure out how solve the coupled recurrence equations $$a_n, b_n$$ with non-constant coefficients as in e.g.

$$\begin{cases}a_n = f_1(n)a_{n-1} + f_2(n)b_{n-1}\\ b_n = g_1(n)a_{n-1} + g_2(n)b_{n-1}.\end{cases}$$

Coupled equations are easily solved as long as the coefficients are constant as well as equations with non-constant coefficients as long as they're not coupled. But when combined I'm stuck!

From your first equation, $$f_2(n)b_{n-1}=a_n-f_1(n)a_{n-1}\ ;$$ hence also $$f_2(n+1)b_n=a_{n+1}-f_1(n+1)a_n\ .$$ Multiplying the second equation by $$f_2(n)f_2(n+1)$$ gives $$f_2(n)f_2(n+1)b_n=f_2(n)f_2(n+1)g_1(n)a_{n-1}+f_2(n)f_2(n+1)g_2(n)b_{n-1}\ ;$$ substituting from the previous two equations and tidying up a bit, \eqalign{f_2(n)a_{n+1}&=(f_2(n+1)g_2(n)+f_2(n)f_1(n+1))a_n\cr &\qquad{}+f_2(n+1)(f_2(n)g_1(n)-g_2(n)f_1(n))a_{n-1}\ .\cr} This is a non-coupled equation with non-constant coefficients, which you say is easy to solve. (Not sure I agree about that though.)