Linear AlgebraMatrix Algebra3 of 9
Matrix Algebra · 3

Identity, Diagonal and Triangular Matrices

In a typical matrix, every row mixes all the variables together, so working with matrices and solving systems means untangling those variables until each one stands alone.

1

The Identity Matrix

The identity matrix is the matrix that leaves every vector completely unchanged, acting like the number 11 in matrix multiplication. To see how we stop variables from mixing, what must a 3×33 \times 3 matrix look like so that feeding in [xyz]\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} gives back the exact same [xyz]\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix}?

The Identity Matrix
[?????????][xyz]=[xyz]\displaystyle \begin{bmatrix} ? & ? & ? \\ ? & ? & ? \\ ? & ? & ? \end{bmatrix} \begin{bmatrix} \htmlClass{lc-green}{x} \\ \htmlClass{lc-pink}{y} \\ \htmlClass{lc-violet}{z} \end{bmatrix} = \begin{bmatrix} \htmlClass{lc-green}{x} \\ \htmlClass{lc-pink}{y} \\ \htmlClass{lc-violet}{z} \end{bmatrix}
Text solution
Stop the variables from mixing in each rowPut 1\diagonal{1} in the column matching that row's own variable and 00 in the other two spots so the remaining variables are multiplied by 00.
[100010001][xyz]=[1x+0y+0z0x+1y+0z0x+0y+1z]\displaystyle \begin{bmatrix} \diagonal{1} & 0 & 0 \\ 0 & \diagonal{1} & 0 \\ 0 & 0 & \diagonal{1} \end{bmatrix} \begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} \diagonal{1}\xvar{x} + 0\yvar{y} + 0\zvar{z} \\ 0\xvar{x} + \diagonal{1}\yvar{y} + 0\zvar{z} \\ 0\xvar{x} + 0\yvar{y} + \diagonal{1}\zvar{z} \end{bmatrix}
Pass each variable straight throughWith 1\diagonal{1}s down the main diagonal and 00s everywhere else, multiplying any vector or matrix by II leaves it unchanged.
[100010001]⏟identity matrix I[xyz]=[xyz]\displaystyle \underbrace{\begin{bmatrix} \diagonal{1} & 0 & 0 \\ 0 & \diagonal{1} & 0 \\ 0 & 0 & \diagonal{1} \end{bmatrix}}_{\text{identity matrix } I} \begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix}
2

Diagonal Matrices, Powers, and Inverses

The identity matrix keeps the variables from mixing, but it does nothing to them. If we want to scale x\xvar{x}, y\yvar{y}, and z\zvar{z} by different amounts while still keeping them separate, we use a diagonal matrix, which replaces the 1\diagonal{1}s on the main diagonal with scaling numbers and keeps 00s everywhere else. Let's see how D=[20005000−3]D = \begin{bmatrix} \diagonal{2} & 0 & 0 \\ 0 & \diagonal{5} & 0 \\ 0 & 0 & \diagonal{-3} \end{bmatrix} acts on a vector, and how it makes products, high powers like D100D^{100}, and the inverse D−1D^{-1} immediate.

