What is the general solution of the linear difference equation $y_{n+3}-4y_{n+2}+5y_{n+1}-2y_n=2^n$ What is the general solution to the linear difference equation:
$$y_{n+3}-4y_{n+2}+5y_{n+1}-2y_n=2^n$$
I followed the instructions given in this video. And I got the following for the homogeneous part I got:
$$y_n^c = A+Bn+C2^n$$
for the particular part I got
$$y_n^p = C_02^n$$
, putting this in the initial equation I got $C_0*0=1$, so no solution. What should I do now? Or did I do something wrong somewhere?
 A: The recurrence can be reduced to a homogeneous recurrence one degree higher by eliminating the $\,2^n\,$ power on the RHS between two consecutive relations.
$$
\begin{align}
y_{n+3}-4y_{n+2}+5y_{n+1}-2y_n &= 2^n \tag{1}
\\ y_{n+4}-4y_{n+3}+5y_{n+2}-2y_{n+1} &= 2^{n+1} \tag{2}
\end{align}
$$
Then $\,(2) - (1) \times 2\,$ gives:
$$
y_{n+4} - 6 y_{n+3} + 13 y_{n+2} - 12 y_{n+1} + 4 y_n = 0
$$
The characteristic polynomial of the latter is $\,(t-1)^2(t-2)^2\,$, so the general solution is:
$$
y_n = a + bn + (c + dn)\, 2^n
$$
The initial values $\,y_0$, $y_1$, $y_2$, $y_3 = 4y_2 - 5y_1 + 2 y_0 + 1\,$ determine the constants $\,a,b,c,d\,$.

[ EDIT ] $\;$ To elaborate on the last line, the constants $\,a,b,c,d\,$ are not independent, because they are constrained by the condition that $\,y_0$, $y_1$, $y_2$, $y_3\,$ must satisfy the original recurrence:
$$
\begin{align}
y_3 = a+3b + 8(c+3d) &= 4y_2 - 5y_1 + 2 y_0 + 1
\\ &= 4\left(a + 2b + 4(c+2d)\right) - 5\left(a + b + 2(c+d)\right) + 2\left(a + c\right) + 1
\\ &= a + 3 b + 8 c + 22 d + 1
\end{align}
$$
Equating the first and last lines, it follows that $\,d=\dfrac{1}{2}\,$, so in the end the general solution is:
$$
y_n \;=\; a + bn + \left(c + \frac{n}{2}\right)\, 2^{n} \;=\; a + bn + \left(c' + n\right)\, 2^{n-1}
$$
A: The characteristic polynomial is
$ m^3 - 4 m^2 + 5 m - 2 = (m-1)^2 (m-2) $
And the annihilator of the driving term is $(m-2)$, hence
$ (m-1)^2 (m-2)^2 (y) = 0 $
The general solution is
$ y_n = A + B n + C (2)^n + D n (2)^n $
The particular solution is $ y_p = D n (2)^n $
Plug this in the original difference equation,
$  D (n+3) 2^{n+3} - 4 D (n+2) 2^{n+2} + 5 D (n+1) 2^{n+1} - 2 D n (2)^n = 2^n $
From which it follows that
$ D ( 8 n + 24 - 16 n - 32 + 10 n + 10 - 2 n ) = 1 $
$ D = \dfrac{1}{2} $
So a particular solution is $ y_p =  \dfrac{1}{2} n (2)^n $
Now the general solution is the sum of a particular solution and the homogenous solution
$y_n= y_p + y_h =  \dfrac{1}{2} n (2)^n + A + B n + C (2)^n$
The constants $A,B,C$ can be determined in a straight forward manner using the initial conditions $y_0, y_1, y_2 $  or $ y_1, y_2, y_3 $, by building a $3 \times 3 $ linear system in $A, B,C$ which can be solved using Gauss-Jordan elimination.  Explicity, we have
$ \begin{bmatrix} 1 && 1 && 2 \\ 1 && 2 && 4 \\ 1 && 3 && 8 \end{bmatrix} \begin{bmatrix} A \\ B \\ C \end{bmatrix} = \begin{bmatrix} y_1 - 1 \\ y_2 - 4 \\ y_3 - 12  \end{bmatrix} $
