Put a matrix $A$ in Jordan Normal Form and find a $P$ such that $P^{-1}AP=J$ I have a linear algebra exam tomorrow and this is a frequent question.
$A= 
\begin{pmatrix} 4 & 0 & 1 & 0 \\ 2 & 2 & 3 & 0 \\ -1 & 0 & 2 & 0 \\ 4 & 0 & 1 & 2
\end{pmatrix}$
$C_T(x)=(x-2)^2(x-3)^2$ so eigenvalues are $2$ and $3$.
$a_2=2$ so the sum of the sizes of Jordan blocks for eigenvalue $2$ equals $2=1+1$
$a_3=2$ so the sum of the sizes of Jordan blocks for eigenvalue $3$ equals $2=1+1$
$\\$
$g_2=dimE_2=dim \ ker \ (A-2I)$
$A-2I = \begin{pmatrix} 2 & 0 & 1 & 0 \\ 2 & 0 & 3 & 0 \\ -1 & 0 & 0 & 0 \\ 4 & 0 & 1 & 0 \end{pmatrix}$
$ker(A-2I) = \left\{ \begin{pmatrix} 0 \\ y \\ 0 \\ t \end{pmatrix} |\ y,t \in \mathbb{R} \right\} = Span \left\{ \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0 \end{pmatrix},\begin{pmatrix} 0\\0\\0\\1 \end{pmatrix} \right\}$
Therefore $g_2=2$. So there are 2 Jordan blocks, and they must both be of size $1$.
I put this in Jordan Normal form and got:
$\\$ $\\$
$J = \begin{pmatrix} 3 & 1 & 0 & 0 \\ 0 & 3 & 0 & 0 \\ 0 & 0 & 2 & 0 \\ 0 & 0 & 0 & 2
\end{pmatrix}$
How do I find an invertible matrix $P$ such that $P^{-1}AP=J$?
I found the Jordan Normal Form using geometric and algebraic multiplicities along with the minimum polynomial, if that helps at all!
Thanks!
 A: The columns of $P$ are a basis of $\mathbb R^n$ consisting of the eigenvectors and generalized eigenvectors of $A$.
When you don't have nontrivial blocks, things are straightforward. For example, the eigenvectors of $\lambda=2$ in your case are just a basis of the null space of $A-2I$.
In general, when you have a complicated block structure for some eigenvalue $\lambda$, its eigenvalues and eigenvectors are divided up into "chains" that might look something like
$$
    0 \xleftarrow{A-\lambda I} v_1 \xleftarrow{A-\lambda I} v_2 \xleftarrow{A-\lambda I} v_3 \\
    0 \xleftarrow{A-\lambda I} v_4 \xleftarrow{A-\lambda I} v_5 \phantom{\xleftarrow{A-\lambda I} v_n} \\
    0 \xleftarrow{A-\lambda I} v_6 \xleftarrow{A-\lambda I} v_7 \phantom{\xleftarrow{A-\lambda I} v_n} \\
$$
Here, $v_1, v_4, v_6$ are eigenvectors and the rest are generalized eigenvectors. The block structure for $\lambda$ consist of a block of size $3$ and two blocks of size $2$. The vectors $v_1, v_2, \dots, v_7$ are going to be the columns of $P$ that we want to find.
It would be a mistake to try to find $v_1, v_4, v_6$ first because most choices of basis for the null space of $A - \lambda I$ don't extend to full-length chains. For example, jf we accidentally chose the basis consisting of $v_1 + v_4, v_4, v_6$, none of them would be part of a chain of length $3$.
So instead, we go from the other end: we try to find $v_3$ first. To do this, we find a basis for the null space of $(A-\lambda I)^3$ (which is the same as the subspace spanned by the yet-unknown $\{v_1, v_2, \dots, v_7\}$), then let $v_3$ be a vector in that basis which does not go to $0$ when you multiply it by $(A-\lambda I)^2$. Then let $v_2 = (A-\lambda I)v_3$ and $v_1 = (A-\lambda I)v_2$.
Next, we do the same thing to find where the other two chains begin. We find a basis for the null space of $(A-\lambda I)^2$ extending the partial basis $\{v_1, v_2\}$, and let $v_5$ and $v_7$ be two more vectors in that basis which do not go to $0$ when multiplied by $A-\lambda I$. Then $v_4$ can be $(A-\lambda I)v_5$ and $v_6 = (A-\lambda I)v_7$.
In this case, we're done, because we've found all of $v_1, v_2, \dots, v_7$ (which then become the corresponding columns of $P$). In general, we would repeat this process with smaller and smaller powers of $(A-\lambda I)$ until we've run out of chains.
To do all this, we already have to know the block structure, so that we know how many chains of each length we're looking for. 
In your example, this process is much less onerous; $\lambda=3$ only has one chain of length $2$, so we find a basis for the null space of $(A-3I)^2$, let $v_2$ be any vector which is not in the null space of $A-3I$, and let $v_1 = (A-3I)v_2$.
A: The left two columns are just a basis of 2 eigenvectors. For 3, we take the far right vector as some $w$ such that $(A-3I)^2 w = 0 $ but $(A-3I) w \neq 0. $ Then the third column is $v = (A - 3I)w.$
$$
P =
\left(
\begin{array}{rrrr}
0 & 0 & 1&1 \\
1&0&-1&3 \\
0& 0 & -1& 0 \\
0&1&3&1
\end{array}
\right)
$$
determinant is $-1$ and
$$
P^{-1} =
\left(
\begin{array}{rrrr}
-3 & 1 & -4&0 \\
-1&0&2&1 \\
0& 0 & -1& 0 \\
1&0&1&0
\end{array}
\right)
$$