Diagonal Matrices, Powers, and Inverses
DD
2\htmlClass{lc-blue}{2}
00
00
00
5\htmlClass{lc-blue}{5}
00
00
00
−3\htmlClass{lc-blue}{-3}
D100=?D^{100} = \mathord{?}
D−1=?D^{-1} = \mathord{?}
Text solution
Scale each variable on its own rowBecause the off-diagonal entries are zero, each number on the main diagonal scales only its own variable.
[20005000−3]⏟diagonal matrix D[xyz]=[2x5y−3z]\displaystyle \underbrace{\begin{bmatrix} \diagonal{2} & 0 & 0 \\ 0 & \diagonal{5} & 0 \\ 0 & 0 & \diagonal{-3} \end{bmatrix}}_{\text{diagonal matrix } D} \begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} \diagonal{2}\xvar{x} \\ \diagonal{5}\yvar{y} \\ \diagonal{-3}\zvar{z} \end{bmatrix}
Multiply and take powers straight across the diagonalMultiplying a vector by one diagonal matrix after another, or by DD a hundred times in a row, multiplies each variable's scaling factor on its own.
[300020004][20005000−3]=[600010000−12],D100=[21000005100000(−3)100]\displaystyle \begin{aligned} &\begin{bmatrix} \diagonal{3} & 0 & 0 \\ 0 & \diagonal{2} & 0 \\ 0 & 0 & \diagonal{4} \end{bmatrix} \begin{bmatrix} \diagonal{2} & 0 & 0 \\ 0 & \diagonal{5} & 0 \\ 0 & 0 & \diagonal{-3} \end{bmatrix} \\ &= \begin{bmatrix} \diagonal{6} & 0 & 0 \\ 0 & \diagonal{10} & 0 \\ 0 & 0 & \diagonal{-12} \end{bmatrix}, \\ D^{100} &= \begin{bmatrix} \diagonal{2}^{100} & 0 & 0 \\ 0 & \diagonal{5}^{100} & 0 \\ 0 & 0 & (\diagonal{-3})^{100} \end{bmatrix} \end{aligned}
Invert by flipping each diagonal entryUndoing the scaling on each variable means dividing by its diagonal number, which works whenever every diagonal entry is non-zero.
D−1=[1200015000−13]\displaystyle D^{-1} = \begin{bmatrix} \diagonal{\frac{1}{2}} & 0 & 0 \\ 0 & \diagonal{\frac{1}{5}} & 0 \\ 0 & 0 & \diagonal{-\frac{1}{3}} \end{bmatrix}
Check for zeros on the diagonalA 0\lost{0} on the main diagonal turns that variable into 0\lost{0} no matter what value it started with, losing that value so no inverse matrix can bring it back.
[200050000][xyz]=[2x5y0]\displaystyle \begin{bmatrix} \diagonal{2} & 0 & 0 \\ 0 & \diagonal{5} & 0 \\ 0 & 0 & \lost{0} \end{bmatrix} \begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} \diagonal{2}\xvar{x} \\ \diagonal{5}\yvar{y} \\ \lost{0} \end{bmatrix}

In a 3D transformation by a diagonal matrix DD, each diagonal entry stretches or squashes only its own coordinate axis while the other two axes stay still, and when a diagonal entry reaches zero, the box flattens onto a plane and the inverse D−1D^{-1} disappears.

In a diagonal matrix, each diagonal number scales only its own axis, and a single zero crushes that dimension flat with no way to undo it.
3

Multiplying by a Diagonal Matrix: Rows vs. Columns

Multiplying two diagonal matrices is easy because neither one mixes the variables. What happens when a diagonal matrix DD multiplies a full matrix AA? Let's multiply A=[123214132]A = \begin{bmatrix} 1 & 2 & 3 \\ 2 & 1 & 4 \\ 1 & 3 & 2 \end{bmatrix} by D=[20005000−3]D = \begin{bmatrix} \diagonal{2} & 0 & 0 \\ 0 & \diagonal{5} & 0 \\ 0 & 0 & \diagonal{-3} \end{bmatrix} on the left (DADA) and compare it with multiplying on the right (ADAD).

Multiplying by a Diagonal Matrix: Rows vs. Columns
DD
2\htmlClass{lc-blue}{2}
00
00
00
5\htmlClass{lc-blue}{5}
00
00
00
−3\htmlClass{lc-blue}{-3}
AA
11
22
33
22
11
44
11
33
22
DA=?DA = \mathord{?}
AD=?AD = \mathord{?}
Text solution
Multiply on the left (DADA) to scale the rowsEach row of DD has a single non-zero number on the diagonal, which picks out and scales the matching row of AA.
DA=[20005000−3][123214132]=[2(1)2(2)2(3)5(2)5(1)5(4)−3(1)−3(3)−3(2)]=[24610520−3−9−6]\displaystyle \begin{aligned} DA &= \begin{bmatrix} \diagonal{2} & 0 & 0 \\ 0 & \diagonal{5} & 0 \\ 0 & 0 & \diagonal{-3} \end{bmatrix} \begin{bmatrix} 1 & 2 & 3 \\ 2 & 1 & 4 \\ 1 & 3 & 2 \end{bmatrix} \\ &= \begin{bmatrix} \diagonal{2}(1) & \diagonal{2}(2) & \diagonal{2}(3) \\ \diagonal{5}(2) & \diagonal{5}(1) & \diagonal{5}(4) \\ \diagonal{-3}(1) & \diagonal{-3}(3) & \diagonal{-3}(2) \end{bmatrix} \\ &= \begin{bmatrix} 2 & 4 & 6 \\ 10 & 5 & 20 \\ -3 & -9 & -6 \end{bmatrix} \end{aligned}
Multiply on the right (ADAD) to scale the columnsEach column of DD has a single non-zero number on the diagonal, which picks out and scales the matching column of AA.
AD=[123214132][20005000−3]=[2(1)5(2)−3(3)2(2)5(1)−3(4)2(1)5(3)−3(2)]=[210−945−12215−6]\displaystyle \begin{aligned} AD &= \begin{bmatrix} 1 & 2 & 3 \\ 2 & 1 & 4 \\ 1 & 3 & 2 \end{bmatrix} \begin{bmatrix} \diagonal{2} & 0 & 0 \\ 0 & \diagonal{5} & 0 \\ 0 & 0 & \diagonal{-3} \end{bmatrix} \\ &= \begin{bmatrix} \diagonal{2}(1) & \diagonal{5}(2) & \diagonal{-3}(3) \\ \diagonal{2}(2) & \diagonal{5}(1) & \diagonal{-3}(4) \\ \diagonal{2}(1) & \diagonal{5}(3) & \diagonal{-3}(2) \end{bmatrix} \\ &= \begin{bmatrix} 2 & 10 & -9 \\ 4 & 5 & -12 \\ 2 & 15 & -6 \end{bmatrix} \end{aligned}

