Find a Jordan's matrix and basis I have a matrix: $A={\begin{bmatrix}3&-1&0&1\\0&3&4&4\\0&0&-5&-8\\0&0&4&7\end{bmatrix}}$.1) I calculate characteristic polynomial. It is: $p_{A}(\lambda)=(\lambda-3)^{3}(\lambda+1)$  2) So exist Jordan's matrix: $J={\begin{bmatrix}3&?&0&0\\0&3&?&0\\0&0&3&0\\0&0&0&-1\end{bmatrix}}$  3)I find own subspace:  $V_{3}=\ker(A-3I)=\dots= \operatorname{span}({\begin{bmatrix}1&0&0&0\end{bmatrix}}^{T},{\begin{bmatrix}0&1&-1&1\end{bmatrix}}^{T}$ $V_{-1}=\ker(A+I)=\dots= \operatorname{span}({\begin{bmatrix}0&1&-2&1\end{bmatrix}}^{T}$ 4) Jordan's matrix is: $J={\begin{bmatrix}3&0&0&0\\0&3&1&0\\0&0&3&0\\0&0&0&-1\end{bmatrix}}$
However I have a problem with a basis:  I read that in basis are vectors from span $V_{3}$ and $V_{-1}$ and the next I must find one more vector. So I can use my vectors from span and I have for example:${\begin{bmatrix}0&-1&0&1&|&1\\0&0&4&4&|&0\\0&0&-8&-8&|&0\\0&0&4&4&|&0\end{bmatrix}}$ and I have for example $(0,d-1,-d,d)^{T}$ and I change for example $d=5$ so my last vectors in basic is $(0,4,-5,5)^{T}$.Hovewer on my lectures we use vectors from image but I don't understand it and I am afraid that my sollution is not good. Can you help me?
 A: I'll write down an algorithm to find a basis with eigenvectors / generalized eigenvectors, when the wanted vector will be denoted by $\;w\;$ .
First, we must find out what the eigenvalues are. You already did that, they are $\;-1,3\;$, with the second one of geometric multiplicity $2$ . Now
$$(A-(-1)I)w=0\iff \begin{pmatrix}4&-1&0&1\\0&4&4&4\\0&0&-4&-8\\0&0&4&8\end{pmatrix}\begin{pmatrix}w_1\\w_2\\w_3\\w_4\end{pmatrix}=\begin{pmatrix}0\\0\\0\\0\end{pmatrix}\implies w_1=\begin{pmatrix}0\\1\\-2\\1\end{pmatrix}$$$${}$$
$$(A-3I)w=\begin{pmatrix}0\\0\\0\\0\end{pmatrix}\iff\begin{pmatrix}0&-1&0&1\\0&0&4&4\\0&0&-8&-8\\0&0&4&4\end{pmatrix}\begin{pmatrix}w_1\\w_2\\w_3\\w_4\end{pmatrix}=\begin{pmatrix}0\\0\\0\\0\end{pmatrix}\implies w_2=\begin{pmatrix}1\\0\\0\\0\end{pmatrix}\,,\,\,w_3=\begin{pmatrix}0\\1\\\!\!-1\\1\end{pmatrix}$$$${}$$
with $\;w_1,w_2,w_3\;$ eigenvectors of $\;\lambda=-1\;$ (the first one), and of $\;\lambda=3\;$ (the last two) .
We're missing one vector  for a basis for $\;\Bbb R^4\;$, and since there are only two linearly ind. eigenvectors of $\;3\;$ , we're going to calculate a generalized eigenvector of $\;3\;$ as follows:
$$(A-3I)w=w_2\;\text{or}\;w_3$$ (we only need one of these to work), so:
$$(A-3I)w=\begin{pmatrix}1\\0\\0\\0\end{pmatrix}=w_2\iff\begin{pmatrix}0&-1&0&1\\0&0&4&4\\0&0&-8&-8\\0&0&4&4\end{pmatrix}\begin{pmatrix}w_1\\w_2\\w_3\\w_4\end{pmatrix}=\begin{pmatrix}1\\0\\0\\0\end{pmatrix}\implies$$$${}$$
$$\begin{cases}-w_2+w_4=1\\
w_3=-w_4\end{cases}\;\;\implies w_4=\begin{pmatrix}0\\-1\\0\\0\end{pmatrix}$$
and we thus have a basis for $\;\Bbb R^4\;:\;\;\{w_1,w_2,w_3,w_4\}$
In this case is pretty easy to find out the JCF of $\;A\;$ , since $\;\dim V_3=2\implies\;$ there are two blocks for $\;\lambda=3\;$ , and thus the JCF (upt to similarity) of $\;A\;$ is 
$$J_A=\begin{pmatrix}3&1&0&0\\0&3&0&0\\0&0&3&0\\0&0&0&\!\!-1\end{pmatrix}$$
But ...If you want to get the above by similarity, take the basis $\;\{w_1,w_2,\color{red}{w_4},w_3\}\;$ and form with it the columns of matrix $\;P\;$ . Then you can check that $\;P^{-1}AP=J_A\;$ . The reason is that we "arrange" the basis with "close" vectors to each other. Thus, first the eigenvector $\;w_2\;$ and then the generalized eigenvector $\;w_4\;$ which was obtained with the help of $\;w_2\;$ , and at the end $\;w_3\;$ .
A: Let $v_1=(1,0,0,0)$ and let $v_2=(0,1,-1,1)$. Then both $v_1$ and $v_2$ are eigenvectors with eigenvalue $3$. Now, consider the equations $A.v=3v_1+v$ and $A.v=3v_2+v$. You can check that $v_3=(0,0,-1,1)$ is a solution of the first equation, whereas the second one has no solutions. So, if $v_4=(0,1-,2,1)$, then the basis that you're after is $\{v_2,v_1,v_3,v_4\}$.
