Use the variation of parameters to solve the given nonhomogeneous system. x’=[[3,2],[-2,-1]]x+[[4e^(-t)],[e^(-t)]]

Solution:
x'=\begin{pmatrix}3&2\\ -2&-1\end{pmatrix}x+\begin{pmatrix}4e^{-t}\\ e^{-t}\end{pmatrix}\\
Here we have,
f(t)=\begin{pmatrix}4e^{-t}\\ e^{-t}\end{pmatrix}\\
A=\begin{pmatrix}3&2\\ -2&-1\end{pmatrix}\\
(A-xI) \:\:is, \\
\begin{pmatrix}3&2\\ -2&-1\end{pmatrix}-x\begin{pmatrix}1&0\\ 0&1\end{pmatrix}\\
=\begin{pmatrix}3-x&2\\ -2&-1-x\end{pmatrix}\\
Take determinant=0
(3-x)(-1-x)+4=0\\
x^2-2x+1=0\\
(x-1)^2=0\\
x-1=0\\
x=1………….Eigenvalue.
For\:\:\:x=1\:\:\left(A-xI\right)\:\:is,\\
\begin{pmatrix}3&2\\ -2&-1\end{pmatrix}-1\cdot \begin{pmatrix}1&0\\ 0&1\end{pmatrix}=\begin{pmatrix}2&2\\ -2&-2\end{pmatrix}\\
The system Ax=0 is,
\begin{pmatrix}2&2\\ -2&-2\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix}=\begin{pmatrix}0\\ 0\end{pmatrix}\\
2x+2y=0...................x=-y\\
y=y ……………………….free variable.
The solution is,
\begin{pmatrix}x\\ y\end{pmatrix}=y\begin{pmatrix}-1\\ 1\end{pmatrix}\\
The eigenvector is,
v_1=\begin{pmatrix}-1\\ 1\end{pmatrix}\\
Find the generalized vector v_2\\
\begin{pmatrix}2&2\\ -2&-2\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix}=\begin{pmatrix}-1\\ 1\end{pmatrix}\\
2x+2y=-1..................x=-y-\frac{1}{2}\\
y=y ……………………….free variable.
The solution is,
\begin{pmatrix}x\\ y\end{pmatrix}=\begin{pmatrix}-y-\frac{1}{2}\\ y\end{pmatrix}\\
For simplicity, choose y=0.
\begin{pmatrix}x\\ y\end{pmatrix}=\begin{pmatrix}-0-\frac{1}{2}\\ 0\end{pmatrix}\\
\begin{pmatrix}x\\ y\end{pmatrix}=\begin{pmatrix}-\frac{1}{2}\\ 0\end{pmatrix}\\
The eigenvector is,
v_2=\begin{pmatrix}-\frac{1}{2}\\ 0\end{pmatrix}\\
The solution to the homogeneous system is given by,
x_h=c_1e^{xt}v_1+c_2e^{xt}\left(tv_1+v_2\right)\\
x_h=c_1e^t\begin{pmatrix}-1\\ 1\end{pmatrix}+c_2e^t\left(t\begin{pmatrix}-1\\ 1\end{pmatrix}+\begin{pmatrix}-\frac{1}{2}\\ 0\end{pmatrix}\right)\\
x_h=c_1e^t\begin{pmatrix}-1\\ 1\end{pmatrix}+c_2e^t\begin{pmatrix}-t-\frac{1}{2}\\ t\end{pmatrix}\\
The fundamental matrix is,
M=e^t\begin{pmatrix}-1&-t-\frac{1}{2}\\ 1&t\end{pmatrix}\\
The inverse of M is,
M^{-1}=e^{-t}\begin{pmatrix}2t&2t+1\\ -2&-2\end{pmatrix}\\
The particular solution is given by,
x_p=M\int M^{-1}f\left(t\right)dt\\
x_p=e^t\begin{pmatrix}-1&-t-\frac{1}{2}\\ 1&t\end{pmatrix}\int e^{-t}\begin{pmatrix}2t&2t+1\\ -2&-2\end{pmatrix}\begin{pmatrix}4e^{-t}\\ e^{-t}\end{pmatrix}dt\\
x_p=e^t\begin{pmatrix}-1&-t-\frac{1}{2}\\ 1&t\end{pmatrix}\int e^{-t}\begin{pmatrix}10e^{-t}t+e^{-t}\\ -10e^{-t}\end{pmatrix}dt\\
x_p=e^t\begin{pmatrix}-1&-t-\frac{1}{2}\\ 1&t\end{pmatrix}\int \begin{pmatrix}e^{-2t}\left(10t+1\right)\\ -10e^{-2t}\end{pmatrix}dt\\
x_p=e^t\begin{pmatrix}-1&-t-\frac{1}{2}\\ 1&t\end{pmatrix}\begin{pmatrix}-5e^{-2t}t-3e^{-2t}\\ 5e^{-2t}\end{pmatrix}\\
x_p=e^{-t}\begin{pmatrix}-1&-t-\frac{1}{2}\\ 1&t\end{pmatrix}\begin{pmatrix}-5t-3\\ 5\end{pmatrix}\\
x_p=e^{-t}\begin{pmatrix}\frac{1}{2}\\ -3\end{pmatrix}\\
The general solution is given by,
x=x_h+x_p\\
x=c_1e^t\begin{pmatrix}-1\\ 1\end{pmatrix}+c_2e^t\begin{pmatrix}-t-\frac{1}{2}\\ t\end{pmatrix}+e^{-t}\begin{pmatrix}\frac{1}{2}\\ -3\end{pmatrix}\\
Final answer:
x=c_1e^t\begin{pmatrix}-1\\ 1\end{pmatrix}+c_2e^t\begin{pmatrix}-t-\frac{1}{2}\\ t\end{pmatrix}+e^{-t}\begin{pmatrix}\frac{1}{2}\\ -3\end{pmatrix}\\