Skip to main content

Section 28.5 Examples

Subsection 28.5.1 Operations with block matrices

Addition and scalar multiplication of block matrices should be clear, so we will only carry out an example of multiplication of block matrices.

Example 28.5.1. Multiplying block matrices.

Consider matrices

\begin{align*} A \amp= \left[\begin{array}{@{}crc|cc@{}} 1 \amp 0 \amp 1 \amp 1 \amp 1 \\ 4 \amp -1 \amp 1 \amp 1 \amp 1 \\ 2 \amp 2 \amp 0 \amp 1 \amp 1 \\ \hline 0 \amp 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 0 \amp 0 \amp 1 \end{array}\right] \text{,} \amp B \amp= \left[\begin{array}{@{}rrr|rc@{}} 1 \amp 0 \amp 0 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \amp 0 \amp 0 \\ 0 \amp 0 \amp 1 \amp 0 \amp 0 \\ \hline -1 \amp -1 \amp -1 \amp 1 \amp 0 \\ -1 \amp -1 \amp -1 \amp -4 \amp 9 \end{array}\right] \text{,} \end{align*}

subdivided into blocks

\begin{align*} A_1 \amp= \left[\begin{array}{crc} 1 \amp 0 \amp 1 \\ 4 \amp -1 \amp 1 \\ 2 \amp 2 \amp 0 \end{array}\right] \text{,} \amp A_2 \amp= \begin{bmatrix} 1 \amp 1 \\ 1 \amp 1 \\ 1 \amp 1 \end{bmatrix} \text{,} \amp B_1 \amp= I_3 \text{,} \amp B_2 \amp= \zerovec \text{,}\\ A_3 \amp= \zerovec \text{,} \amp A_4 \amp= I_2 \text{,} \amp B_3 \amp= \begin{bmatrix} -1 \amp -1 \amp -1 \\ -1 \amp -1 \amp -1 \end{bmatrix} \text{,} \amp B_4 \amp= \left[\begin{array}{rc} 1 \amp 0 \\ -4 \amp 9 \end{array}\right] \text{,} \end{align*}

where \(I_2\) is the \(2 \times 2\) identity matrix, \(I_3\) is the \(3 \times 3\) identity matrix, and \(\zerovec\) represents a zero matrix of the appropriate size as usual. Then we can compute \(AB\) by first computing

\begin{align*} A_1 B_1 + A_2 B_3 \amp = A_1 + \left[\begin{array}{rrr} -2 \amp -2 \amp -2 \\ -2 \amp -2 \amp -2 \\ -2 \amp -2 \amp -2 \end{array}\right] = \left[\begin{array}{rrr} -1 \amp -2 \amp -1 \\ 2 \amp -3 \amp -1 \\ 0 \amp 0 \amp -2 \end{array}\right] \text{,}\\ A_1 B_2 + A_2 B_4 \amp = \zerovec + \left[\begin{array}{rc} -3 \amp 9 \\ -3 \amp 9 \\ -3 \amp 9 \end{array}\right] = \left[\begin{array}{rc} -3 \amp 9 \\ -3 \amp 9 \\ -3 \amp 9 \end{array}\right] \text{,}\\ A_3 B_1 + A_4 B_3 \amp= \zerovec + B_3 = B_3 \text{,} \\ A_3 B_2 + A_4 B_4 \amp= \zerovec + B_4 = B_4 \text{.} \end{align*}

Putting these results together as blocks in the product matrix, we get

\begin{align*} A B \amp = \begin{bmatrix} A_1 \amp A_2 \\ A_3 \amp A_4 \end{bmatrix} \begin{bmatrix} B_1 \amp B_2 \\ B_3 \amp B_4 \end{bmatrix}\\ \amp = \begin{bmatrix} A_1 B_1 + A_2 B_3 \amp A_1 B_2 + A_2 B_4 \\ A_3 B_1 + A_4 B_3 \amp A_3 B_2 + A_4 B_4 \end{bmatrix}\\ \amp = \left[\begin{array}{@{}rrr|rc@{}} -1 \amp -2 \amp -1 \amp -3 \amp 9 \\ 2 \amp -3 \amp -1 \amp -3 \amp 9 \\ 0 \amp 0 \amp -2 \amp -3 \amp 9 \\ \hline -1 \amp -1 \amp -1 \amp 1 \amp 0 \\ -1 \amp -1 \amp -1 \amp -4 \amp 9 \end{array}\right]\text{.} \end{align*}

And here is an example with block-diagonal matrices.

