Finding Jordan Canonical form but equation for finding the generalized eigenvector becomes inconsistent I have been given a problem to find the Jordan Canonical form of the following $ 3 \times 3 $ matrix
$$ A=
\begin{bmatrix} 
3 & 0 & 1 \\
-4 & 1 & -2 \\
-4 & 0 & -1 
\end{bmatrix}
$$
I have been told to do this using the transformation matrix way, wherein $A$ can be written as
$$
A = TJT^{-1}
$$
where $T$ is the modal matrix analogue which contains the eigenvectors and/or the generalized eigenvectors as columns and $J$ is Jordan Canonical form of A. Doing some matrix operations on the above equation, $J$ can be obtained as
$$
J = T^{-1}AT
$$
Coming back to the problem, I have found the characteristic equation and got all three eigenvalues as $1$. I found eigenvectors by
$$
Ax_1 = \lambda x_1
$$
Solving this I got two linearly independent eigenvectors, since I was getting only 1 pivot after row transformation operations on $A$ the above equation must give me two solutions. I got these
$$
x_1 = \begin{bmatrix}
0 \\ 1 \\ 0
\end{bmatrix}, \begin{bmatrix}
1 \\ 0 \\ -2
\end{bmatrix}
$$
For the next step, according to my textbook, I should get a generalized eigenvector by solving for $x_2$
$$
Ax_2 = \lambda x_2 + x_1
$$
The textbook example only shows one possible value for $x_1$, so clearly I've got a problem regarding which one of the two eigenvectors I got, should be chosen for the next step.
But even without considering that, I have yet another problem
$$
Ax_2 = \lambda x_2 + x_1 \\
(A - \lambda I)x_2 = x_1
$$
If I find out the matrix $A - \lambda I = A - I$, I get
$$
\begin{bmatrix}
2 & 0 & 1\\
-4 & 0 & -2\\
-4 & 0 & -2
\end{bmatrix}
$$
which forms an inconsistent set of equations to solve, because of the repeated row but different values in the rows of (either) $x_1$. So I can't proceed further to get $x_2$.
Have I done something wrong, or is there some pre-condition to be checked on $A$ that I missed?
 A: You need to choose an eigenvector that is also in the column space of the matrix $A-\lambda I$. In this case, by looking at the matrix you have and at your eigenvector basis, one sees that an eigenvector that will work is $\begin{bmatrix}1\\0\\-2\end{bmatrix}-2\begin{bmatrix}0\\1\\0\end{bmatrix}=\begin{bmatrix}1\\-2\\-2\end{bmatrix}$.
Hence, you have two eigenvectors $ v_1=\begin{bmatrix}1\\0\\-2\end{bmatrix}$ and $v_2 = \begin{bmatrix}1\\-2\\-2\end{bmatrix}$. Define $v_3 = \begin{bmatrix}0\\0\\1\end{bmatrix}$ and note that $(A-I)v_3 =v_2$. Now using $T=[v_1,v_2,v_3]$ we will get the Jordan form.
Note that if we just wanted the Jordan form $J$, without caring about what T is, then it is sufficient to know that A has $2$ eigenvectors. For then, as A is a $3\times3$ matrix the only possibility for the matrix $T$ is that it contains $2$ eigenvectors and one generalized eigenvector, which is mapped to one of the eigenvectors under $A-I$. Hence, we will get two Jordan blocks, one of size $1\times 1$ and one of size $2\times 2$. So up to ordering of the blocks $J=\begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 1\end{bmatrix}$.
A: I like the backwards method: choose the generalized eigenvector(s) with integer elements and see what is forced. Since   $A-I$ gives two genuine eigenvectors, we hold off on that... The minimal polynomial gives the size of the largest Jordan block (always!).  That is, $(A- I)^2 = 0, $  so we look for any nice looking vector for which $(A-I)^2 w = 0$ but $(A-I) w \neq 0.$  I like $w=(0,0,1)^T$
Next we are forced to use $v= (A-I)w = (1,-2,-2)^T.$ A genuine eigenvector that is independent of $v$ could be $u = (0,1,0)^T$
The resulting matrix, your $T,$ is those three as columns in order $u,v,w$
This method allows us to force $T$ to have all integers, with the likelihood of some rational entries in $T^{-1}$ because $\det T$ is most likely not $\pm 1$
Alright, they set this one up with determinant $-1.$
$$
T=
\left(
\begin{array}{rrr}
0&1&0 \\
1&-2&0 \\
0&-2&1 \\
\end{array}
\right)
$$
$$
T^{-1}=
\left(
\begin{array}{rrr}
2&1&0 \\
1&0&0 \\
2&0&1 \\
\end{array}
\right)
$$
