Section 7.4 Examples
Subsection 7.4.1 Computation patterns
Here we will concentrate mostly on computational patterns involving diagonal matrices. (Computations involving upper triangular or lower triangular matrices are somewhat similar — see further below.)
Example 7.4.1. Matrix operations involving diagonal matrices.
Let’s look at each of a sum, product, power, and inverse involving diagonal matrices, in the \(3\times 3\) case.
\begin{equation*}
\begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp 2 \amp 0 \\ 0 \amp 0 \amp 3 \end{bmatrix}
+ \left[\begin{array}{rrr} 4 \amp 0 \amp 0 \\ 0 \amp -2 \amp 0 \\ 0 \amp 0 \amp 6 \end{array}\right]
= \begin{bmatrix} 5 \amp 0 \amp 0 \\ 0 \amp 0 \amp 0 \\ 0 \amp 0 \amp 9 \end{bmatrix}
\end{equation*}
\begin{equation*}
\begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp 2 \amp 0 \\ 0 \amp 0 \amp 3 \end{bmatrix}
\left[\begin{array}{rrr} 4 \amp 0 \amp 0 \\ 0 \amp -2 \amp 0 \\ 0 \amp 0 \amp 6 \end{array}\right]
= \left[\begin{array}{rrr}
4 \amp 0 \amp 0 \\
0 \amp -4 \amp 0 \\
0 \amp 0 \amp 18
\end{array}\right]
\end{equation*}
\begin{equation*}
\begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp 2 \amp 0 \\ 0 \amp 0 \amp 3 \end{bmatrix}^2
= \begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp 4 \amp 0 \\ 0 \amp 0 \amp 9 \end{bmatrix}
= \begin{bmatrix} 1^2 \amp 0 \amp 0 \\ 0 \amp 2^2 \amp 0 \\ 0 \amp 0 \amp 3^2 \end{bmatrix}
\end{equation*}
\begin{equation*}
\inv{\begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp 2 \amp 0 \\ 0 \amp 0 \amp 3 \end{bmatrix}}
= \begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp \frac{1}{2} \amp 0 \\ 0 \amp 0 \amp \frac{1}{3} \end{bmatrix}
\end{equation*}
We can easily identify some patterns in the above example.
- We add diagonal matrices by adding corresponding diagonal entries.
- We multiply diagonal matrices by multiplying corresponding diagonal entries.
- We exponentiate a diagonal matrix by exponentiating each of the diagonal entries by the same exponent.
- We invert a diagonal matrix by inverting (i.e. taking the reciprocal of) each of the diagonal entries.
We have some of the same patterns for upper and lower triangular matrices, at least for the diagonal entries. We’ll demonstrate with some upper triangular example computations.
Example 7.4.2. Basic matrix operations involving upper triangular matrices.
\begin{equation*}
\begin{bmatrix} 1 \amp 1 \amp 1 \\ 0 \amp 2 \amp 1 \\ 0 \amp 0 \amp 3 \end{bmatrix}
+
\left[\begin{array}{rrr} 4 \amp 1 \amp 1 \\ 0 \amp -2 \amp 1 \\ 0 \amp 0 \amp 6 \end{array}\right]
= \begin{bmatrix}
5 \amp 2 \amp 2 \\
0 \amp 0 \amp 2 \\
0 \amp 0 \amp 9
\end{bmatrix}
\end{equation*}
\begin{align*}
\begin{bmatrix} 1 \amp 1 \amp 1 \\ 0 \amp 2 \amp 1 \\ 0 \amp 0 \amp 3 \end{bmatrix}
\left[\begin{array}{rrr} 4 \amp 1 \amp 1 \\ 0 \amp -2 \amp 1 \\ 0 \amp 0 \amp 6 \end{array}\right]
\amp = \begin{bmatrix}
4+0+0 \amp 1-2+0 \amp 1+1+0 \\
0+0+0 \amp 0-4+0 \amp 0+2+6 \\
0+0+0 \amp 0+0+0 \amp 0+0+18
\end{bmatrix}\\
\amp = \left[\begin{array}{rrr}
4 \amp -1 \amp 2 \\
0 \amp -4 \amp 8 \\
0 \amp 0 \amp 18
\end{array}\right]
\end{align*}
\begin{align*}
\begin{bmatrix} 1 \amp 1 \amp 1 \\ 0 \amp 2 \amp 1 \\ 0 \amp 0 \amp 3 \end{bmatrix}^2
\amp = \begin{bmatrix} 1 \amp 1 \amp 1 \\ 0 \amp 2 \amp 1 \\ 0 \amp 0 \amp 3 \end{bmatrix}
\begin{bmatrix} 1 \amp 1 \amp 1 \\ 0 \amp 2 \amp 1 \\ 0 \amp 0 \amp 3 \end{bmatrix}\\
\amp = \begin{bmatrix}
1+0+0 \amp 1+2+0 \amp 1+1+3 \\
0+0+0 \amp 0+4+0 \amp 0+2+3 \\
0+0+0 \amp 0+0+0 \amp 0+0+9
\end{bmatrix}\\
\amp = \begin{bmatrix} 1 \amp 3 \amp 5 \\ 0 \amp 4 \amp 5 \\ 0 \amp 0 \amp 9 \end{bmatrix}\\
\amp = \begin{bmatrix} 1^2 \amp 3 \amp 5 \\ 0 \amp 2^2 \amp 5 \\ 0 \amp 0 \amp 3^2 \end{bmatrix}
\end{align*}
Computing the inverse of an upper triangular matrix is not as simple as for a diagonal matrix — some row reduction will be required, using Procedure 6.3.7.
Example 7.4.3. Inverse of an upper triangular matrix.
Augment with the identity and reduce.
\begin{align*}
\left[\begin{array}{rrr|rrr}
1 \amp 1 \amp 1 \amp 1 \amp 0 \amp 0 \\
0 \amp 2 \amp 2 \amp 0 \amp 1 \amp 0 \\
0 \amp 0 \amp 3 \amp 0 \amp 0 \amp 1
\end{array}\right]
\begin{matrix} \phantom{x} \\ \frac{1}{2}R_2 \\ \frac{1}{3}R_3 \end{matrix}
\longrightarrow
\left[\begin{array}{rrr|rrr}
1 \amp 1 \amp 1 \amp 1 \amp 0 \amp 0 \\
0 \amp 1 \amp 1 \amp 0 \amp \frac{1}{2} \amp 0 \\
0 \amp 0 \amp 1 \amp 0 \amp 0 \amp \frac{1}{3}
\end{array}\right]
\begin{matrix} R_1-R_2 \\ \phantom{x} \\ \phantom{x} \end{matrix}\\
\longrightarrow
\left[\begin{array}{rrr|rrr}
1 \amp 0 \amp 0 \amp 1 \amp -\frac{1}{2} \amp 0 \\
0 \amp 1 \amp 1 \amp 0 \amp \frac{1}{2} \amp 0 \\
0 \amp 0 \amp 1 \amp 0 \amp 0 \amp \frac{1}{3}
\end{array}\right]
\begin{matrix} \phantom{x} \\ R_2-R_3 \\ \phantom{x} \end{matrix}
\longrightarrow
\left[\begin{array}{rrr|rrr}
1 \amp 0 \amp 0 \amp 1 \amp -\frac{1}{2} \amp 0 \\
0 \amp 1 \amp 0 \amp 0 \amp \frac{1}{2} \amp -\frac{1}{3} \\
0 \amp 0 \amp 1 \amp 0 \amp 0 \amp \frac{1}{3}
\end{array}\right]
\end{align*}
With this reduction, we have calculated that
\begin{equation*}
\inv{\begin{bmatrix}
1 \amp 1 \amp 1 \\
0 \amp 2 \amp 2 \\
0 \amp 0 \amp 3
\end{bmatrix}} =
\left[\begin{array}{rrr}
1 \amp -\frac{1}{2} \amp 0 \\
0 \amp \frac{1}{2} \amp -\frac{1}{3} \\
0 \amp 0 \amp \frac{1}{3}
\end{array}\right].
\end{equation*}
Again, in these two examples we see the same patterns on the main diagonal as for diagonal matrices. Products, powers, and inverses of lower triangular matrices would be similar.
Remark 7.4.4. More patterns with diagonal matrices.
In the example calculations of Discovery 7.2, we also found the following patterns.
- Multiplying a matrix \(A\) on the left by a diagonal matrix \(D\) multiplies each row of \(A\) by the corresponding diagonal entry of \(D\text{.}\)
- Multiplying a matrix \(A\) on the right by a diagonal matrix \(D\) multiplies each column of \(A\) by the corresponding diagonal entry of \(D\text{.}\)