Example 28.5.2. Multiplying block-diagonal matrices.

Consider the block-diagonal matrices

\begin{align*} A \amp = \begin{bmatrix} 0 \amp 0 \amp 1 \\ 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \\ \amp \amp \amp -2 \\ \amp \amp \amp \amp 1 \amp 1 \\ \amp \amp \amp \amp 0 \amp 4 \end{bmatrix} \amp B \amp = \begin{bmatrix} 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \\ 0 \amp 0 \amp 0 \\ \amp \amp \amp 0 \\ \amp \amp \amp \amp 0 \amp 0 \\ \amp \amp \amp \amp 1 \amp 0 \end{bmatrix}\text{.} \end{align*}

We can compute the product \(AB\) by computing the products of the blocks. From preliminary calculations

\begin{align*} A_1 B_1 \amp= \begin{bmatrix} 0 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \end{bmatrix} \text{,} \amp A_2 B_2 \amp= \begin{bmatrix} 0 \end{bmatrix} \text{,} \amp A_3 B_3 \amp= \begin{bmatrix} 1 \amp 0 \\ 4 \amp 0 \end{bmatrix} \text{,} \end{align*}

we get product

\begin{equation*} AB = \begin{bmatrix} 0 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \\ \amp \amp \amp 0 \\ \amp \amp \amp \amp 1 \amp 0 \\ \amp \amp \amp \amp 4 \amp 0 \end{bmatrix}\text{.} \end{equation*}

Subsection 28.5.2 Putting a matrix in block-diagonal form

Here is an example of using geometric intuition to determine invariant subspaces (similarly to Discovery 28.2), and then using those invariant subspaces to put a matrix into block-diagonal form.

Example 28.5.3. Block-diagonal form for rotation around an axis in space.

It is far from obvious, but the effect of multiplication by matrix

\begin{equation*} A = \frac{1}{2} \left[\begin{array}{rrr} 1 \amp 1 \amp \sqrt{2} \\ 1 \amp 1 \amp -\sqrt{2} \\ -\sqrt{2} \amp \sqrt{2} \amp 0 \end{array}\right] \end{equation*}

on vectors in \(\R^3\) is to rotate around the line through the origin spanned by the vector \(\uvec{n} = (1, 1, 0)\text{.}\) While we are not yet prepared to understand the connection between the matrix and the geometric effect, we can at least carry out some simple computations to demonstrate the connection in this example.

If \(A\) is a rotation, vectors parallel to the axis of rotation should be fixed by the transformation. In particular, vector \(\uvec{n}\) should be fixed by \(A\text{:}\)

\begin{equation*} A \uvec{n} = \frac{1}{2} \left[\begin{array}{rrr} 1 \amp 1 \amp \sqrt{2} \\ 1 \amp 1 \amp -\sqrt{2} \\ -\sqrt{2} \amp \sqrt{2} \amp 0 \end{array}\right] \left[\begin{array}{r} 1 \\ 1 \\ 0 \end{array}\right] = \frac{1}{2} \left[\begin{array}{r} 2 \\ 2 \\ 0 \end{array}\right] = \left[\begin{array}{r} 1 \\ 1 \\ 0 \end{array}\right]\text{,} \end{equation*}

as expected.

This fixed vector \(\uvec{n}\) representing the axis of rotation can be taken as the normal vector for the plane through the origin that is perpendicular to this axis. Using the normal vector as coefficients, the plane equation is \(x + y = 0\text{.}\) We would expect a vector parallel to this plane to be rotated to another vector in the plane of the same length. Let's test this with vector \(\uvec{w}_1 = (0,0,1)\text{,}\) which we know is parallel to the plane because its components satisfy the plane equation. Computing the transformed vector, we get

\begin{equation*} A \uvec{w}_1 = \frac{1}{2} \left[\begin{array}{rrr} 1 \amp 1 \amp \sqrt{2} \\ 1 \amp 1 \amp -\sqrt{2} \\ -\sqrt{2} \amp \sqrt{2} \amp 0 \end{array}\right] \left[\begin{array}{r} 0 \\ 0 \\ 1 \end{array}\right] = \frac{1}{2} \left[\begin{array}{r} \sqrt{2} \\ -\sqrt{2} \\ 0 \end{array}\right] = \left[\begin{array}{r} \frac{1}{\sqrt{2}} \\ -\frac{1}{\sqrt{2}} \\ 0 \end{array}\right]\text{.} \end{equation*}