When the diagonal matrix DD sits on the left of AA, each diagonal entry multiplies straight across its matching row; when the exact same DD sits on the right of AA, each diagonal entry multiplies straight down its matching column.

Multiplying by a diagonal matrix on the left scales a matrix's rows, while putting it on the right scales the columns.
4

Upper and Lower Triangular Matrices

In a general system of equations, the variables depend on each other in a circle: finding x\xvar{x} requires y\yvar{y} and z\zvar{z}, while finding y\yvar{y} requires x\xvar{x} and z\zvar{z}. Putting zeros in all the spots on one side of the main diagonal breaks that circle into a triangular matrix, where we can solve one row at a time and each row brings in only one new unknown.

UU
1\htmlClass{lc-blue}{1}
44
−2-2
00
3\htmlClass{lc-blue}{3}
11
00
00
2\htmlClass{lc-blue}{2}
Back-substitution\text{Back-substitution}
(bottom to top)\text{(bottom to top)}
LL
2\htmlClass{lc-blue}{2}
00
00
−1-1
4\htmlClass{lc-blue}{4}
00
33
22
5\htmlClass{lc-blue}{5}
Forward substitution\text{Forward substitution}
(top to bottom)\text{(top to bottom)}

Now let's solve an upper triangular system U[xyz]=[576]U\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} 5 \\ 7 \\ 6 \end{bmatrix} from the bottom up, and a lower triangular system L[xyz]=[8427]L\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} 8 \\ 4 \\ 27 \end{bmatrix} from the top down.

