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
 A: Do you know "telescoping". Here is the deal:   Put $b_n = a_{n+1} - a_n \implies b_{n+1} - b_n = 2n \implies b_n = b_0 + (b_1 - b_0) + (b_2 - b_1) + \cdots + (b_n - b_{n-1}) = 1 + 2\cdot 0 + 2\cdot 1 + 2\cdot 2 +\cdots + 2(n-1) = 1 + 2(1+2+\cdots + (n-1)) = 1+ (n-1)n$ . Repeat this trick again for $a_n$ to get the answer.
A: Let $u_n=a_{n+1}-a_n$. From $a_{n+2}-3a_{n+1}+2a_n=2n,a_{n+3}-3a_{n+2}+2a_{n+1}=2(n+1)$, one has
$$ u_{n+2}-3u_{n+1}+2u_n=2 $$
or 
$$ u_{n+2}-u_{n+1}-2(u_{n+1}-u_n)=2. $$
Letting $v_n=u_{n+1}-u_n$, one have
$$v_{n+1}-2v_n=2$$ 
or
$$ v_{n+1}+2=2(v_n+2). $$
So
$$ v_n+2=2^{n-1}(v_1+2)=2^{n-1}(u_2-u_1+2)=2^n$$
or 
$$ v_n=2^n-2. $$
Hence
$$ u_{n+1}-u_n=2^n-2 $$
and so
$$ u_n=(2^{n-1}+2)+(2^{n-2}+2)+\cdots+(1+2)+u_0=2^n-2n-2. $$
Finally
$$ a_{n+1}-a_n=2^n-2n-2 $$
from which one has
$$ a_n=2^{n}-n^2-n.$$
A: 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.
A: You have $$ (a_{n+2}-a_{n+1}) -2(a_{n+1}-a_{n} ) = 2n $$
hence, 
$$ \sum_{n=0}^{m} (a_{n+2}-a_{n+1}) -2\sum_{n=0}^{m}a_{n+1}-a_{n+1} = 2\sum_{n=0}^{m} n =m(m+1)$$
that is, 
$$ (a_{m+2}-a_{1}) -2(a_{m+1}-a_{0}) =m(m+1)$$
that is  $$ a_{m+1} -2a_{m}=-2a_{0}+ a_{1}+m(m-1)$$
therefore by variational method, a_m take the form,  $$a_m =A_m2^m $$
But $$ A_{m+1}2^{m+1} =  a_{m+1} =2A_m2^m -2+ 2 m(m-1)\implies  A_{m+1} - A_{m} =-\frac{1}{ 2^{m}} +\frac{m(m-1)}{ 2^{m}}$$ 
That is by teslcoping again,
$$A_n =\sum_{m=0}^{n}(-\frac{1}{ 2^{m}} +\frac{m(m-1)}{ 2^{m}})$$
thus $$a_n = A_n2^n =2^n \sum_{m=0}^{n}(-\frac{1}{ 2^{m}} +\frac{m(m-1)}{ 2^{m}})$$
