Finding Jordan Basis for $A$ I've posted already too many questions on Jordan normal Form, but I keep getting stuck when finding the Jordan Basis (I have read from a lot of different sources, which caused my confusion)
Given a matrix $A$
\begin{bmatrix}
    5 & 0 & 1 & 0 & 0 \\
    0 & 1 & 0 & 0 & 0 \\
    -1 & 0 & 3 & 0 & 0 \\
    0 & 0 & 0 & 1 & 0 \\
    0 & 0 & 0 & 0 & 4
\end{bmatrix}
It has Eigenvalues $\lambda_{1} = 1$ with algebric multiplicity of $2$ and $\lambda_{4} = 4$ with algebric multiplicity of $3$.
I have calculated the Eigenspaces 
$$\text{Eig}(A;1) = \text{Span}\{(0,1,0,0,0), (0,0,0,1,0)\}$$
$$\text{Eig}(A;4) = \text{Span}\{(-1,0,1,0,0), (0,0,0,0,1)\}$$
$$\text{null}(A-4I)^2 = \text{Span}\{(0,0,1,0,0), (1,0,0,0,0), (0,0,0,0,1)\}$$
and the Jordan normal Form $J_{A}$
\begin{bmatrix}
    1 & 0 & 0 & 0 & 0 \\
    0 & 1 & 0 & 0 & 0 \\
    0 & 0 & 4 & 0 & 0 \\
    0 & 0 & 0 & 4 & 1 \\
    0 & 0 & 0 & 0 & 4
\end{bmatrix}
I need some help calculating the Basis to find $S$ such that $A = S^{-1}J_{A}S$. Thanks.
 A: From the condition 
$$A=SJ_AS^{-1}\implies AS=SJ_A$$
we obtain


*

*$Av_1=v_1\implies (A-I)v_1=0 \implies v_1=(0,0,0,1,0)$

*$Av_2=v_2\implies (A-I)v_2=0 \implies v_2=(0,1,0,0,0)$

*$Av_3=4v_3\implies (A-4I)v_3=0 \implies v_3=(0,0,0,0,1)$

*$Av_4=4v_4 \implies (A-4I)v_4=0 \implies v_4=(-1,0,1,0,0)$

*$Av_5=v_4+4v_5 \implies (A-4I)v_5=v_4 \implies v_5=(-1,0,0,0,0)$


indeed for the last we have
$$(A - 4I)v_5 = \begin{pmatrix} 1 & 0 & 1 & 0 & 0 \\ 0 & -3 & 0 & 0 & 0 \\ -1 & 0 & -1 & 0 & 0 \\ 0 & 0 & 0 & -3 & 0 \\ 0 & 0 & 0 & 0 & 0\end{pmatrix}v_5=\begin{pmatrix} -1\\0\\1\\0\\0\end{pmatrix}$$
A: As N8tron said, you need to solve $(A - 4I)x = v$ for $x$, where $v$ is some eigenvector corresponding to $4$. Unfortunately (and this is the thing that confuses many students) not just any eigenvector $v$ will work! You need to find a suitable eigenvector $v$ first.
As a motivational example, consider the Jordan matrix
$$M = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{pmatrix}.$$
The eigenspace corresponding to $1$ is
$$\operatorname{span}((1, 0, 0), (0, 1, 0)) = \operatorname{span}((1, 1, 0), (1, -1, 0)).$$
Note that the equation $(M - I)x = v$ has solutions when $v = (0, 1, 0)$, but not when $v = (1, 0, 0)$. Also, if we were unfortunate enough to choose the other basis, then neither choice of $v$ would be appropriate!
So what do we do? Well we need to choose a $v$ so that there is a solution. In particular, we need to ensure that $v \in \operatorname{Range}(A - 4I)$. But, of course, we also need to ensure that $v$ is an eigenvector still, so we need,
$$v \in \operatorname{Ker}(A - 4I) \cap \operatorname{Range}(A - 4I) \setminus \lbrace 0 \rbrace.$$
The fact that the multiplicites don't agree implies that this set will always be non-empty.
The range is simply the columnspace of the matrix. In our case, we have
$$A - 4I = \begin{pmatrix} 1 & 0 & 1 & 0 & 0 \\ 0 & -3 & 0 & 0 & 0 \\ -1 & 0 & -1 & 0 & 0 \\ 0 & 0 & 0 & -3 & 0 \\ 0 & 0 & 0 & 0 & 0\end{pmatrix}.$$
Removing obvious dependencies from the columns (and scaling just for prettiness) we get,
$$\operatorname{Range}(A - 4I) = \operatorname{span}((1, 0, -1, 0, 0), (0, 1, 0, 0, 0), (0, 0, 0, 1, 0))$$
There are a number of messy ways to intersect the range and the kernel (basically just force two arbitrary linear combinations of the two bases to be equal and solve for the coefficients; there should be a non-trivial solution), but fortunately, we have a common basis vector: $(1, 0, -1, 0, 0)$. This is our $v$.
Now, we have our system of equations, which has the augmented matrix
$$\begin{pmatrix} 1 & 0 & 1 & 0 & 0 & 1 \\ 0 & -3 & 0 & 0 & 0 & 0 \\ -1 & 0 & -1 & 0 & 0 & -1 \\ 0 & 0 & 0 & -3 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0\end{pmatrix}.$$
Row reducing, we get,
$$\begin{pmatrix} 1 & 0 & 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0\end{pmatrix},$$
leading to a parameterised system,
$$x = (s, 0, 1 - s, 0, t),$$
where $s, t$ range freely over the scalar field. Pick one such vector, e.g.
$$x = (1, 0, 0, 0, 0).$$
Now, build a basis of these vectors. Keep the vector $v$ we chose in the basis (in this case, $v = (1, 0, -1, 0, 0)$), followed by our $x$. The other basis vector is just the other basis vector(s) for $\operatorname{Eig}(A; 4)$, i.e.
$$B = ((1, 0, -1, 0, 0), (1, 0, 0, 0, 0), (0, 0, 0, 0, 1))$$
Putting the basis vectors in this order will produce a block on the diagonal in the following form:
$$\begin{pmatrix} 4 & 1 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 4 \end{pmatrix}.$$
Hope that helps!
