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 1 in matrix multiplication. To see how we stop variables from mixing, what must a 3×3 matrix look like so that feeding in xyz gives back the exact same xyz?
The Identity Matrix
?????????xyz=xyz
Text solution
Stop the variables from mixing in each rowPut 1 in the column matching that row's own variable and 0 in the other two spots so the remaining variables are multiplied by 0.
100010001xyz=1x+0y+0z0x+1y+0z0x+0y+1z
Pass each variable straight throughWith 1s down the main diagonal and 0s everywhere else, multiplying any vector or matrix by I leaves it unchanged.
identity matrix I100010001xyz=xyz
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,y, and z by different amounts while still keeping them separate, we use a diagonal matrix, which replaces the 1s on the main diagonal with scaling numbers and keeps 0s everywhere else. Let's see how D=20005000−3 acts on a vector, and how it makes products, high powers like D100, and the inverse D−1 immediate.
Diagonal Matrices, Powers, and Inverses
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.
Multiply and take powers straight across the diagonalMultiplying a vector by one diagonal matrix after another, or by D a hundred times in a row, multiplies each variable's scaling factor on its own.
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=2100051000−31
Check for zeros on the diagonalA 0 on the main diagonal turns that variable into 0 no matter what value it started with, losing that value so no inverse matrix can bring it back.
200050000xyz=2x5y0
In a 3D transformation by a diagonal matrix D, 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−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 D multiplies a full matrix A? Let's multiply A=121213342 by D=20005000−3 on the left (DA) and compare it with multiplying on the right (AD).
Multiplying by a Diagonal Matrix: Rows vs. Columns
Text solution
Multiply on the left (DA) to scale the rowsEach row of D has a single non-zero number on the diagonal, which picks out and scales the matching row of A.
Multiply on the right (AD) to scale the columnsEach column of D has a single non-zero number on the diagonal, which picks out and scales the matching column of A.
When the diagonal matrix D sits on the left of A, each diagonal entry multiplies straight across its matching row; when the exact same D sits on the right of A, 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 requires y and z, while finding y requires x and 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.
Now let's solve an upper triangular system Uxyz=576 from the bottom up, and a lower triangular system Lxyz=8427 from the top down.
Upper and Lower Triangular Matrices
Text solution
Solve the upper triangular system by back-substitutionStart at the bottom row where two zeros eliminate x and y, then plug each variable you find upward into the next row.
Solve the lower triangular system by forward substitutionStart at the top row where two zeros eliminate y and z, then plug each variable you find downward into the next row.
lower triangular L2−13042005xyz=8427
Top row:2x⟹xMiddle row:−1(4)+4y⟹4y⟹yBottom row:3(4)+2(2)+5z⟹16+5z⟹5z⟹z=8=4=4=8=2=27=27=11=511
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, 2003401−2530012046−1.
Why the Main Diagonal Controls Triangular Matrices
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
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.)
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 U, diagonal D, and identity I) into a single picture: they are the exact stages of untangling a general square matrix A by elimination.
Untangling a Matrix: From A to U to D to I
When every column has a non-zero pivot on the main diagonal of U, we don't have to stop at U and back-substitute. We can keep eliminating upward all the way to I:
Aeliminate below diagonalUeliminate above diagonalDdivide rows by pivotsI
Along the elimination path from A to I, clearing the lower triangle turns a system where every variable depends on the others into one you can solve from the bottom up (U), clearing the upper triangle isolates each variable on its own row (D), and dividing by the pivots scales the diagonal to 1s (I).
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 (D) act on each diagonal entry alone
When all off-diagonal entries are zero, products and powers multiply straight across the main diagonal (D4 raises each diagonal entry to the 4th power), and the inverse D−1 flips each diagonal entry ([400−21]−1=[4100−2]) as long as no diagonal entry is 0. If any diagonal entry is 0, that variable is multiplied by 0 and no inverse exists.
Multiplying a full matrix by D depends on the side
Put D on the left (DA) to scale the rows of A; put D on the right (AD) to scale the columns of A.
Triangular systems (Ux=b and Lx=b) untangle from the one-variable row
Start at the bottom row of an upper triangular matrix U and back-substitute upward, or start at the top row of a lower triangular matrix L and forward-substitute downward. Alternatively, from U, eliminate upward to D and divide each row by its pivot to reach I.
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] do not hurt, whereas a 0 on the main diagonal means there is no unique solution. Likewise, if you only need the main diagonal of U1U2 or U13, don't multiply out the full matrices; just multiply or raise the main diagonal entries straight across.
7
Practice
1
Let D=2000−10003. Find D4 and use it to compute D415−1.
Be careful to raise to the 4th power rather than multiplying by 4, which would give 8−20−12.
Since D has zeros off the diagonal, what happens to each diagonal scaling factor when you apply D four times in a row?
Raise each entry on the main diagonal to the 4th power (be careful to raise to the 4th power rather than multiplying by 4, which would give 8−20−12, and remember that (−1)4=+1 rather than −1, which would give 16−5−81):
Find the inverse of D=4000−210005, and explain why E=400000005 does not have an inverse by looking at Exyz.
How do you undo multiplying a variable by its diagonal number, and what happens to y in the middle row of Exyz?
Flip each number on the main diagonal of D (watch the sign on −21: taking the reciprocal keeps the negative sign to give −2, whereas dropping the minus sign gives the wrong matrix 41000200051):
D−1=41000−200051
For E, leaving the middle entry as 0 to write 41000000051 does not undo E:E has no inverse because Exyz=4x05z turns y into 0 no matter what value it started with, losing that value so it cannot be recovered.
3
Let D=3000−20004 and A=13−2201−125. Compute both DA and AD.
Check which side of A the diagonal matrix D sits on. Which side scales the rows of A, and which side scales the columns?
Don't swap the row and column rules (scaling columns first would trade the answers for DA and AD).
DA scales the rows of A by 3,−2, and 4 to give:
DA=3−6−8604−3−420
AD scales the columns of A by 3,−2, and 4 to give:
AD=39−6−40−2−4820
4
Solve the upper triangular system 100320−21−3xyz=45−6 using back-substitution.
Watch the negative sign on −2z=−4; treating it as +4 gives x=−29.
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 so z=2. Plugging z=2 into the middle row gives 2y+2=5, so y=23. Plugging y=23 and z=2 into the top row gives x+29−4=4 (watch the negative sign on −2z=−4; treating it as +4 gives x=−29), so x=27.
5
Solve the lower triangular system 32−10−43002xyz=−647 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 so x=−2. Plugging x=−2 into the middle row gives −4−4y=4 (watch the minus signs when isolating y: adding 4 to both sides gives −4y=8, whereas dropping the negative on −4y gives y=2 and leads to z=−21), so y=−2. Plugging x=−2 and y=−2 into the bottom row gives 2−6+2z=7, so z=211.
6
Without solving, determine which of these two upper triangular systems is guaranteed a unique solution for every right-hand side b1b2b3, and explain why: System 1 has matrix U1=3000−20905, and System 2 has matrix U2=300400975.
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 U1 (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) 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 in the middle of its main diagonal means a pivot is missing, so you cannot divide to solve for the second unknown, x2.
7
Let U1=2005−30−984 and U2=−1007206−53. Without computing the entries above the diagonal, find all entries on and below the main diagonal of the product U1U2, and find the main diagonal of U13.
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 U1U2 are 0 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,(−3)(2)=−6, and 4(3)=12. Similarly, the main diagonal of U13 has entries 23=8,(−3)3=−27 (watch the odd power: (−3)3 stays negative at −27, not +27), and 43=64.
8
Downward elimination on a system has produced the upper triangular matrix U=300220−462 with right-hand side 684. Instead of using back-substitution, eliminate upward to turn U into a diagonal matrix D, then divide each row by its pivot to reach the identity matrix I and find xyz.
Be sure to update the right-hand side at every step; leaving 684 unchanged and dividing by the pivots 3,2,2 gives the wrong answer 242.Watch the double negative on the right-hand side: 14−(−4)=18, whereas subtracting 4 to get 10 gives x=310.
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] to eliminate upward in column 3 (be sure to update the right-hand side at every step; leaving 684 unchanged and dividing by the pivots 3,2,2 gives the wrong answer 242): subtract 3 times Row 3 from Row 2 to get [020−4], and add 2 times Row 3 to Row 1 to get [32014]. Next use the new middle row [020−4] to eliminate upward in column 2: subtract Row 2 from Row 1 (watch the double negative on the right-hand side: 14−(−4)=18, whereas subtracting 4 to get 10 gives x=310) to get [30018], reaching the diagonal system D=300020002 with right-hand side 18−44. Finally, divide the rows by their pivots 3,2, and 2 to get I=100010001 and the solution xyz=6−22.