solving $a_{n+2}-3a_{n+1}+2a_n=2n$ How can i generalize $a_n$ for $a_{n+2}-3a_{n+1}+2a_n=2n$ with $a_0=1,a_1=0$?
I can't think on any way to approach this and I will be happy if I could get help help. thanks

The characteristic polynomial is
$x^2-3x+2
=(x-1)(x-2)
$
so the homogeneous solutions are
$1$ and $2^n$.
To find a specific solution to
$a_{n+2}-3a_{n+1}+2a_n=2n$,
try
$a_n = un^2+vn+w$.
Then
$\begin{array}\\
2n
&=u(n+2)^2+v(n+2)+w-3(u(n+1)^2+v(n+1)+w)+2)un^2+vn+w)\\
&=u(n^2+4n+4)+vn+2v+w-3(u(n^2+2n+1)+vn+v+w)+2(un^2+vn+w)\\
&=n(4u+v-6u-3v+2v)+4u+2v+w-3u-3v-3w+2w\\
&=-2un+u-v\\
\end{array}
$
Therefore
$u=-1$
and
$v=u=-1$,
so the solution is
$-n^2-n$.
Therefore the general solution is
$-n^2-n+a+b2^n$.
Choose $a$ and $b$
to fit initial conditions.