Upper and Lower Triangular Matrices
−xx+11y4y−2z2z=175\hphantom{-x}\mathllap{\htmlClass{lc-green}{x}} + \hphantom{11y}\mathllap{4\htmlClass{lc-pink}{y}} - \hphantom{2z}\mathllap{2\htmlClass{lc-violet}{z}} = \hphantom{17}\mathllap{5}
−x2x+11y11y−2z3z=1717\hphantom{-x}\mathllap{2\htmlClass{lc-green}{x}} + \hphantom{11y}\mathllap{11\htmlClass{lc-pink}{y}} - \hphantom{2z}\mathllap{3\htmlClass{lc-violet}{z}} = \hphantom{17}\mathllap{17}
−x−x−11yy+2z5z=178\hphantom{-x}\mathllap{-\htmlClass{lc-green}{x}} - \hphantom{11y}\mathllap{\htmlClass{lc-pink}{y}} + \hphantom{2z}\mathllap{5\htmlClass{lc-violet}{z}} = \hphantom{17}\mathllap{8}
x=?y=?z=?\htmlClass{lc-green}{x} = \mathord{?} \qquad \htmlClass{lc-pink}{y} = \mathord{?} \qquad \htmlClass{lc-violet}{z} = \mathord{?}
Text solution
Solve the upper triangular system by back-substitutionStart at the bottom row where two zeros eliminate x\xvar{x} and y\yvar{y}, then plug each variable you find upward into the next row.
[14−2031002]⏟upper triangular U[xyz]=[576]\displaystyle \underbrace{\begin{bmatrix} \diagonal{1} & 4 & -2 \\ 0 & \diagonal{3} & 1 \\ 0 & 0 & \diagonal{2} \end{bmatrix}}_{\text{upper triangular } U} \begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} 5 \\ 7 \\ 6 \end{bmatrix}
Bottom row:2z=6  ⟹  z=3Middle row:3y+1(3)=7  ⟹  3y=4  ⟹  y=43Top row:x+4(43)−2(3)=5  ⟹  x−23=5  ⟹  x=173\displaystyle \begin{aligned} \text{Bottom row:} \\ \diagonal{2}\zvar{z} &= 6 \\ \implies \zvar{z} &= 3 \\[1ex] \text{Middle row:} \\ \diagonal{3}\yvar{y} + 1(\zvar{3}) &= 7 \\ \implies \diagonal{3}\yvar{y} &= 4 \\ \implies \yvar{y} &= \frac{4}{3} \\[1ex] \text{Top row:} \\ \xvar{x} + 4\left(\yvar{\frac{4}{3}}\right) - 2(\zvar{3}) &= 5 \\ \implies \xvar{x} - \frac{2}{3} &= 5 \\ \implies \xvar{x} &= \frac{17}{3} \end{aligned}
Solve the lower triangular system by forward substitutionStart at the top row where two zeros eliminate y\yvar{y} and z\zvar{z}, then plug each variable you find downward into the next row.
[200−140325]⏟lower triangular L[xyz]=[8427]\displaystyle \underbrace{\begin{bmatrix} \diagonal{2} & 0 & 0 \\ -1 & \diagonal{4} & 0 \\ 3 & 2 & \diagonal{5} \end{bmatrix}}_{\text{lower triangular } L} \begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} 8 \\ 4 \\ 27 \end{bmatrix}
Top row:2x=8  ⟹  x=4Middle row:−1(4)+4y=4  ⟹  4y=8  ⟹  y=2Bottom row:3(4)+2(2)+5z=27  ⟹  16+5z=27  ⟹  5z=11  ⟹  z=115\displaystyle \begin{aligned} \text{Top row:} \\ \diagonal{2}\xvar{x} &= 8 \\ \implies \xvar{x} &= 4 \\[1ex] \text{Middle row:} \\ {-1}(\xvar{4}) + \diagonal{4}\yvar{y} &= 4 \\ \implies \diagonal{4}\yvar{y} &= 8 \\ \implies \yvar{y} &= 2 \\[1ex] \text{Bottom row:} \\ 3(\xvar{4}) + 2(\yvar{2}) + \diagonal{5}\zvar{z} &= 27 \\ \implies 16 + \diagonal{5}\zvar{z} &= 27 \\ \implies \diagonal{5}\zvar{z} &= 11 \\ \implies \zvar{z} &= \frac{11}{5} \end{aligned}
5

Why the Main Diagonal Controls Triangular Matrices

Even though a triangular matrix has non-zero entries off the diagonal that mix the variables in one direction, we never had to divide by any of those off-diagonal numbers when solving. Let's see how the main diagonal alone decides whether a triangular system can be solved, and how it behaves when we multiply two upper triangular matrices, [23104−2005][31402600−1]\begin{bmatrix} \diagonal{2} & 3 & 1 \\ 0 & \diagonal{4} & -2 \\ 0 & 0 & \diagonal{5} \end{bmatrix}\begin{bmatrix} \diagonal{3} & 1 & 4 \\ 0 & \diagonal{2} & 6 \\ 0 & 0 & \diagonal{-1} \end{bmatrix}.

