Monthly Archives: November 2011

Prove that two matrices are similar

Let A = \begin{bmatrix} 2 & 0 & 0 & 0 \\ -4 & -1 & -4 & 0 \\ 2 & 1 & 3 & 0 \\ -2 & 4 & 9 & 1 \end{bmatrix} and B = \begin{bmatrix} 5 & 0 & -4 & -7 \\ 3 & -8 & 15 & -13 \\ 2 & -4 & 7 & -7 \\ 1 & 2 & -5 & 1 \end{bmatrix}. Prove that A and B are similar.


Let P = \begin{bmatrix} 0 & 0 & 0 & 1 \\ -2 & 4 & 9 & 0 \\ 0 & 1 & 2 & 0 \\ 1 & 0 & 0 & 0 \end{bmatrix} and Q = \begin{bmatrix} 0 & 2 & -3 & 2 \\ 2 & -2 & 2 & -5 \\ 1 & 0 & -1 & -2 \\ 0 & 1 & -2 & 1 \end{bmatrix}. Evidently, P^{-1}AP = Q^{-1}BQ = \begin{bmatrix} 1 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 2 \end{bmatrix}. In particular, A and B are similar.

(Computations performed with WolframAlpha; see here and here.)

Compute the Jordan canonical form of a given matrix

Compute the Jordan canonical form of the matrix A = \begin{bmatrix} 3 & 0 & -2 & -3 \\ 4 & -8 & 14 & -15 \\ 2 & -4 & 7 & -7 \\ 0 & 2 & -4 & 3 \end{bmatrix}. (Over \mathbb{Q}.)


Let P = \begin{bmatrix} 0 & -1 & 2 & -1/2 \\ 0 & 2 & -3 & 2 \\ 2 & -2 & 2 & -5 \\ 0 & 1 & -2 & 1 \end{bmatrix}. Evidently, P^{-1}AP = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 2 \end{bmatrix} is in Jordan canonical form. (Computations performed with WolframAlpha; see here.)

Compute the Jordan canonical form of a given matrix

Let A = \begin{bmatrix} 1 & 2 & 0 & 0 \\ 0 & 1 & 2 & 0 \\ 0 & 0 & 1 & 2 \\ 0 & 0 & 0 & 1 \end{bmatrix}. Find the Jordan canonical form for A.


Clearly the characteristic polynomial of A is (x-1)^4, which factors completely over any field. Certainly A does not satisfy x-1 = 0, and a quick computation verifies that A does not satisfy (x-1)^2 = 0 or (x-1)^3 = 0. So the minimal polynomial of A is (x-1)^4, and thus the Jordan canonical form is \begin{bmatrix} 1 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 1 \end{bmatrix}.

Compute the Jordan and rational canonical forms of a given matrix over QQ

Let A = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ -2 & -2 & 0 & 1 \\ -2 & 0 & -1 & -2 \end{bmatrix}. Compute the Jordan and rational canonical forms of A over \mathbb{Q}.


Let P = \dfrac{1}{4} \begin{bmatrix} 0 & -2 & 0 & 4 \\ -8 & -4 & -4 & -4 \\ 0 & 1 & 0 & 0 \\ -1 & -3 & 0 & 0 \end{bmatrix}. Evidently, P^{-1}AP = \begin{bmatrix} -1 & 1 & 0 & 0 \\ 0 & -1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} is in Jordan canonical form. Thus the elementary divisors of A are (x+1)^2, x-1, and x-1, so that the invariant factors of A are (x+1)^2(x-1) and x-1. So the rational canonical form of A is \begin{bmatrix} 0 & 0 & 1 & 0 \\ 1 & 0 & 1 & 0 \\ 0 & 1 & -1 & 0 \\ 0 & 0 & 0 & -1 \end{bmatrix}. (Computations carried out by WolframAlpha; see here.)

Find the possible Jordan canonical forms of matrices of dimension 2, 3, or 4 over CC

