How to solve a 2nd order non-homogeneous linear recurrence? 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 ?

Use generating functions directly. Define $G(z) = \sum_{n \ge 0} x_n z^n$, multiply by $z^n$ and sum over $n \ge 0$, recognize a few sums:
$$
\frac{G(z) - x_0 - x_1 z}{z^2} + 3 \frac{G(z) - x_0}{z} + 2 G(z)
  = 5 \frac{1}{1 - 3 z}
$$
As partial fractions:
$$
A(z) = \frac{1}{4} \cdot \frac{1}{1 - 3 z} - \frac{1}{4} \cdot \frac{1}{1 + z}
$$
Everything in sight is just geometric series;
$$
a_n
  = \frac{3^n - (-1)^n}{4}
$$
