Consider the non-homogeneous linear recurrence relations $a_n=2a_{n-1}+2^n$ find all solutions. I'm having a hard time understanding how to find all solutions of the form $a_n = a^{(h)}_n+a_n^{(p)}$
I show that $a_n=n2^n \to a_n=2(n-1)2^{n-1} +2^n=2^n(n-1+1)=n2^n$.
I can show that $a_n^{(h)}$ characteristic equation $r-2=0 \to a_n^{(h)}=\alpha2^n$
But I'm stuck on $a_n^{(p)}$ characteristic equation $C2^n=2C\cdot2^{n-1}+2^n$
Simplifies to $C \neq C+1$, Looking online I saw that the solution is $a_n=c\cdot2^n+n2^n$, but I'm not sure how to get there. 
 A: Your homogeneous solution has $2^n$ in it already. When this happens, for the particular solution part, we cannot just use $C2^n$ (you have seen what happens if we do). Instead, the rule in this scenario is to modify the guess by multiplying by $\boldsymbol{n}$, i.e. try $a_n^{(p)}=C\color{red}{n}\cdot 2^n$.
A: Here is another take.
Let $b_n=2^n$. Then
$$
a_n=2a_{n-1}+2b_{n-1}, \quad b_n=2b_{n-1}, \quad b_0=1
$$
and so
$$
\pmatrix{
a_n \\ b_n
}
=
\pmatrix{
2 & 2 \\ 0 & 2
}
\pmatrix{
a_{n-1} \\ b_{n-1}
}
=
2
\pmatrix{
1 & 1 \\ 0 & 1
}
\pmatrix{
a_{n-1} \\ b_{n-1}
}$$
which gives
$$
\pmatrix{
a_n \\ b_n
}
=
2^n
\pmatrix{
1 & 1 \\ 0 & 1
}^n
\pmatrix{
a_0 \\ b_0
}
=
2^n
\pmatrix{
1 & n \\ 0 & 1
}
\pmatrix{
a_0 \\ b_0
}
$$
Therefore,
$$
a_n = a_0 2^n + n 2^n
$$
A: Let $a_m=b_m+2^m(a_0+a_1m+a_2m^2+\cdots)$
$$2^n=a_n-2a_{n-1}$$
$$=ba_n-2b_{n-1}+2^n(a_0+a_1n+a_2n^2+\cdots)-2^n(a_0+a_1(n-1)+a_2(n-1)^2+\cdots)$$
$$=ba_n-2b_{n-1}+2^n[a_1+a_2\{n^2-(n-1)^2\}+a_3\{n^3-(n-1)^3\}+\cdots]$$
For $a_r,$ the highest exponent of $n$ is $r-1$
$a_r=0\ \forall r\ge2$ as the coefficient of $2^n$ in the left hand side is $1$
Set $a_1=1$ so that $b_n=2b_{n-1}=2^rb_{n-r}; 0\le r\le n$