Find all the possible Jordan canonical forms of matrices of dimension 2, 3, or 4 over \mathbb{C}.


We begin by finding the possible lists of invariant factors, starting with the possible minimal polynomials. Recall that every polynomial of degree at least 1 over \mathbb{C} has a root in \mathbb{C}, so that every polynomial is a product of linear factors.

If A has dimension 2, then the characteristic polynomial of A has degree 2 and thus the minimal polynomial has degree at most 2. The possible minimal polynomials are thus x-\alpha, (x-\alpha)^2, and (x-\alpha)(x-\beta). In this case, with the minimal polynomial chosen the remaining invariant factors are determined. So the possible lists of invariant factors are as follows.

  1. x-\alpha, x-\alpha
  2. (x-\alpha)^2
  3. (x-\alpha)(x-\beta)

The corresponding lists of elementary divisors are as follows.

  1. x-\alpha, x-\alpha
  2. (x-\alpha)^2
  3. x-\alpha, x-\beta

And so the possible Jordan canonical forms are as follows.

  1. \begin{bmatrix} \alpha & 0 \\ 0 & \alpha \end{bmatrix}
  2. \begin{bmatrix} \alpha & 1 \\ 0 & \alpha \end{bmatrix}
  3. \begin{bmatrix} \alpha & 0 \\ 0 & \beta \end{bmatrix}

Again, if A has dimension 3, we can construct all the possible minimal polynomials, and in each case the remaining invariant factors are determined (in one case, without loss of generality). The possible lists of invariant factors are as follows.

  1. x-\alpha, x-\alpha, x-\alpha
  2. (x-\alpha)^2, x-\alpha
  3. (x-\alpha)^3
  4. (x-\alpha)(x-\beta), x-\alpha
  5. (x-\alpha)^2(x-\beta)
  6. (x-\alpha)(x-\beta)(x-\gamma)

The possible lists of elementary divisors are as follows.

  1. x-\alpha, x-\alpha, x-\alpha
  2. (x-\alpha)^2, x-\alpha
  3. (x-\alpha)^3
  4. x-\alpha, x-\beta, x-\alpha
  5. (x-\alpha)^2, x-\beta
  6. x-\alpha, x-\beta, x-\gamma

The possible Jordan canonical forms are then as follows.

  1. \begin{bmatrix} \alpha & 0 & 0 \\ 0 & \alpha & 0 \\ 0 & 0 & \alpha \end{bmatrix}
  2. \begin{bmatrix} \alpha & 1 & 0 \\ 0 & \alpha & 0 \\ 0 & 0 & \alpha \end{bmatrix}
  3. \begin{bmatrix} \alpha & 1 & 0 \\ 0 & \alpha & 1 \\ 0 & 0 & \alpha \end{bmatrix}
  4. \begin{bmatrix} \alpha & 0 & 0 \\ 0 & \beta & 0 \\ 0 & 0 & \alpha \end{bmatrix}
  5. \begin{bmatrix} \alpha & 1 & 0 \\ 0 & \alpha & 0 \\ 0 & 0 & \beta \end{bmatrix}
  6. \begin{bmatrix} \alpha & 0 & 0 \\ 0 & \beta & 0 \\ 0 & 0 & \gamma \end{bmatrix}

If A has degree 4, evidently there are 11 possible minimal polynomials and 14 possible lists of invariant factors (in some cases, without loss of generality due to symmetry). The possible lists of invariant factors are as follows.

  1. x-\alpha, x-\alpha, x-\alpha, x-\alpha
  2. (x-\alpha)^2, (x-\alpha)^2
  3. (x-\alpha)^2, x-\alpha, x-\alpha
  4. (x-\alpha)(x-\beta), (x-\alpha)(x-\beta)
  5. (x-\alpha)(x-\beta), x-\alpha, x-\alpha
  6. (x-\alpha)^3, x-\alpha
  7. (x-\alpha)^2(x-\beta), x-\alpha
  8. (x-\alpha)^2(x-\beta), x-\beta
  9. (x-\alpha)(x-\beta)(x-\gamma), x-\alpha
  10. (x-\alpha)^4
  11. (x-\alpha)^3(x-\beta)
  12. (x-\alpha)^2(x-\beta)^2
  13. (x-\alpha)^2(x-\beta)(x-\gamma)
  14. (x-\alpha)(x-\beta)(x-\gamma)(x-\delta)

