Find the solution to the following non-homogenous recurrence relation: $a_{n+2} + a_{n+1} - 2a_n = n$ for $a_0 = 1$, $a_1 = -2$
I have found the homogenous part with the characteristic polynomial is $a_n = C_1(-2)^n + C_2$ but don't know how to find the non-homogenous part?
Thanks in advance.
Hint: The general solution of a non-homogenous recurrence relation is equal to the sum of the general solution of a homogenous recurrence relation and a partial solution of a non-homogenous recurrence relation. So you have only to find the last.
I corrected the rest of the text:
If the right side of the given equation is a polynomial in $n$ of degree $m$ then a partial solution can be found in the form $a_n = n^rf(n)$ where $f(n)$ is a polynomial in $n$ of degree $m$ and $r$ is the multiplicity of the root $1$ of the characteristic equation (in your case $r=1$). Substitute it in your equation and find $f(n)$.