$ \newcommand{\m}[1]{\left( \begin{matrix} #1 \end{matrix} \right)} \newcommand{\l}{\lambda} $ I have the matrix given as follows:
$$A := \m{ -2 & -1 & 1 & 2 \\ 1 & -4 & 1 & 2 \\ 0 & 0 & -5 & 4 \\ 0 & 0 & -1 & -1 }$$
I wish to determine the Jordan decomposition for $A$. So far I have determined the following:
$A$ has characteristic polynomial $p(\l) = -(\l+3)^4$. (Wolfram agrees up to that leading coefficient which isn't relevant.) Thus, it has a single eigenvalue, $\l = -3$, with multiplicity $4$.
The matrix $A+3I$ has nullity $2$. Thus the algebraic and geometric multiplicities of $3$ differ, making it not diagonalizable in the traditional sense. (Wolfram agrees.)
I have found that there exist two ordinary eigenvectors for $A$, i.e. vectors $\vec p$ such that $(A+3I)\vec p = \vec 0$. Namely, the following: $$v = (-4,0,2,1) \qquad w = (1,1,0,0)$$ (Wolfram agrees with this being the basis of the null space.)
I still need two generalized eigenvectors to fill my roster. So let's start with squaring $A+3I$. In such a case, there is a single vector, by my eyes, which fits. Using the alternate characterization of generalizing a specific eigenvector, e.g. finding $v'$ such that $(A+3I)v' = v$ (or $w$), we can see that $v$ won't work in this way, but if we do it for $w$ we can obtain $$w' = (1,0,0,0)$$ Wolfram does list this in the basis of the null space of $(A+3I)^2$. There isn't an issue picking $w'$ this way so far as far as I know: Wolfram agrees that the three are linearly independent. Thus, this is the only additional eigenvector we get from $(A+3I)^2$.
To find a fourth (generalized) eigenvector, $w''$, we will note that $(A+3I)^3$ is the zero matrix and thus has null space of $\Bbb R^4$. (Again, Wolfram agrees.) Thus, we can pick any vector we please that is linearly independent from the rest. As it happens, $w'' = (0,0,1,1)$ is such a vector. (Again, Wolfram agrees.)
From the structure of this problem, we see two Jordan chains: $$v \qquad w \to w' \to w''$$ Thus, the Jordan form $J$ of $A$ should have one $1 \times 1$ block and one $3 \times 3$ block, each associated with $\l = -3$. Thus, we will have $$J = \m{ -3 & 0 & 0 & 0\\ 0 & -3 & 1 & 0 \\ 0 & 0 & -3 & 1 \\ 0 & 0 & 0 & -3 }$$
Thus, we have our four eigenvectors to form the matrix $P$ such that $A = PJP^{-1}$. $$P := \big[ \; v \; \big| \; w \; \big| \; w' \; \big| \; w'' \; \big] = \m{ -4 & 1 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 2 & 0 & 0 & 1 \\ 1 & 0 & 0 & 1}$$
This is where I get confused. Performing the calculation of $PJP^{-1}$ does not give me quite $A$ back. Per Wolfram,
$$PJP^{-1} = \m{ -2 & -1 & 3 & -2 \\ 1 & -4 & 4 & -4 \\ 0 & 0 & -3 & 0 \\ 0 & 0 & 0 & -3}$$
yet I'm not entirely sure where I've gone wrong. I've been trying to resolve this discrepancy for days with no luck, no matter what I look up. In fact, Wolfram gives a very different decomposition: namely, they claim
$$P = \m{1/4 & 8 & 2 & 0\\ 5/4 & 8 & 2 & 0\\ 1/2 & 0 & 4 & 0\\ 1/4 & 0 & 2 & 1}$$
but at least we agree on $J$...
Can anyone enlighten me as to what I might have done wrong?