How to compute the change of basis matrix that conjugate a matrix to its Jordan canonical form Let's make an example: $$A=\left(\begin{array}{rrr} 1&1&1\\-1&-1&-1\\1&1&1\end{array}\right).$$ 
I calculated that the Jordan canonical form is $J=\begin{pmatrix}0&0&0\\0&0&0\\0&0&1\end{pmatrix}$. How can I find a matrix $P$ such that $P^{-1}AP=J$. Could you tell me also how can I find such a matrix in general? In the sense, if I have a matrix $A$ and its Jordan canonical form is $J$, then how can I find $P$ such that $P^{-1}AP=J$?
 A: You need to find a Jordan canonical basis: a basis with respect to which the linear transformation given by the matrix has Jordan canonical form. That basis determines the change-of-basis matrix that does the conjugate.
Here, because the Jordan canonical form is diagonal, you want to find two linearly independent vectors that are mapped to $0$ (i.e., a basis for the nullspace); here, it can be done by inspection: $(1,-1,0)^t$ and $(1,0,-1)^t$; and a vector that is mapped to itself. Normally you would look for the nullspace of $A-I$, but here you can again do it by inspection: $(1,-1,1)^t$.
Your matrix $P$ will have these vectors as its columns:
$$P = \left(\begin{array}{rrr}1&1&1\\
-1 & 0 & -1\\
0 & -1 & 1
\end{array}\right).$$
And $P^{-1}$ is the inverse of this matrix.
In the more general case that you have several blocks corresponding to the same eigenvalue, of different sizes, you look for the nullspaces of $A-\lambda I$, $(A-\lambda I)^2$, $(A-\lambda I)^3$, and so on. To get a Jordan block of size 3, you start with a vector $\mathbf{v}$ in the nullspace of $(A-\lambda I)^3$ but not in the nullspace of $(A-\lambda I)^2$, and your basis will consist of $(A-\lambda I)^2\mathbf{v}$, $(A-\lambda I)\mathbf{v}$, and $\mathbf{v}$.
This should all be covered in the same section that ddiscusses the Jordan canonical form in your textbook.
