[Math] How to solve a 2nd order non-homogeneous linear recurrence

recurrence-relations

I have a problem in solving this equation :

$x_{n+2} + 3\ x_{n+1} + 2\ x_{n} = 5 \times 3^n $

given that $x_{0} = 0$ and $x_{1} = 1$.

I solved the homogeneous associated equation and got $v_{n} = c_{1} \times (-1)^{n} + c_{2} \times (-2)^{n}$ (where $c_{1}$ and $c_{2}$ are constants).
Could somebody explain the general method for solving second order non-homogeneous linear recurrence ?

Best Answer

Well, you need to find a particular solution of the inhomogeneous equation, and the rhs suggest that something of the form $c(n)3^n$ should work. The simplest form of $c$ is a constant, so try that. If it works, you are golden, if not, try a linear function, etc, then add the homogeneous solution and you are good.