We consider the recurrence relation relation
$$ x_k=a_kx_{k-1}+b_k $$ where the coefficients are arbitrary functions of $k$ and the initial conidtion is $x_0$. The solution is found by induction as follows:
$$ \begin{align} &x_1=a_1 x_0+b_1\\ &x_2=a_1a_2x_0+a_2b_1+b_2\\ &x_3=a_1a_2a_3x_0+a_2a_3b_1+a_3b_2+b_3\\ &x_4=a_1a_2a_3a_4x_0+a_2a_3a_4b_1+a_3a_4b_2+a_4b_3+b_4\\ &\vdots\\ &x_k=x_0\prod_{j=1}^ka_j+b_1\prod_{j=2}^ka_j+b_2\prod_{j=3}^ka_j+\ldots+b_{k-2}\prod_{k-1}^ka_j+b_{k-1}\prod_k^ka_j+b_k \end{align} $$
Let us denote the vertical vectors containing the coefficients $a_k,b_k$, as $A,B$, respectively. If we pre-fix $x_0$ to $B$ and post-fix unity (1) to $A$, then we can simplfy the above to its canonical form, namely
$$ x_k=\sum_{j=1}^k b_j \prod_j^{k+1}a_j $$
I believe that this solution is correct insofar as it has been tested against the recurrence relation for arbitrary (random) real and complex parameters and initial conditions. In addition the relation is valid for negative indices by simply mapping $A\mapsto 1/A$ and $B\mapsto -B/A$.
Now, this solution was relatively straightforward and so I am wondering (a) do you see any problems here?, (b) has this been done before?, and (c) is there a better way to do this?