$$ y(k + 2) - 3y(k + 1) +2y(k) = 2^k + k $$
Transform into a system of $n$ first order equations (Step 1)
$$\begin{align} x_1(k) &= y(k)\\ x_2(k) &= y(k + 1) \end{align}$$
It follows that the second order difference equation becomes the system:
$$\begin{align} x_1(k+1) &= x_2(k)\\ x_2(k+1) &= -2x_1(k) +3x_2(k) + 2^k + k \end{align}$$
To put it in matrix form $x(k+1) = Ax(k) + bu(k)$: $$ x(k+1) = \begin{bmatrix}0 & 1\\ -2 & 3\end{bmatrix}x(k) + \begin{bmatrix}0 \\1\end{bmatrix} (2^k + k) $$
Diagonal form (or Jordan canonical form) of $A$ (Step 2)
Characteristic polynomial of the matrix $A$, along with eigenvalues $\lambda_i$ and the corresponding eigenvectors $e_i$:
$$ p(\lambda) = \lambda^2 - 3\lambda + 2\\ \lambda_1 = 1, e_1 = \begin{bmatrix}1\\1\end{bmatrix}\\ \lambda_2 = 2, e_2 = \begin{bmatrix}\frac 12\\1\end{bmatrix}\\ $$
Matrix $A$ is diagonalizable, that is: $\Lambda = S^{-1}AS$ or $A = S\Lambda S^{-1}$, and it follows that $A^k = S\Lambda^k S^{-1}$
$$ A^k = \begin{bmatrix}1 & \frac 12\\ 1 & 1\end{bmatrix} \begin{bmatrix}1 & \\ & 2^k\end{bmatrix} \begin{bmatrix}2 & -1\\-2 & 2\end{bmatrix} = \begin{bmatrix}2-2^k & 2^k -1 \\ 2 -2^{k+1} & 2^{k+1} - 1\end{bmatrix} $$
This is right because $S\Lambda^0 S^{-1} = I$ and $S\Lambda^1 S^{-1} = A$
Closed form solution (Step 3)
I know that the general solution of a discrete dynamic system is:
$$\begin{align} x(1) &= Ax(0) + bu(0)\\ x(2) &= Ax(1) + bu(1)\\ & = A(Ax(0) + bu(0)) + bu(1)\\ &= A^2x(0) + Abu(0) + bu(1)\\ x(3) &= Ax(2) + bu(2)\\ &= A(A^2x(0) + Abu(0) + bu(1)) + bu(2)\\ &= A^3x(0) + A^2bu(0) + Abu(1) + bu(2)\\ x(k) &= A^kx(0) + \sum_{i = 0}^{k-1}A^{k-1-i}bu(k) \end{align}$$
Because $y(k) = x_1(k)$ we only need the first row of $A^k$, that is $A_1^k$. The solution for the homogeneous equation is:
$$ y_h(k) = (2 - 2^k)y(0) + (2^k - 1)y(1) $$
How to find the closed form for the particular solution?