The components of this transformed vector do indeed satisfy the plane equation \(x + y = 0\text{.}\) Even better, then length of this vector is \(1\text{,}\) which is the same as the length of the original vector \(\uvec{w}_1\text{.}\) A rotation would not change the length of a vector, so this is a good sign. We can even see the angle of rotation in this result: the dot product of \(\uvec{w}_1\) and \(A\uvec{w}_1\) is \(0\text{,}\) so these vectors are orthogonal. It appears that the angle of rotation is \(\pi/2\text{.}\)

As one more test, write \(\uvec{w}_2\) for the transformed vector \(A \uvec{w}_1\text{.}\) This vector lies in the same plane orthogonal to the axis of rotation, so we expect \(A\) to also transform it to another vector in that plane:

\begin{equation*} A \uvec{w}_2 = \frac{1}{2} \left[\begin{array}{rrr} 1 \amp 1 \amp \sqrt{2} \\ 1 \amp 1 \amp -\sqrt{2} \\ -\sqrt{2} \amp \sqrt{2} \amp 0 \end{array}\right] \left[\begin{array}{r} \frac{1}{\sqrt{2}} \\ -\frac{1}{\sqrt{2}} \\ 0 \end{array}\right] = \frac{1}{2} \left[\begin{array}{r} 0 \\ 0 \\ -2 \end{array}\right] = \left[\begin{array}{r} 0 \\ 0 \\ -1 \end{array}\right]\text{.} \end{equation*}

So \(A\) transforms \(\uvec{w}_2\) into \(-\uvec{w}_1\text{.}\) From our guess at the angle of rotation, this result should also be expected: since \(\uvec{w}_2 = A \uvec{w}_1\text{,}\) then \(A \uvec{w}_2\) is like transforming \(\uvec{w}_1\) twice, first by \(\pi/2\) to \(\uvec{w}_2\text{,}\) and then another \(\pi/2\) from there so that it comes all the way around to point oppositely to its original position.

These test calculations were not only to see transformation by \(A\) as a rotation. They also provided us with a couple of \(A\)-invariant subspaces. Since \(\uvec{n}\) is fixed by \(A\text{,}\) the same will be true for every scalar multiple of \(\uvec{n}\text{:}\)

\begin{equation*} A (k\uvec{n}) = k A \uvec{n} = k \uvec{n} \text{.} \end{equation*}

This demonstrates that \(U = \Span \{\uvec{n}\}\) is an \(A\)-invariant subspace.

Similarly, since \(A\) transforms \(\uvec{w}_1\) into \(\uvec{w}_2\) and transforms \(\uvec{w}_2\) into \(-\uvec{w}_1\text{,}\) it follows that \(A\) transforms every linear combination of these two vectors into another linear combination of them:

\begin{equation*} A (k_1 \uvec{w}_1 + k_2 \uvec{w}_2) = k_1 (A \uvec{w}_1) + k_2 (A \uvec{w}_2) = k_1 \uvec{w}_2 + k_2 (-\uvec{w}_1) \text{.} \end{equation*}

This demonstrates that \(W = \Span \{\uvec{w}_1, \uvec{w}_2\}\) is also an \(A\)-invariant subspace.

The pair of spaces \(U,W\) are independent, because if we take their bases together, the set \(\{\uvec{n}, \uvec{w}_1, \uvec{w}_2\}\) remains independent. And their dimensions add up to the dimension of \(\R^3\text{,}\) so this pair of \(A\)-invariant spaces is a complete set of independent subspaces. This is exactly what we need to form an appropriate transition matrix:

\begin{equation*} P = \begin{bmatrix} | \amp | \amp | \\ \uvec{n} \amp \uvec{w}_1 \amp \uvec{w}_2 \\ | \amp | \amp | \end{bmatrix} = \left[\begin{array}{rrr} 1 \amp 0 \amp \frac{1}{\sqrt{2}} \\ 1 \amp 0 \amp -\frac{1}{\sqrt{2}} \\ 0 \amp 1 \amp 0 \end{array}\right] \end{equation*}

There is no need to compute \(\inv{P}\) in order to know the form matrix \(\inv{P} A P\text{.}\) Instead, we can use the pattern of similarity from Subsection 26.3.2 — the columns of \(\inv{P} A P\) should be coefficients for expressing the transformed vectors \(A \uvec{n}\text{,}\) \(A \uvec{w}_1\text{,}\) and \(A \uvec{w}_2\) as linear combinations. However, since we know our subspaces are invariant, we know that \(\uvec{w}_1\) and \(\uvec{w}_2\) will not be needed in the expression for \(A\uvec{n}\text{,}\) and \(\uvec{n}\) will not be needed in the expressions for \(A \uvec{w}_1\) and \(A \uvec{w}_2\text{.}\) We also know that we will need a \(1 \times 1\) block (since \(\dim U = 1\)) and a \(2 \times 2\) block (since \(\dim W = 2\)). So from

