How would I solve or obtain a closed-form solution for a recurrence relation like $$a_n = f_1(n)a_{n-1} + f_2(n)a_{n-2} + ... + f_k(n)a_{n-k} + g(n)$$ where $f_1, f_2, ..., f_k, g$ are polynomials and $\left \{a_n\right \}$ is my recursively defined series? Perhaps it would be simpler to solve $a_n = f(n)a_{n-1} + g(n)$?
I tried solving a simple example, like $a_n = na_{n-1} + 2n + 3$ with the techniques I have learnt to solve homogeneous and non-homogeneous linear recurrences, but it didn't work out (I got a wrong answer). I think I am going wrong where I guess the form of the homogeneous and non-homogeneous parts: usually we think of the homogeneous and non-homogeneous parts as having a form similar to that given in the recurrence relation (eg. linear non-homogeneous recurrence means linear non-homogeneous solution, etc.)
How do I solve these recurrences? Can they be solved at all, at least for simple cases like the one I tried? Thanks for your attention!
Edit: I tried using Wolfram Alpha to solve a few examples, but the answer comes out looking far from easy. Are there any simple examples which I can try to solve on my own, except for trivial ones like $a_n = na_{n-1}$?