Why the Main Diagonal Controls Triangular Matrices
2\htmlClass{lc-blue}{2}
33
11
00
4\htmlClass{lc-blue}{4}
−2-2
00
00
5\htmlClass{lc-blue}{5}
3\htmlClass{lc-blue}{3}
11
44
00
2\htmlClass{lc-blue}{2}
66
00
00
−1\htmlClass{lc-blue}{-1}
=?= \mathord{?}
Text solution
Divide only by the main diagonal entries (the pivots)In forward or back-substitution, off-diagonal numbers only multiply variables we already know and get subtracted to the other side, so a triangular system is guaranteed a unique solution whenever every entry on its main diagonal is non-zero.
Pair a row and column to find a diagonal entry of the productIn the middle diagonal spot (Row 2 times Column 2), the zeros below the diagonal multiply the off-diagonal terms on both ends by zero, leaving only the two middle diagonal numbers multiplied together.
[04−2][120]=(0⋅1)+(4⋅2)+(−2⋅0)=8\displaystyle \begin{bmatrix} 0 & \diagonal{4} & -2 \end{bmatrix} \begin{bmatrix} 1 \\ \diagonal{2} \\ 0 \end{bmatrix} = (0 \cdot 1) + (\diagonal{4} \cdot \diagonal{2}) + (-2 \cdot 0) = 8
Multiply the main diagonals straight acrossBecause the zeros below the diagonal multiply every number by zero in the entries below the diagonal, and every off-diagonal number by zero in the entries on the diagonal, the product stays upper triangular and its main diagonal is the product of the two old main diagonals. (Here ∗* marks the upper off-diagonal entries where products are non-zero and add up, which we don't need to compute to know the diagonal.)
[23104−2005][31402600−1]=[2⋅3∗∗04⋅2∗005⋅(−1)]=[6∗∗08∗00−5]\displaystyle \begin{aligned} &\begin{bmatrix} \diagonal{2} & 3 & 1 \\ 0 & \diagonal{4} & -2 \\ 0 & 0 & \diagonal{5} \end{bmatrix} \begin{bmatrix} \diagonal{3} & 1 & 4 \\ 0 & \diagonal{2} & 6 \\ 0 & 0 & \diagonal{-1} \end{bmatrix} \\ &= \begin{bmatrix} \diagonal{2} \cdot \diagonal{3} & * & * \\ 0 & \diagonal{4} \cdot \diagonal{2} & * \\ 0 & 0 & \diagonal{5} \cdot (\diagonal{-1}) \end{bmatrix} \\ &= \begin{bmatrix} \diagonal{6} & * & * \\ 0 & \diagonal{8} & * \\ 0 & 0 & \diagonal{-5} \end{bmatrix} \end{aligned}

In the product of two upper triangular matrices, every entry below the main diagonal pairs non-zero numbers against zeros, and on the main diagonal every off-diagonal term gets multiplied by zero so only the matching diagonal pair is left.

When you multiply two upper triangular matrices, the zeros below the diagonal make every lower entry zero and leave each main diagonal entry as just the product of the two matching diagonal numbers.
6

Untangling a Matrix: From A to U to D to I

Now we can put all three shapes (upper triangular UU, diagonal DD, and identity II) into a single picture: they are the exact stages of untangling a general square matrix AA by elimination.

Untangling a Matrix: From A to U to D to I
UU
00
00
00
DD
00
00
00
00
00
00
II
1\htmlClass{lc-blue}{1}
00
00
00
1\htmlClass{lc-blue}{1}
00
00
00
1\htmlClass{lc-blue}{1}
AA
Two-way tangle\text{Two-way tangle}
UU
00
00
00
One-way upward flow\text{One-way upward flow}
DD
00
00
00
00
00
00
Variables isolated\text{Variables isolated}
II
1\htmlClass{lc-blue}{1}
00
00
00
1\htmlClass{lc-blue}{1}
00
00
00
1\htmlClass{lc-blue}{1}
Solved (pivots=1)\text{Solved (pivots} = 1\text{)}

When every column has a non-zero pivot on the main diagonal of UU, we don't have to stop at UU and back-substitute. We can keep eliminating upward all the way to II:

A→eliminate below diagonalU→eliminate above diagonalD→divide rows by pivotsI\displaystyle A \xrightarrow{\text{eliminate below diagonal}} U \xrightarrow{\text{eliminate above diagonal}} D \xrightarrow{\text{divide rows by pivots}} I

Along the elimination path from AA to II, clearing the lower triangle turns a system where every variable depends on the others into one you can solve from the bottom up (UU), clearing the upper triangle isolates each variable on its own row (DD), and dividing by the pivots scales the diagonal to 1\diagonal{1}s (II).

Each stage of elimination turns another part of the matrix to zero, untangling a loop of variables into a one-way chain and then into three separate answers.

Key concepts

Everything here comes down to how zeros off the main diagonal stop variables from mixing:

Diagonal matrices (DD) act on each diagonal entry alone

When all off-diagonal entries are zero, products and powers multiply straight across the main diagonal (D4D^4 raises each diagonal entry to the 4th4\text{th} power), and the inverse D−1D^{-1} flips each diagonal entry ([400−12]−1=[1400−2]\begin{bmatrix} \diagonal{4} & 0 \\ 0 & \diagonal{-\tfrac{1}{2}} \end{bmatrix}^{-1} = \begin{bmatrix} \diagonal{\tfrac{1}{4}} & 0 \\ 0 & \diagonal{-2} \end{bmatrix}) as long as no diagonal entry is 0\lost{0}. If any diagonal entry is 0\lost{0}, that variable is multiplied by 0\lost{0} and no inverse exists.

Multiplying a full matrix by DD depends on the side

Put DD on the left (DADA) to scale the rows of AA; put DD on the right (ADAD) to scale the columns of AA.

Triangular systems (Ux=bUx = b and Lx=bLx = b) untangle from the one-variable row

Start at the bottom row of an upper triangular matrix UU and back-substitute upward, or start at the top row of a lower triangular matrix LL and forward-substitute downward. Alternatively, from UU, eliminate upward to DD and divide each row by its pivot to reach II.

When to ignore the off-diagonal entries

During substitution you only ever divide by the main diagonal entries (the pivots). To check whether a triangular system has a unique solution, ignore the off-diagonal entries: zeros off the diagonal in [300−2]\begin{bmatrix} \diagonal{3} & 0 \\ 0 & \diagonal{-2} \end{bmatrix} do not hurt, whereas a 0\lost{0} on the main diagonal means there is no unique solution. Likewise, if you only need the main diagonal of U1U2U_1 U_2 or U13U_1^3, don't multiply out the full matrices; just multiply or raise the main diagonal entries straight across.

7

Practice

1

Let D=[2000−10003]D = \begin{bmatrix} 2 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 3 \end{bmatrix}. Find D4D^4 and use it to compute D4[15−1]D^4\begin{bmatrix} 1 \\ 5 \\ -1 \end{bmatrix}.

Since DD has zeros off the diagonal, what happens to each diagonal scaling factor when you apply DD four times in a row?

Raise each entry on the main diagonal to the 4th4\text{th} power (be careful to raise to the 4th4\text{th} power rather than multiplying by 44, which would give [8−20−12]\begin{bmatrix} 8 \\ -20 \\ -12 \end{bmatrix}, and remember that (−1)4=+1(\diagonal{-1})^4 = +1 rather than −1-1, which would give [16−5−81]\begin{bmatrix} 16 \\ -5 \\ -81 \end{bmatrix}):
D4=[24000(−1)400034]=[16000100081],D4[15−1]=[165−81]\displaystyle \begin{aligned} D^4 &= \begin{bmatrix} \diagonal{2}^4 & 0 & 0 \\ 0 & (\diagonal{-1})^4 & 0 \\ 0 & 0 & \diagonal{3}^4 \end{bmatrix} \\ &= \begin{bmatrix} 16 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 81 \end{bmatrix}, \\ D^4\begin{bmatrix} 1 \\ 5 \\ -1 \end{bmatrix} &= \begin{bmatrix} 16 \\ 5 \\ -81 \end{bmatrix} \end{aligned}
2

Find the inverse of D=[4000−120005]D = \begin{bmatrix} 4 & 0 & 0 \\ 0 & -\tfrac{1}{2} & 0 \\ 0 & 0 & 5 \end{bmatrix}, and explain why E=[400000005]E = \begin{bmatrix} 4 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 5 \end{bmatrix} does not have an inverse by looking at E[xyz]E\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix}.