\begin{align*} A \uvec{n} \amp = 1 \uvec{n} \text{,} \amp \amp \begin{array}{lcrcrcr} A \uvec{w}_1 \amp = \amp \uvec{w}_2 \amp = \amp 0 \uvec{w}_1 \amp + \amp 1 \uvec{w}_2 \text{,} \\ A \uvec{w}_2 \amp = \amp - \uvec{w}_1 \amp = \amp (-1) \uvec{w}_1 \amp + \amp 0 \uvec{w}_2 \text{,} \end{array} \end{align*}

we obtain

\begin{equation*} \inv{P} A P = \left[\begin{array}{@{}r|rr@{}} 1 \amp 0 \amp 0 \\ \hline 0 \amp 0 \amp -1 \\ 0 \amp 1 \amp 0 \end{array}\right]\text{,} \end{equation*}

where the \(1 \times 1\) block in the upper left represents the trivial action of \(A\) on vectors in the axis \(U\text{,}\) and the \(2 \times 2\) block in the lower right represents the rotation action of \(A\) on the vectors in the perpendicular plane \(W\text{.}\)

The following example demonstrates how diagonal form is just a special case of block-diagonal form.

Example 28.5.4. Diagonal form as block-diagonal form.

Consider the matrix

\begin{equation*} A = \left[\begin{array}{rrr} 2 \amp 1 \amp -2 \\ 3 \amp 0 \amp 0 \\ -1 \amp 1 \amp -2 \end{array}\right] \text{.} \end{equation*}

If you take the time to compute them, you will find that \(A\) has three eigenvalues: \(\lambda_1 = 3\text{,}\) \(\lambda_2 = 0\text{,}\) and \(\lambda_3 = -3\text{.}\) Each of the eigenspaces of \(A\) is one-dimensional, and by row reducing a spanning vector can be obtained for each of them:

\begin{align*} E_{\lambda_1}(A) \amp= \Span \{ (1,1,0) \} \text{,} \\ E_{\lambda_2}(A) \amp= \Span \{ (0,2,1) \} \text{,} \\ E_{\lambda_3}(A) \amp= \Span \{ (1,-1,2) \} \text{.} \end{align*}

As part of Discovery 28.3, you were asked to verify that an eigenspace is always invariant. Furthermore, it follows from Proposition 25.6.6 that eigenspaces are always independent. And since we have three one-dimensional eigenspaces in \(\R^3\text{,}\) there are a complete set of independent, invariant spaces, precisely what we need for the block-diagonalization procedure.

So we may form a suitable transition matrix \(P\) by taking the eigenvectors above as columns:

\begin{equation*} P = \left[\begin{array}{rrr} 1 \amp 0 \amp 1 \\ 1 \amp 2 \amp -1 \\ 0 \amp 1 \amp 2 \end{array}\right] \text{.} \end{equation*}

Each of our eigenspaces is one-dimensional, so we need three \(1 \times 1\) blocks in our form matrix, which agrees with our expectation that it be diagonal. If we label the eigenvectors in the columns of \(P\) as \(\uvec{p}_1,\uvec{p}_2,\uvec{p}_3\text{,}\) then the eigenvalue conditions

\begin{align*} A \uvec{p}_1 \amp = 3 \uvec{p}_1 \text{,} \amp A \uvec{p}_2 \amp = 0 \uvec{p}_2 \text{,} \amp A \uvec{p}_3 \amp = -3 \uvec{p}_3 \text{,} \end{align*}

tells us the form matrix

\begin{equation*} \inv{P} A P = \left[\begin{array}{@{}r|r|r@{}} 3 \amp 0 \amp 0 \\ \hline 0 \amp 0 \amp 0 \\ \hline 0 \amp 0 \amp -3 \end{array}\right]\text{,} \end{equation*}

where the blocks along the diagonal are each \(1 \times 1\) (including the \(1 \times 1\) zero block in the middle).

This form matrix matches up with our knowledge of diagonal forms, where the eigenvalues of the original matrix should appear down the diagonal of the form matrix, in the same order that the eigenvectors were placed as columns of \(P\text{.}\)