The possible lists of elementary divisors are as follows.

  1. x-\alpha, x-\alpha, x-\alpha, x-\alpha
  2. (x-\alpha)^2, (x-\alpha)^2
  3. (x-\alpha)^2, x-\alpha, x-\alpha
  4. x-\alpha, x-\beta, x-\alpha, x-\beta
  5. x-\alpha, x-\beta, x-\alpha, x-\alpha
  6. (x-\alpha)^3, x-\alpha
  7. (x-\alpha)^2, x-\beta, x-\alpha
  8. (x-\alpha)^2, x-\beta, x-\beta
  9. x-\alpha, x-\beta, x-\gamma, x-\alpha
  10. (x-\alpha)^4
  11. (x-\alpha)^3, x-\beta
  12. (x-\alpha)^2, (x-\beta)^2
  13. (x-\alpha)^2, x-\beta, x-\gamma
  14. x-\alpha, x-\beta, x-\gamma, x-\delta

The corresponding Jordan canonical forms are as follows.

  1. \begin{bmatrix} \alpha & 0 & 0 & 0 \\ 0 & \alpha & 0 & 0 \\ 0 & 0 & \alpha & 0 \\ 0 & 0 & 0 & \alpha \end{bmatrix}
  2. \begin{bmatrix} \alpha & 1 & 0 & 0 \\ 0 & \alpha & 0 & 0 \\ 0 & 0 & \alpha & 1 \\ 0 & 0 & 0 & \alpha \end{bmatrix}
  3. \begin{bmatrix} \alpha & 1 & 0 & 0 \\ 0 & \alpha & 0 & 0 \\ 0 & 0 & \alpha & 0 \\ 0 & 0 & 0 & \alpha \end{bmatrix}
  4. \begin{bmatrix} \alpha & 0 & 0 & 0 \\ 0 & \beta & 0 & 0 \\ 0 & 0 & \alpha & 0 \\ 0 & 0 & 0 & \beta \end{bmatrix}
  5. \begin{bmatrix} \alpha & 0 & 0 & 0 \\ 0 & \beta & 0 & 0 \\ 0 & 0 & \alpha & 0 \\ 0 & 0 & 0 & \alpha \end{bmatrix}
  6. \begin{bmatrix} \alpha & 1 & 0 & 0 \\ 0 & \alpha & 1 & 0 \\ 0 & 0 & \alpha & 0 \\ 0 & 0 & 0 & \alpha \end{bmatrix}
  7. \begin{bmatrix} \alpha & 1 & 0 & 0 \\ 0 & \alpha & 0 & 0 \\ 0 & 0 & \beta & 0 \\ 0 & 0 & 0 & \alpha \end{bmatrix}
  8. \begin{bmatrix} \alpha & 1 & 0 & 0 \\ 0 & \alpha & 0 & 0 \\ 0 & 0 & \beta & 0 \\ 0 & 0 & 0 & \beta \end{bmatrix}
  9. \begin{bmatrix} \alpha & 0 & 0 & 0 \\ 0 & \beta & 0 & 0 \\ 0 & 0 & \gamma & 0 \\ 0 & 0 & 0 & \alpha \end{bmatrix}
  10. \begin{bmatrix} \alpha & 1 & 0 & 0 \\ 0 & \alpha & 1 & 0 \\ 0 & 0 & \alpha & 1 \\ 0 & 0 & 0 & \alpha \end{bmatrix}
  11. \begin{bmatrix} \alpha & 1 & 0 & 0 \\ 0 & \alpha & 1 & 0 \\ 0 & 0 & \alpha & 0 \\ 0 & 0 & 0 & \beta \end{bmatrix}
  12. \begin{bmatrix} \alpha & 1 & 0 & 0 \\ 0 & \alpha & 0 & 0 \\ 0 & 0 & \beta & 1 \\ 0 & 0 & 0 & \beta \end{bmatrix}
  13. \begin{bmatrix} \alpha & 1 & 0 & 0 \\ 0 & \alpha & 0 & 0 \\ 0 & 0 & \beta & 0 \\ 0 & 0 & 0 & \gamma \end{bmatrix}
  14. \begin{bmatrix} \alpha & 0 & 0 & 0 \\ 0 & \beta & 0 & 0 \\ 0 & 0 & \gamma & 0 \\ 0 & 0 & 0 & \delta \end{bmatrix}

