find the Jordan basis of a matrix I'm trying to find the Jordan basis of the matrix $$A =\begin{bmatrix} 8 & 1 & 2 \\ -3 & 4 & -2\\ -3 & -1 & 3\end{bmatrix}$$ I've got the characteristic equation to be $CA(x) = (5-x)^3$ and hence the eigenvalue to be $5$. I started by finding $v_1$ such that $(A-5I)v_1=0$ and chose $v_1 = \begin{bmatrix} 1 \\ -3 \\ 0\end{bmatrix}$. I then tried to find a $v_2$ such that $(A-5I)^2v_2 = 0$ but $(A-5I)^2$ is the zero matrix so can $v_2$ be any vector in $\mathbb{R}^3$?
More generally, when trying to find a Jordan basis for a matrix $A$, what do you do when $(A-\lambda I)^i=0$ for some $i$? Also what do you do when there is no solution to $(A-\lambda I)^iv_i = 0$ for a particular $i$?
 A: If the minimal polynomial is $(\lambda -5)^2,$ you may, indeed, pick any column vector $w$ you like that is not already an eigenvector, make it the right hand column of $P. \; $ The rule is that the middle column must be $v = (A-5I) w.$ The left column of $P$ is then $u,$ a different eigenvector from $v.$ Sometimes it takes a little ingenuity to take the pair of eigenvectors you first calculated and revise to get $u.$
Then, with matrix $P,$ you get $J = P^{-1}AP.$
Try it. 
A: First take some $v \in \mathbb{C}^3$ such that $(A-5I)v \ne 0$, for example take $v = e_2$. Then calculate $$(A-5I)v = \begin{bmatrix} 1 \\ -1 \\ -1\end{bmatrix}$$ and find some $w \in \ker (A-5I)$ which is linearly independent with $(A-5I)v$. For example we can take the vector you already found: $$w = \begin{bmatrix} 1 \\ -3 \\ 0\end{bmatrix}$$
Then the Jordan basis is $\{(A-5I)v, v, w\} = \left\{\begin{bmatrix} 1 \\ -1 \\ -1\end{bmatrix}, \begin{bmatrix} 0 \\ 1 \\ 0\end{bmatrix}, \begin{bmatrix} 1 \\ -3 \\ 0\end{bmatrix}\right\}$.
A: The eigenspace $E_5$ has dimension $2$ (so the Jordan form of the matrix will have $2$ Jordan blocks) since 
$$A-5I=\begin{bmatrix}
3&1&2\\-3&-1&-2\\-3&-1&-2\end{bmatrix}
$$
and it is defined by the single equation $\;3x+y+2z=0$. 
You should attack the problem backwards: begin with choosing a vector $v_3=(x,y,z)$, 
 in $\ker(A-5I)^2\smallsetminus E_5=\mathbf R^3\smallsetminus E_5$, i.e. such that
$$3x+y+2z\ne 0,\enspace \text{say }\enspace v_3=(1,0,-1),$$
and set $\;(A-5I)v_3=v_2=(1,-1,-1)$ ; $v_2$ belongs to the eigenspace $E_5$. 
Last  you have to complete $v_2$ with another vector $v_1$ in the eigenspace which is linearly independent from $v_2$. The vector you've found – $v_1=(1,-3,0)$ is fine. In the basis $\mathcal B=(v_1,v_2,v_3)$ the matrix of $A$ becomes by construction:
$$J=\begin{bmatrix}
5&0&0\\0&5&1\\0&0&5\end{bmatrix}. $$
