I wish to solve $y_{n+2}-y_{n+1}-2y_{n}=n2^n$ by first reducing the problem to first order equations with the help of the characteristic equation, which yields the solutions: $r=-1,2$. I have learned to solve first orders with the following formula: $\forall n \geq 0: y_{n+1}=r y_{n}+q_{n} \implies y_{n+1}= r^{n+1}y_{0}+\sum_{k=0}^{n} r^{n-k} q_{k}$
So:
$y_{n+2}-y_{n+1}-2y_{n}=(y_{n+2}+y_{n+1})-2(y_{n+1}+y_{n})$, with help of substitution $z_{n}=y_{n+1}+y_{n}: z_{n+1}-2z_n=n2^n \implies z_{n+1}=2^{n+1}z_0+\sum_{k=0}^{n}2^{n-k}k2^k=2^{n+1}z_0+\frac{1}{2}2^n n(n+1) \implies z_{n}=2^nz_0+\frac{1}{2}2^{n-1}n(n-1)$
Subsequently solve in the same way $y_{n+1}+y_n=z_n \implies y_{n}=(-1)^n y_0 +\sum_{d=0}^{n} (-1)^{n-d} (2^dz_0+\frac{1}{2}2^{d-1}d(d-1))$
As you can see it gets quite messy at the end, making me think that I have made a few errors along the way or used this method the wrong way.
Or maybe $y_n=(An^3+Bn^2+Cn+D)2^n$?.
– Neat Math Nov 16 '20 at 04:08$\frac{1}{2}2^{d-1}d(d-1))=2^{d-1} {d \choose 2}$ so you can use binomial theorem.
– Neat Math Nov 16 '20 at 14:22