How do you undo multiplying a variable by its diagonal number, and what happens to y\yvar{y} in the middle row of E[xyz]E\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix}?

Flip each number on the main diagonal of DD (watch the sign on −12\diagonal{-\tfrac{1}{2}}: taking the reciprocal keeps the negative sign to give −2-2, whereas dropping the minus sign gives the wrong matrix [14000200015]\begin{bmatrix} \tfrac{1}{4} & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & \tfrac{1}{5} \end{bmatrix}):
D−1=[14000−200015]\displaystyle D^{-1} = \begin{bmatrix} \tfrac{1}{4} & 0 & 0 \\ 0 & -2 & 0 \\ 0 & 0 & \tfrac{1}{5} \end{bmatrix}
For EE, leaving the middle entry as 0\lost{0} to write [14000000015]\begin{bmatrix} \tfrac{1}{4} & 0 & 0 \\ 0 & \lost{0} & 0 \\ 0 & 0 & \tfrac{1}{5} \end{bmatrix} does not undo EE: EE has no inverse because E[xyz]=[4x05z]E\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} \diagonal{4}\xvar{x} \\ \lost{0} \\ \diagonal{5}\zvar{z} \end{bmatrix} turns y\yvar{y} into 0\lost{0} no matter what value it started with, losing that value so it cannot be recovered.
3

Let D=[3000−20004]D = \begin{bmatrix} 3 & 0 & 0 \\ 0 & -2 & 0 \\ 0 & 0 & 4 \end{bmatrix} and A=[12−1302−215]A = \begin{bmatrix} 1 & 2 & -1 \\ 3 & 0 & 2 \\ -2 & 1 & 5 \end{bmatrix}. Compute both DADA and ADAD.

