# Solving nonhomogeneous differential equation

Solve $$x^\prime=\begin{pmatrix} -1 & 1 &1 \\ 0& -1 & 1\\ 0& 0 & 1\\ \end{pmatrix}x+\begin{pmatrix} 0\\0\\e^{2t}\\ \end{pmatrix}$$

I computed the eigenvalues as $$\lambda=1,-1$$ with corresponding eigenvectors $$\begin{pmatrix} 3\\2\\4 \end{pmatrix}$$ and $$\begin{pmatrix} 1\\0\\0 \end{pmatrix}$$

And the generalized eigenvector for $$\lambda=-1$$ of $$\begin{pmatrix} 1\\1\\0 \end{pmatrix}$$

Which gives complementary solution $$y_c(t)=c_1e^t\begin{pmatrix} 3\\2\\4 \end{pmatrix}+c_2e^{-2t}\begin{pmatrix} 1\\0\\0 \end{pmatrix}+c_3e^{-t}\Biggr(t\begin{pmatrix} 1\\0\\0 \end{pmatrix}+\begin{pmatrix} 1\\1\\0 \end{pmatrix}\Biggr)$$

But I'm having a problem finding a particular solution. Because of the generalized eigenvector. I think I need $$y_p(t)=t\vec{a}+\vec{b}+\vec{c}$$?

The particular solution has the form $$\begin{pmatrix} Ae^{2t}\\Be^{2t}\\Ce^{2t}\end{pmatrix}$$
The coefficients $$A,B,C$$ are easily found by plugging into your in-homogeneous equation.
You can also solve only: $$x'_3=x_3+e^{2t}$$ $$(x_3e^{-t})'=e^{t}$$ Integrate. $$x_3(t)=e^{2t}+c_3e^t$$ Nite that you should have: $$y_c(t)=c_1e^t\begin{pmatrix} 3\\2\\4 \end{pmatrix}+c_2e^{\color{red}{-t}}\begin{pmatrix} 1\\0\\0 \end{pmatrix}+c_3e^{-t}\Biggr(t\begin{pmatrix} 1\\0\\0 \end{pmatrix}+\begin{pmatrix} 1\\1\\0 \end{pmatrix}\Biggr)$$