Compute the Jordan Canonical Form for a given matrix

Let A = \begin{bmatrix} -8 & -10 & -1 \\ 7 & 9 & 1 \\ 3 & 2 & 0 \end{bmatrix} and B = \begin{bmatrix} -3 & 2 & -4 \\ 4 & -1 & 4 \\ 4 & -2 & 5 \end{bmatrix}. Show that these matrices have the same characteristic polynomial, but that one is diagonalizable and the other not. Compute the Jordan canonical form for each.


Let P = \begin{bmatrix} -1 & -1 & 0 \\ 4 & 4 & 1 \\ -5 & -6 & -1 \end{bmatrix} and Q = \begin{bmatrix} -2 & 1 & -2 \\ 2 & -1 & 3 \\ 1 & 0 & 1 \end{bmatrix}. Evidently we have P^{-1}AP = \begin{bmatrix} -1 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{bmatrix} and Q^{-1}BQ = \begin{bmatrix} -1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}, which are both in Jordan canonical form.

Recall that characteristic polynomials are invariant under conjugation; in particular, evidently both A and B have characteristic polynomial (x+1)(x-1)^2. By Corollary 24 in D&F, A is not diagonalizable.

Show that two matrices can be diagonalized

Prove that the matrices A = \begin{bmatrix} 5 & 6 & 0 \\ -3 & -4 & 0 \\ -2 & 0 & 1 \end{bmatrix} and B = \begin{bmatrix} 3 & -1 & 2 \\ -10 & 6 & -14 \\ -6 & 3 & -7 \end{bmatrix} are similar. Show that both can be diagonalized and give matrices P and Q such that P^{-1}AP and Q^{-1}BQ are diagonal.


Let P = \begin{bmatrix} -1 & -2 & 0 \\ 5 & 6 & 1 \\ -1 & -1 & 0 \end{bmatrix} and Q = \begin{bmatrix} 2 & -1 & 3 \\ -1 & 1 & -2 \\ -2 & 1 & -2 \end{bmatrix}. Evidently we have P^{-1}AP = Q^{-1}BQ = \begin{bmatrix} -1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 2 \end{bmatrix}. In particular, A and B are similar and both are diagonalizable.

Compute the Jordan canonical form of a given matrix

Compute the Jordan Canonical Forms of the matrices A = \begin{bmatrix} 5 & 4 & 1 \\ -1 & 0 & 0 \\ -3 & -4 & 1 \end{bmatrix} and B = \begin{bmatrix} 3 & 4 & 2 \\ -2 & -3 & -1 \\ -4 & -4 & -3 \end{bmatrix}.