Check which side of AA the diagonal matrix DD sits on. Which side scales the rows of AA, and which side scales the columns?

Don't swap the row and column rules (scaling columns first would trade the answers for DADA and ADAD).
DADA scales the rows of AA by 3\diagonal{3}, −2\diagonal{-2}, and 4\diagonal{4} to give:
DA=[36−3−60−4−8420]\displaystyle DA = \begin{bmatrix} 3 & 6 & -3 \\ -6 & 0 & -4 \\ -8 & 4 & 20 \end{bmatrix}
ADAD scales the columns of AA by 3\diagonal{3}, −2\diagonal{-2}, and 4\diagonal{4} to give:
AD=[3−4−4908−6−220]\displaystyle AD = \begin{bmatrix} 3 & -4 & -4 \\ 9 & 0 & 8 \\ -6 & -2 & 20 \end{bmatrix}
4

Solve the upper triangular system [13−202100−3][xyz]=[45−6]\begin{bmatrix} 1 & 3 & -2 \\ 0 & 2 & 1 \\ 0 & 0 & -3 \end{bmatrix}\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} 4 \\ 5 \\ -6 \end{bmatrix} using back-substitution.

Which row already has two zeros eliminating the other variables? Start there and plug your answer upward one row at a time.

From the bottom row, −3z=−6\diagonal{-3}\zvar{z} = -6 so z=2\zvar{z} = 2. Plugging z=2\zvar{z} = 2 into the middle row gives 2y+2=5\diagonal{2}\yvar{y} + 2 = 5, so y=32\yvar{y} = \tfrac{3}{2}. Plugging y=32\yvar{y} = \tfrac{3}{2} and z=2\zvar{z} = 2 into the top row gives x+92−4=4\xvar{x} + \tfrac{9}{2} - 4 = 4 (watch the negative sign on −2z=−4-2\zvar{z} = -4; treating it as +4+4 gives x=−92\xvar{x} = -\tfrac{9}{2}), so x=72\xvar{x} = \tfrac{7}{2}.
5

Solve the lower triangular system [3002−40−132][xyz]=[−647]\begin{bmatrix} 3 & 0 & 0 \\ 2 & -4 & 0 \\ -1 & 3 & 2 \end{bmatrix}\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} -6 \\ 4 \\ 7 \end{bmatrix} using forward substitution.

Which row of a lower triangular matrix leaves a single variable by itself right away? Start there and plug your answer downward one row at a time.

From the top row, 3x=−6\diagonal{3}\xvar{x} = -6 so x=−2\xvar{x} = -2. Plugging x=−2\xvar{x} = -2 into the middle row gives −4−4y=4-4 - \diagonal{4}\yvar{y} = 4 (watch the minus signs when isolating y\yvar{y}: adding 44 to both sides gives −4y=8\diagonal{-4}\yvar{y} = 8, whereas dropping the negative on −4y\diagonal{-4}\yvar{y} gives y=2\yvar{y} = 2 and leads to z=−12\zvar{z} = -\tfrac{1}{2}), so y=−2\yvar{y} = -2. Plugging x=−2\xvar{x} = -2 and y=−2\yvar{y} = -2 into the bottom row gives 2−6+2z=72 - 6 + \diagonal{2}\zvar{z} = 7, so z=112\zvar{z} = \tfrac{11}{2}.
6

Without solving, determine which of these two upper triangular systems is guaranteed a unique solution for every right-hand side [b1b2b3]\begin{bmatrix} b_1 \\ b_2 \\ b_3 \end{bmatrix}, and explain why: System 1 has matrix U1=[3090−20005]U_1 = \begin{bmatrix} 3 & 0 & 9 \\ 0 & -2 & 0 \\ 0 & 0 & 5 \end{bmatrix}, and System 2 has matrix U2=[349007005]U_2 = \begin{bmatrix} 3 & 4 & 9 \\ 0 & 0 & 7 \\ 0 & 0 & 5 \end{bmatrix}.

When you solve an upper triangular system by back-substitution, which numbers in the matrix do you actually divide by?

Don't be misled by the extra zeros above the diagonal in U1U_1 (rejecting System 1 because of those off-diagonal zeros is a mistake, because off-diagonal entries only multiply known variables and are never divided by). System 1 is guaranteed a unique solution because every entry on its main diagonal (3,−2,5\diagonal{3}, \diagonal{-2}, \diagonal{5}) is non-zero, and back-substitution only ever divides by the main diagonal entries. System 2 does not have a unique solution because the 0\lost{0} in the middle of its main diagonal means a pivot is missing, so you cannot divide to solve for the second unknown, x2\yvar{x_2}.
7

