# Finding rational canonical form for matrices

Consider the following matrices:

$$A=\begin{bmatrix}2&-2&14 \\ 0&3&-7\\0&0&2\end{bmatrix} \text{ and } B=\begin{bmatrix}0&-4&85 \\ 1&4&-30\\0&0&3\end{bmatrix}.$$ They share the characteristic polynomial $(x-2)^2(x-3)=x^3-7x^2+16x-12$. The minimal polynomial of $A$ is $(x-2)(x-3)$ whereas that of $B$ is $(x-2)^2(x-3)$. Dummit and Foote claim that the corresponding rational canonical forms are respectively $$A'=\begin{bmatrix}2&0&0 \\ 0&0&-6\\0&1&5\end{bmatrix} \text{ and } B'=\begin{bmatrix}0&0&12 \\ 1&0&-16\\0&1&7\end{bmatrix}.$$

First of all, why is $A'$ in the rational canonical form? Shouldn't the first column be $[0,1,0]^t$? Second, is there an easy way to obtain these rational canonical forms? Dummit and Foote certainly give (at first glance quite lengthy) algorithm of getting the form in the general case, but don't say a word about its application in this particular example. (Just in case a disclaimer: I don't follow Dummit and Foote in my study, I follow Artin, and DF just happened to have an example I'm interested in.)

For $A$, the invariant factors are $x-2$ which has a companion matrix $\begin{bmatrix}2\end{bmatrix}$ and $(x-2)(x-3)=x^2-5x+6$ which has a companion matrix $\begin{bmatrix}0&-6\\1&5\end{bmatrix}$. So the rational canonical form of $A$ is $\begin{bmatrix} \begin{bmatrix}2\end{bmatrix} &&\\ & \begin{bmatrix}0&-6\\1&5\end{bmatrix} \end{bmatrix}$ (I typed it this way to emphasize the block matricies).
For $B$, the invariant factors consist of only the characteristic polynomial which has a companion matrix $\begin{bmatrix}0&0&12 \\ 1&0&-16\\0&1&7\end{bmatrix}$ which is the rational canonical form of $B$.
• Oh, I see that if you reorder the blocks in $A'$ then the first column will be as you said. That matrix will still be similar to $A$ – Jonathan Dunay Apr 7 '18 at 18:05