# Chaitanya's Random Pages

## November 28, 2012

### An easier way to square some 2×2 matrices

Filed under: mathematics — ckrao @ 11:16 am

The Cayley-Hamilton theorem states that a square matrix satisfies its characteristic equation. That is, if $A$ is a matrix with characteristic equation $p(x) = \det (x I - A)$ then $p(A) = 0$. (Here $I$ is the identity matrix of the same dimension of $A$.)

The characteristic equation of a 2×2 matrix is a quadratic of the form $p(x) = (x - \lambda_1)(x - \lambda_2) = x^2 - a x+ b$, where $a = \lambda_1 + \lambda_2$and $b = \lambda_1 \lambda_2$, where $\lambda_1$ and $\lambda_2$ are the eigenvalues of the matrix $A$. Since the sum of the eigenvalues of a matrix is the sum of its diagonal elements (the trace) and the product of the eigenvalues is the determinant, we can rewrite this as

$\displaystyle p(x) = x^2 - \text{tr} (A) x + \det (A).$

By the Cayley-Hamilton theorem,

$\displaystyle 0_{2 \times 2} = A^2 - \text{tr}(A) A + \det (A) I$,

from which

$\displaystyle A^2 = \text{tr} (A) A - \det (A) I.$

In certain cases this formula might be an easier way to calculate the square of a 2×2 matrix than matrix multiplication, especially if the determinant is a nice number.

For example, if $A = \left[ \begin{array}{cc} 3 & 2 \\ 1 & 1 \end{array} \right]$, we easily see that its trace is $3 + 1 = 4$ and its determinant is $3\times 1 - 2 \times 1 = 1$, so

$\displaystyle A^2 = 4A - I = \left[ \begin{array}{cc} 4\times 3 - 1 & 4 \times 2 \\ 4 \times 1 & 4 \times 1 - 1\end{array} \right] = \left[ \begin{array}{cc} 11 & 8 \\ 4 & 3\end{array} \right].$

The same formula may be applied a second time if we wish to find $A^3$:

\begin{aligned} A^3 &= A. A^2\\ &= A(\text{tr} (A) A - \det (A) I)\\ &= \text{tr} (A) A^2- \det (A) A \\ &= \text{tr} (A) (\text{tr} (A) A - \det (A) I) - \det (A) A \\ &= \left( \left( \text{tr} (A) \right)^2 - \det (A) \right) A - \text{tr} (A) \det (A) I. \end{aligned}

So in our example,

$\displaystyle \left[ \begin{array} {cc} 3 & 2 \\ 1 & 1 \end{array} \right] ^3 = (4^2 - 1) A - 4 \times 1 I = \left[ \begin{array}{cc} 41 & 30 \\ 15 & 14 \end{array} \right] .$

Finally, in case you were wondering how the Cayley-Hamilton theorem can be proved, one way is via the equation

$\displaystyle X (\text{adj} (X) ) = \det (X) I.$

The adjugate $\text{adj} (X)$ of an $n \times n$ matrix is a matrix of $(n-1) \times (n-1)$ determinants up to sign. The equation may be proved by considering the $(i,j)$ entry of each side and using the alternating sum formula for the determinant of a matrix. All that we need to be concerned with here is that if $X = xI - A$ then $\text{adj} (X)$ is a polynomial of degree $n-1$. We can then write the above equation as

$\displaystyle (x I - A) (x^{n-1} B_{n-1} + x^{n-2} B_{n-2} + \ldots + B_0) = (x^n + a_{n-1} x^{n-1} + \ldots + a_0)I,$

where $B_0, B_1, \ldots B_{n-1}$ are constant matrices and $a_0, a_1, \ldots a_{n-1}$ are constant scalars.

From this we simply match coefficients of powers of $x$ of each side. (For convenience set $B_{-1} = B_n = 0$.)

$\displaystyle B_{k-1} - A B_k = a_k I, \quad k = 0, 1, \ldots n.$

Multiplying both sides of this equation on the left by $A^k$ and then summing from $k =0$ to $n$ gives

$\displaystyle \sum_{k=0}^n a_k A^k = \sum_{k=0}^n (A^k B_{k-1} - A^{k+1} B_k) = A^0 B_{-1} - A^{n+1} B_n = 0.$

But the left side of this equation is the characteristic equation $\sum_{k=0}^n a_k x^k$ evaluated at $A$, and we are done.