Is it possible to solve this recurrence equation? 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.
 A: As you can see, doing $y_{n+1}= r^{n+1}y_{0}+\sum_{k=0}^{n} r^{n-k} q_{k}$ once is probably OK but doing it one more time will usually lead to messiness.
In addition to Gerry Myerson's way, another method for this problem is to make it homogeneous:
$$
y_{n+2} - y_{n+1} -2 y_n = n2^n \tag1 
$$
$$ y_{n+1} - y_{n} -2 y_{n-1} = (n-1) 2^{n-1} \tag2
$$
$$(1)-2 \times (2) \implies y_{n+2}-3y_{n+1} + 4y_{n-1}=2^n \tag3 $$
$$y_{n+1}-3y_n + 4y_{n-2}=2^{n-1} \tag4 $$
$$(3)-2\times(4) \implies y_{n+2} - 5y_{n+1} + 6y_n+4y_{n-1}-8y_{n-2} = 0 \tag 5$$
At first glance (5) may look scary, but you already know the homogeneous part of (1) has two roots -1 and 2; and by doing $(1)-2\times(2)$ and $(3)-2\times(4)$ you know there are 2 more duplicate roots of 2. Indeed it's easy to verify that
$$
y^4-5y^3+6y^2+4y-8=(y+1)(y-2)^3.
$$
If you use forward shift operator it's even more obvious:
$$
(\mathbb{E}+1)(\mathbb{E}-2)y_n=n2^n \\
\implies (\mathbb{E}+1)(\mathbb{E}-2)^2 y_{n-1} = n2^n - 2(n-1)2^{n-1}=2^n\\
\implies (\mathbb{E}+1)(\mathbb{E}-2)^3 y_{n-2} = 2^n-2\cdot 2^{n-1} = 0.
$$
For other examples on use of the forward shift operator, see Finding explicit formula for recursive relation