Let U1=[25−90−38004]U_1 = \begin{bmatrix} 2 & 5 & -9 \\ 0 & -3 & 8 \\ 0 & 0 & 4 \end{bmatrix} and U2=[−17602−5003]U_2 = \begin{bmatrix} -1 & 7 & 6 \\ 0 & 2 & -5 \\ 0 & 0 & 3 \end{bmatrix}. Without computing the entries above the diagonal, find all entries on and below the main diagonal of the product U1U2U_1 U_2, and find the main diagonal of U13U_1^3.

How do the zeros below the main diagonal affect the entries on and below the diagonal when you multiply upper triangular matrices?

All entries below the main diagonal of U1U2U_1 U_2 are 00 because the product of two upper triangular matrices is still upper triangular. Its main diagonal is found by multiplying the two main diagonals straight across: 2(−1)=−2\diagonal{2}(\diagonal{-1}) = -2, (−3)(2)=−6(\diagonal{-3})(\diagonal{2}) = -6, and 4(3)=12\diagonal{4}(\diagonal{3}) = 12. Similarly, the main diagonal of U13U_1^3 has entries 23=8\diagonal{2}^3 = 8, (−3)3=−27(\diagonal{-3})^3 = -27 (watch the odd power: (−3)3(\diagonal{-3})^3 stays negative at −27-27, not +27+27), and 43=64\diagonal{4}^3 = 64.
8

Downward elimination on a system has produced the upper triangular matrix U=[32−4026002]U = \begin{bmatrix} 3 & 2 & -4 \\ 0 & 2 & 6 \\ 0 & 0 & 2 \end{bmatrix} with right-hand side [684]\begin{bmatrix} 6 \\ 8 \\ 4 \end{bmatrix}. Instead of using back-substitution, eliminate upward to turn UU into a diagonal matrix DD, then divide each row by its pivot to reach the identity matrix II and find [xyz]\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix}.

Use the bottom pivot in Column 3 first to clear the entries above it in Rows 2 and 1, and make sure to apply every row operation to the right-hand side vector too.

First use the bottom pivot row [0024]\left[\begin{array}{ccc|c} 0 & 0 & \diagonal{2} & 4 \end{array}\right] to eliminate upward in column 3 (be sure to update the right-hand side at every step; leaving [684]\begin{bmatrix} 6 \\ 8 \\ 4 \end{bmatrix} unchanged and dividing by the pivots 3,2,2\diagonal{3}, \diagonal{2}, \diagonal{2} gives the wrong answer [242]\begin{bmatrix} 2 \\ 4 \\ 2 \end{bmatrix}): subtract 33 times Row 3 from Row 2 to get [020−4]\left[\begin{array}{ccc|c} 0 & \diagonal{2} & 0 & -4 \end{array}\right], and add 22 times Row 3 to Row 1 to get [32014]\left[\begin{array}{ccc|c} \diagonal{3} & 2 & 0 & 14 \end{array}\right]. Next use the new middle row [020−4]\left[\begin{array}{ccc|c} 0 & \diagonal{2} & 0 & -4 \end{array}\right] to eliminate upward in column 2: subtract Row 2 from Row 1 (watch the double negative on the right-hand side: 14−(−4)=1814 - (-4) = 18, whereas subtracting 44 to get 1010 gives x=103\xvar{x} = \tfrac{10}{3}) to get [30018]\left[\begin{array}{ccc|c} \diagonal{3} & 0 & 0 & 18 \end{array}\right], reaching the diagonal system D=[300020002]D = \begin{bmatrix} \diagonal{3} & 0 & 0 \\ 0 & \diagonal{2} & 0 \\ 0 & 0 & \diagonal{2} \end{bmatrix} with right-hand side [18−44]\begin{bmatrix} 18 \\ -4 \\ 4 \end{bmatrix}. Finally, divide the rows by their pivots 3\diagonal{3}, 2\diagonal{2}, and 2\diagonal{2} to get I=[100010001]I = \begin{bmatrix} \diagonal{1} & 0 & 0 \\ 0 & \diagonal{1} & 0 \\ 0 & 0 & \diagonal{1} \end{bmatrix} and the solution [xyz]=[6−22]\begin{bmatrix} \xvar{x} \\ \yvar{y} \\ \zvar{z} \end{bmatrix} = \begin{bmatrix} 6 \\ -2 \\ 2 \end{bmatrix}.