Finding the general solution of an ODE in matrix form using integration so I have done this other times, but this seems to be a tricky case... The teacher also used a method that it is not in the book to show us another way of doing it, but I do not understand it :/
So here is the problem:
Find the general solution to the system of ODEs equations
$$\frac{d\vec{x}}{dt}=\left( {\begin{array}{cc}
   1 & 1 \\
   0 & 1 \\
  \end{array} } \right) \vec{x}+\left( {\begin{array}{cc}
   1 \\
   0 \\
  \end{array} } \right)t+\left( {\begin{array}{cc}
   0 \\
   2 \\
  \end{array} } \right)$$
I know how to find the solution to the non-homogeneous equation, but not the homogeneous one. The solution to the homogeneous equation that is given by the professor is:
We can use matrix algebra techniques, but in this exercise we are going to integrate the pair of equations.
$$\frac{d(\vec{x}_2)_h}{dt}=(\vec{x}_2)_h \implies (\vec{x}_2)_h=a_2 e^t,$$
which is homogeneous and first order.
The second equation depends on the solution to the first
$$\frac{d(\vec{x}_1)_h}{dt}=(\vec{x}_1)_h+(\vec{x}_2)_h\implies \frac{d(\vec{x}_1)_h}{dt}=(\vec{x}_1)_h+a_2 e^t\implies (\vec{x}_1)_h=a_1 e^t+a_2 t e^t$$
What I do not understand:
I understand that $\frac{d(\vec{x}_2)_h}{dt}=(\vec{x}_2)_h$ and $\frac{d(\vec{x}_1)_h}{dt}=(\vec{x}_1)_h+(\vec{x}_2)_h$, but I do not understand how it gets the results for $(\vec{x}_2)_h$ and $(\vec{x}_1)_h$. How does he know without working out the eigenvalues, etc.?
Another thing I do not understand:
I tried to solve it using matrices, like I always do, but I am pretty sure I got it wrong.
$$\left| A-\lambda I\right|=\left| {\begin{array}{cc}
   1-\lambda && 1 \\
   0 && 1-\lambda \\
  \end{array} } \right|=(1-\lambda)^2=0 \implies \lambda=1$$
And we have eigenvectors $\left({\begin{array}{cc}
   k \\
   0 \\
  \end{array} }\right)$, where $k$ is a constant.
Then the solution to the homogeneous equation will be given by
$$\vec{x}(t)=c_1 e^t \left({\begin{array}{cc}
   k \\
   0 \\
  \end{array} }\right) + c_2\left(e^t t\left({\begin{array}{cc}
   k \\
   0 \\
  \end{array} }\right)+e^t\left({\begin{array}{cc}
   k \\
   0 \\
  \end{array} }\right)\right)=c_3 e^t \left({\begin{array}{cc}
   k \\
   0 \\
  \end{array} }\right) + c_4 e^t t\left({\begin{array}{cc}
   k \\
   0 \\
  \end{array} }\right)$$
Would this be correct? It looks really weird/unfinished to me.
 A: In this particular case, $x_2$ does not depend on $x_1$. Thus we can find the general solution of
$$\frac{d x_2}{dt} = x_2 + 2$$
then substitute this into the first equation, i.e.
$$\frac{d x_1}{dt} = x_1 + x_2 + t$$
to get the solution of the problem as a whole. If you prefer to compute the homogeneous solution and then add in a particular solution to the inhomogeneous problem, you can do that instead, by essentially the same method.
Your mistake is that the matrix $A$ for this system is not diagonalizable: the eigenvalue $1$ has algebraic multiplicity $2$ and geometric multiplicity $1$, so you cannot rewrite $A$ as $P D P^{-1}$ for a diagonal matrix $D$. Instead, to do this with matrix methods, you need the Jordan normal form, which replaces the missing second eigenvector with a "generalized eigenvector". 
This particular matrix is actually already in Jordan form, so you need to compute $e^{At}$, just like you did for diagonal matrices. You do this with the power series expansion. It is not too hard to show that
$$A^k = \begin{bmatrix} 1 & k \\ 0 & 1 \end{bmatrix}$$
so 
$$e^{At} = \sum_{k=0}^\infty \begin{bmatrix} \frac{t^k}{k!} & \frac{k t^k}{k!} \\ 0 & \frac{t^k}{k!} \end{bmatrix} = \begin{bmatrix} e^t & t e^t \\ 0 & e^t \end{bmatrix}$$
Edit: in response to the comment below, let's solve the homogeneous equation. First we solve
$$\frac{d x_2}{dt} = x_2$$
This is easy enough: $x_2 = c_1 e^t$ is the general solution. Now we plug this into
$$\frac{d x_1}{dt} = x_1 + x_2 = x_1 + c_1 e^t$$
This is a first order linear inhomogeneous equation. We can solve it using an integrating factor:
$$e^{-t} \frac{d x_1}{dt} - e^{-t} x_1 = c_1 \\
\frac{d}{dt} \left ( e^{-t} x_1 \right ) = c_1 \\
e^{-t} x_1 = c_1 t + c_2 \\
x_1 = c_1 t e^{t} + c_2 e^t$$
So overall our homogeneous solution is
$$\begin{bmatrix} c_1 t e^t + c_2 e^t \\ c_1 e^t \end{bmatrix}$$
It remains to find a particular solution. For the second equation, $x_2 \equiv -2$ is a steady state solution. Substituting into the first: 
$$\frac{d x_1}{dt} = x_1 - 2 + t$$
This can be solved with undetermined coefficients: if $x_1 = k_1 t + k_2$ then the equation is $k_1 = k_1 t + k_2 - 2 + t$, so $k_1 = -1$ and $k_2 = 1$, i.e. $x_1 = 1-t$. Overall we get the solution
$$\begin{bmatrix} 1 - t + c_1 t e^t + c_2 e^t \\ -2 + c_1 e^t\end{bmatrix}$$
