<s>[INST] Decompose initial value problem into semi-simple and nilpotent matrices Consider the initial value problem:
$\begin{pmatrix} 
\dot x(t)  \\
\dot y(t) \\ 
\dot z(t) 
\end{pmatrix}= A \vec x(t) = \begin{pmatrix} 
-1 & 1 & 1 \\
0 & -1 & 4 \\ 
0 & 0 & 1
\end{pmatrix}\begin{pmatrix} 
x(t)  \\
y(t) \\ 
z(t) 
\end{pmatrix},  \: \: \: \begin{pmatrix} 
x(0)  \\
y(0) \\ 
z(0) 
\end{pmatrix}=\begin{pmatrix} 
x_0  \\
y_0 \\ 
z_0 
\end{pmatrix}$ 

(i) Determine the eigenvalues and generalised eigenvectors of $A$.
(ii) Decompose $A$ into a semisimple matrix $S$ and a nipotent matrix $N$ such that $A=S+N$.
(a) first determine the semisimple part $S$ of $A$.
(b) then determine the nilpotent part $N$ of $A$ and show that $N^2=0$.

My attempt:
Since $A$ is an upper triangular matrix we have eigenvalues $\lambda=\{-1,-1,1\}$
Taking $\lambda_3=1, (A-\lambda I)v=\begin{pmatrix} 
-2 & 1 & 1 \\
0 & -2 & 4 \\ 
0 & 0 & 0
\end{pmatrix}\begin{pmatrix} 
x  \\
y \\ 
z 
\end{pmatrix}=\begin{pmatrix} 
0  \\
0 \\ 
0 
\end{pmatrix}$
So $-2y+4z=0$ and $-2x+y+z=0$
and I've ended up with eigenvector $v_3=(3,4,2)^T$
I get the feeling this is wrong because I tried the rest of the question and don't get $N^2=0$
Any help?
 [/INST] Consider the initial value problem:
$$\vec x'(t)  = A \vec x= \begin{pmatrix} 
-1 & 1 & 1 \\
0 & -1 & 4 \\ 
0 & 0 & 1
\end{pmatrix}\begin{pmatrix} 
x  \\
y \\ 
z 
\end{pmatrix}, ~~~~\vec x(0)  =\begin{pmatrix} 
x_0  \\
y_0 \\ 
z_0 
\end{pmatrix}$$ 
Since $A$ is upper triangular, the two eigenvalues can be read off the main diagonal as $\lambda_{1,2} = -1, 1$. 
$\lambda_1 = -1$ has multiplicity $n_1 = 2$ and $\lambda_2 = 1$ has multiplicity $n_2 = 1$.
The generalized eigenspace associated with $\lambda_1$ is $E_1 = \ker(A - \lambda_1I)^2 = \ker(A + I)^2$. Find
$$(A + I)^2 = \begin{pmatrix}
 0 & 0 & 6 \\
 0 & 0 & 8 \\
 0 & 0 & 4 \\
\end{pmatrix}$$
A choice for generalized eigenvectors spanning $E_1$ is $v_1 = (1,0,0)^T$ and $v_2 = (0,1,0)^T$.
The generalized eigenspace associated with $\lambda_2$ is $E_2 = \ker(A-I)$. Find
$$(A - I) = \begin{pmatrix}
 -2 & 1 & 1 \\
 0 & -2 & 4 \\
 0 & 0 & 0 \\
\end{pmatrix}$$
Let $v_3 = (3, 4, 2)^T$. The transformation matrix is
$$P = (~v_1~|~v_2~|~v_3~) = \begin{pmatrix}
 1 & 0 & 3 \\
 0 & 1 & 4 \\
 0 & 0 & 2 \\
\end{pmatrix} ~\mbox{and}~ P^{-1} = \begin{pmatrix}
 1 & 0 & -\dfrac{3}{2} \\
 0 & 1 & -2 \\
 0 & 0 & \dfrac{1}{2} \\
\end{pmatrix}$$
We are now ready to find $S$ and $N$ using $A = S + N$. 
$$S = P\Lambda P^{-1}, ~\mbox{where}~\Lambda = \mbox{diag}(-1,-1,1)$$
Obtain $S = \begin{pmatrix}
 -1 & 0 & 3 \\
 0 & -1 & 4 \\
 0 & 0 & 1 \\
\end{pmatrix}$ and $N = A - S = \begin{pmatrix}
 0 & 1 & -2 \\
 0 & 0 & 0 \\
 0 & 0 & 0 \\
\end{pmatrix}$. It's easy to verify that $N^2 = 0$.
The matrix exponential is given by $$e^{tA} = e^{t(S+N)} = e^{tS}e^{tN} = Pe^{t\Lambda}P^{-1} \sum_{k=0}^{m-1}\dfrac{{tN}^k}{k!}$$
Since $N^2$ yields a zero vector, all the higher terms in the matrix exponential will be zero. We have $e^{t\Lambda} = \mbox{diag}(e^{-t},e^{-t},e^t)$ and  
$$e^{t A} = e^{t(S+N)} = e^{tS}e^{tN} = P e^{t \Lambda}P^{-1}(I + t N) = \begin{pmatrix}
 e^{-t} & t e^{-t} & -2 t e^{-t}+\dfrac{3 e^t}{2}-\dfrac{3 e^{-t}}{2} ~~\\
 0 & e^{-t} & -2 e^{-t}+2 e^t ~~\\
 0 & 0 & e^t \\
\end{pmatrix}$$
The solution of the initial value problem is 
$$x(t) = e^{t A} x_0$$
</s>