Let P = \dfrac{1}{2} \begin{bmatrix} 0 & 0 & 1 \\ -3 & -4 & -1 \\ -2 & 0 & -2 \end{bmatrix} and Q = \dfrac{1}{2} \begin{bmatrix} 1 & 2 & 0 \\ 1 & 0 & 0 \\ 4 & 4 & 2 \end{bmatrix}. Evidently then P^{-1}AP = \begin{bmatrix} 2 & 1 & 0 \\ 0 & 2 & 1 \\ 0 & 0 & 2 \end{bmatrix} and Q^{-1}BQ = \begin{bmatrix} -1 & 0 & 0 \\ 0 & -1 & 1 \\ 0 & 0 & -1 \end{bmatrix} are in Jordan canonical form. (We used WolframAlpha for the computations; see here and here.)

Determine whether two matrices are similar

Determine which of the following matrices are similar: A_1 = \begin{bmatrix} -1 & 4 & -1 \\ 2 & -1 & 3 \\ 0 & -4 & 3 \end{bmatrix}, A_2 = \begin{bmatrix} -3 & -4 & 0 \\ 2 & 3 & 0 \\ 8 & 8 & 1 \end{bmatrix}, A_3 = \begin{bmatrix} -3 & 2 & -4 \\ 2 & 1 & 0 \\ 3 & -1 & 3 \end{bmatrix}, and A_4 = \begin{bmatrix} -1 & 4 & -4 \\ 0 & -3 & 2 \\ 0 & -4 & 3 \end{bmatrix}.


Okay, these matrix computations are getting to be excruciating to do by hand. I’m going to completely wimp out and use a CAS to find the matrices P such that P^{-1}AP are in Jordan canonical form. The good news is that this does not render the proof incomplete, since we can easily verify that P^{-1}AP is in JCF. I wanted to get my hands dirty (so to speak) actually using the algorithm, but now that I’ve got a handle on it I’ll use a computer.

Note: WolframAlpha can compute the Jordan Canonical Form of a matrix with the syntax ‘jordan form A’ where A is a matrix in the form [[r11,r12,…,r1n],[r21,r22,…,r2n],[rn1,rn2,…,rnn]]. (Example.)

Let P_1 = \begin{bmatrix} -1 & 0 & -1 \\ 1 & 0 & 3/2 \\ -2 & -2 & -1 \end{bmatrix}, P_2 = \begin{bmatrix} -1 & -1 & 0 \\ 4 & 4 & 1 \\ 1 & 2 & 0 \end{bmatrix}, P_3 = \begin{bmatrix} -2 & 1 & -2 \\ 2 & -1 & 3 \\ -1 & 1 & -2 \end{bmatrix}, and P_4 = \begin{bmatrix} 0 & 2 & -1 \\ 1 & -2 & 2 \\ 0 & -1 & 1 \end{bmatrix}. Evidently then we have P_1^{-1}A_1P_1 = P_3^{-1}A_3P_3 = \begin{bmatrix} -1 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{bmatrix}, P_2^{-1}A_2P_2 = \begin{bmatrix} -1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}, and P_4^{-1}A_4P_4 = \begin{bmatrix} -1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 1 \end{bmatrix}. These products are in Jordan canonical form (obviously). So A_1 and A_3 are similar, and A_2 and A_4 are not similar to each other or to A_1.

Compute the Jordan canonical form of a given matrix

Compute the Jordan canonical form of A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & -2 \\ 0 & 1 & 3 \end{bmatrix}.


We begin by computing the Smith normal form of xI-A. Evidently the following sequence of ERCOs achieves this.

  1. R_2 + xR_3 \rightarrow R_2
  2. C_3 + (x-3)C_2 \rightarrow C_3
  3. -C_2 \rightarrow C_2
  4. R_2 \leftrightarrow R_3
  5. R_1 \leftrightarrow R_2
  6. C_1 \leftrightarrow C_2

The resulting matrix is \begin{bmatrix} 1 & 0 & 0 \\ 0 & x-1 & 0 \\ 0 & 0 & (x-1)(x-2) \end{bmatrix}. So the invariant factors of A are x-1 and (x-1)(x-2), and the elementary divisors are thus x-1, x-1, and x-2. So the Jordan canonical form of A is \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 2 \end{bmatrix}.