PrecalculusSystems of Equations and Matrices4 of 6
Systems of Equations and Matrices · 4

Matrix Operations

When we work with a system of equations, we spend most of our time copying the variables x\unknown{x}, y\unknown{y}, and z\unknown{z} over and over when only the numbers in front of them are changing.

1

Matrices, Dimensions, and Entries

A matrix is a grid of numbers where each number's position (its row and column) tells us what it stands for. To work with matrices, we need a standard way to state the size of a grid, point to a single number inside it, and tell when two matrices are equal.

Matrices, Dimensions, and Entries
3x+2y=12\displaystyle {\hspace{3.9em}\mathllap{3\htmlClass{lc-green}{x} + 2\htmlClass{lc-green}{y}} = \mathrlap{12}\hspace{1.1em}}
5x−1y=7\displaystyle {\hspace{3.9em}\mathllap{5\htmlClass{lc-green}{x} - 1\htmlClass{lc-green}{y}} = \mathrlap{7}\hspace{1.1em}}
2x+4y+1z=10\displaystyle {\rule{0pt}{1.5em}\hspace{5.9em}\mathllap{2\htmlClass{lc-green}{x} + 4\htmlClass{lc-green}{y} + 1\htmlClass{lc-green}{z}} = \mathrlap{10}\hspace{1.1em}}
1x+0y+3z=5\displaystyle {\hspace{5.9em}\mathllap{1\htmlClass{lc-green}{x} + 0\htmlClass{lc-green}{y} + 3\htmlClass{lc-green}{z}} = \mathrlap{5}\hspace{1.1em}}
4x−2y+2z=8\displaystyle {\hspace{5.9em}\mathllap{4\htmlClass{lc-green}{x} - 2\htmlClass{lc-green}{y} + 2\htmlClass{lc-green}{z}} = \mathrlap{8}\hspace{1.1em}}
A=A =
55
22
99
11
88
44
1\htmlClass{lc-pink}{1}
2\htmlClass{lc-pink}{2}
3\htmlClass{lc-pink}{3}
1\htmlClass{lc-blue}{1}
2\htmlClass{lc-blue}{2}
a13=9a_{\htmlClass{lc-blue}{1}\htmlClass{lc-pink}{3}} = 9
Row 1, Column 3\htmlClass{lc-blue}{\text{Row 1}}\text{, }\htmlClass{lc-pink}{\text{Column 3}}
a21=1a_{\htmlClass{lc-blue}{2}\htmlClass{lc-pink}{1}} = 1
Row 2, Column 1\htmlClass{lc-blue}{\text{Row 2}}\text{, }\htmlClass{lc-pink}{\text{Column 1}}

We name a matrix with a capital letter like AA and point to an entry inside it with a lowercase letter and its row-then-column address:

A=[529184],arow, col⟶a13=9,a21=1\displaystyle \begin{aligned} &A = \begin{bmatrix} 5 & 2 & 9 \\ 1 & 8 & 4 \end{bmatrix}, \\ &a_{\row{\text{row}}\text{, }\col{\text{col}}} \longrightarrow a_{\row{1}\col{3}} = 9, \quad a_{\row{2}\col{1}} = 1 \end{aligned}

Read a13a_{\row{1}\col{3}} as "a one-three" (Row 1, Column 3), not "a thirteen."

Two matrices are equal only when they have the exact same dimensions and their matching entries are equal in every spot, which lets us solve for missing entries inside equal matrices:

[x29183y]=[5291812]\displaystyle \begin{bmatrix} \unknown{x} & 2 & 9 \\ 1 & 8 & 3\unknown{y} \end{bmatrix} = \begin{bmatrix} 5 & 2 & 9 \\ 1 & 8 & 12 \end{bmatrix}
Text solution
Match Row 1, Column 1Since both matrices are 2×3\row{2} \times \col{3} and all the other entries already match, the top-left entries must be equal.
x\displaystyle \unknown{x} =5\displaystyle = 5
Match Row 2, Column 3Setting the bottom-right entries equal gives a one-step equation for y\unknown{y}.
3y=12y=4\displaystyle \begin{aligned} 3\unknown{y} &= 12 \\ \unknown{y} &= 4 \end{aligned}
2

Adding, Subtracting, and Scaling Matrices

Now we want to combine two matrices of data or multiply a whole matrix by a single number at once.

Adding, Subtracting, and Scaling Matrices
bread\text{bread}
pies\text{pies}
cakes\text{cakes}
Downtown\text{Downtown}
Uptown\text{Uptown}
55
22
99
11
88
44
Saturday\text{Saturday}
++
33
44
11
22
00
55
Sunday\text{Sunday}

Addition and subtraction combine matching spots directly, so both matrices must have the exact same dimensions:

[529184]+[341205]=[5+32+49+11+28+04+5]=[8610389]\displaystyle \begin{bmatrix} 5 & 2 & 9 \\ 1 & 8 & 4 \end{bmatrix} + \begin{bmatrix} 3 & 4 & 1 \\ 2 & 0 & 5 \end{bmatrix} = \begin{bmatrix} 5+3 & 2+4 & 9+1 \\ 1+2 & 8+0 & 4+5 \end{bmatrix} = \begin{bmatrix} 8 & 6 & 10 \\ 3 & 8 & 9 \end{bmatrix}

Multiplying a matrix by a single number out in front multiplies every entry inside by that number:

3⏟scalar[529184]=[1562732412]\displaystyle \underbrace{\scalar{3}}_{\scalar{\text{scalar}}}\begin{bmatrix} 5 & 2 & 9 \\ 1 & 8 & 4 \end{bmatrix} = \begin{bmatrix} 15 & 6 & 27 \\ 3 & 24 & 12 \end{bmatrix}

When an equation combines scaling and addition, we can find an unknown entry by tracking just its position across the equation:

2[x3]+[14]=[910]\displaystyle \scalar{2}\begin{bmatrix} \unknown{x} \\ 3 \end{bmatrix} + \begin{bmatrix} 1 \\ 4 \end{bmatrix} = \begin{bmatrix} 9 \\ 10 \end{bmatrix}
Text solution
Write the top-row equationScaling and adding the top entries on the left must equal the top entry on the right.
2x+1\displaystyle \scalar{2}\unknown{x} + 1 =9\displaystyle = 9
Solve for x\unknown{x}Subtract 11 and divide by 2\scalar{2} to get x\unknown{x} by itself.
2x=8x=4\displaystyle \begin{aligned} \scalar{2}\unknown{x} &= 8 \\ \unknown{x} &= 4 \end{aligned}
3

Multiplying Matrices

Entry-by-entry arithmetic works when two matrices represent the same kind of table, like Saturday sales and Sunday sales. When we multiply two matrices, the first matrix holds smoothie recipes across its rows and the second holds ingredient prices down its columns, so we need a way to combine each row with each column:

[213122][234112]\displaystyle \begin{bmatrix} 2 & 1 & 3 \\ 1 & 2 & 2 \end{bmatrix}\begin{bmatrix} 2 & 3 \\ 4 & 1 \\ 1 & 2 \end{bmatrix}
Multiplying Matrices
Fruit\text{Fruit}
Protein\text{Protein}
Juice\text{Juice}
Berry\text{Berry}
Tropical\text{Tropical}
22
11
33
11
22
22
⋅\cdot
Store A\text{Store A}
22
44
11
Fruit\text{Fruit}
Protein\text{Protein}
Juice\text{Juice}
Text solution
Combine Row 1 with Columns 1 and 2Walk across Row 1 of the first matrix and down each column of the second, multiplying paired numbers and adding them up to fill the top row of the answer.
c11=(2×2)+(1×4)+(3×1)=4+4+3=11c12=(2×3)+(1×1)+(3×2)=6+1+6=13\displaystyle \begin{aligned} c_{\row{1}\col{1}} &= (\row{2} \times \col{2}) + (\row{1} \times \col{4}) + (\row{3} \times \col{1}) \\ &= 4 + 4 + 3 = 11 \\ c_{\row{1}\col{2}} &= (\row{2} \times \col{3}) + (\row{1} \times \col{1}) + (\row{3} \times \col{2}) \\ &= 6 + 1 + 6 = 13 \end{aligned}
Combine Row 2 with Columns 1 and 2Walk across Row 2 of the first matrix and down each column of the second to fill the bottom row of the answer.
c21=(1×2)+(2×4)+(2×1)=2+8+2=12c22=(1×3)+(2×1)+(2×2)=3+2+4=9\displaystyle \begin{aligned} c_{\row{2}\col{1}} &= (\row{1} \times \col{2}) + (\row{2} \times \col{4}) + (\row{2} \times \col{1}) \\ &= 2 + 8 + 2 = 12 \\ c_{\row{2}\col{2}} &= (\row{1} \times \col{3}) + (\row{2} \times \col{1}) + (\row{2} \times \col{2}) \\ &= 3 + 2 + 4 = 9 \end{aligned}

Putting the four totals into their row-and-column spots gives the 2×2\row{2} \times \col{2} product showing the cost of each smoothie at each store:

[213122][234112]=[1113129]\displaystyle \begin{bmatrix} 2 & 1 & 3 \\ 1 & 2 & 2 \end{bmatrix}\begin{bmatrix} 2 & 3 \\ 4 & 1 \\ 1 & 2 \end{bmatrix} = \begin{bmatrix} 11 & 13 \\ 12 & 9 \end{bmatrix}

Each spot in the product matrix comes from pairing the matching row of the first matrix with the matching column of the second matrix.

Every slot in the product matrix combines its matching row from the first matrix with its matching column from the second matrix.
4

When Multiplication Works and Why Order Matters

Because multiplication walks across a row of the first matrix and down a column of the second, we need to know when two matrices have sizes that can pair up, and whether multiplying A⋅BA \cdot B gives the same answer as B⋅AB \cdot A.

When Multiplication Works and Why Order Matters
A=[1203]B=[4012]\displaystyle {A = \begin{bmatrix} 1 & 2 \\ 0 & 3 \end{bmatrix} \qquad B = \begin{bmatrix} 4 & 0 \\ 1 & 2 \end{bmatrix}}
AB=?BA\displaystyle AB \overset{?}{=} BA
(4×2)⋅(2×5)(\htmlClass{lc-blue}{4} \times \htmlClass{lc-pink}{2}) \cdot (\htmlClass{lc-blue}{2} \times \htmlClass{lc-pink}{5})
inner numbers must match\text{inner numbers must match}
outer numbers give\text{outer numbers give}
product size: 4×5\text{product size: }\htmlClass{lc-blue}{4} \times \htmlClass{lc-pink}{5}

Even when both products work, swapping the order of the matrices can change which numbers pair together, as we see with A=[1203]A = \begin{bmatrix} 1 & 2 \\ 0 & 3 \end{bmatrix} and B=[4012]B = \begin{bmatrix} 4 & 0 \\ 1 & 2 \end{bmatrix}.

Text solution
Multiply ABAB using rows of AA and columns of BBPair each row of AA with each column of BB.
AB=[1203][4012]=[(1×4)+(2×1)(1×0)+(2×2)(0×4)+(3×1)(0×0)+(3×2)]=[6436]\displaystyle \begin{aligned} AB &= \begin{bmatrix} 1 & 2 \\ 0 & 3 \end{bmatrix}\begin{bmatrix} 4 & 0 \\ 1 & 2 \end{bmatrix} \\ &= \begin{bmatrix} \begin{aligned} &(\row{1}\times \col{4}) \\ +&(\row{2}\times \col{1}) \end{aligned} & \begin{aligned} &(\row{1}\times \col{0}) \\ +&(\row{2}\times \col{2}) \end{aligned} \\[1.25em] \begin{aligned} &(\row{0}\times \col{4}) \\ +&(\row{3}\times \col{1}) \end{aligned} & \begin{aligned} &(\row{0}\times \col{0}) \\ +&(\row{3}\times \col{2}) \end{aligned} \end{bmatrix} \\ &= \begin{bmatrix} 6 & 4 \\ 3 & 6 \end{bmatrix} \end{aligned}
Multiply BABA using rows of BB and columns of AAReverse the order so BB gives the rows and AA gives the columns.
BA=[4012][1203]=[(4×1)+(0×0)(4×2)+(0×3)(1×1)+(2×0)(1×2)+(2×3)]=[4818]\displaystyle \begin{aligned} BA &= \begin{bmatrix} 4 & 0 \\ 1 & 2 \end{bmatrix}\begin{bmatrix} 1 & 2 \\ 0 & 3 \end{bmatrix} \\ &= \begin{bmatrix} \begin{aligned} &(\row{4}\times \col{1}) \\ +&(\row{0}\times \col{0}) \end{aligned} & \begin{aligned} &(\row{4}\times \col{2}) \\ +&(\row{0}\times \col{3}) \end{aligned} \\[1.25em] \begin{aligned} &(\row{1}\times \col{1}) \\ +&(\row{2}\times \col{0}) \end{aligned} & \begin{aligned} &(\row{1}\times \col{2}) \\ +&(\row{2}\times \col{3}) \end{aligned} \end{bmatrix} \\ &= \begin{bmatrix} 4 & 8 \\ 1 & 8 \end{bmatrix} \end{aligned}

The top-left entry is 66 in ABAB and 44 in BABA, so AB≠BAAB \neq BA for these matrices.

Each row of the first matrix pairs up with each column of the second, so the rows and columns have to be the same length, and the number of rows in the first and columns in the second set the size of the product.

Matching inner dimensions pair every entry across a row with an entry down a column, while the outer dimensions set the size of the product.
5

Writing a System as a Matrix Equation

Now that we know how rows multiply columns, we can write an entire system of linear equations as a single matrix equation.

Writing a System as a Matrix Equation
3x+2y=12\hspace{3.3em}\mathllap{3\htmlClass{lc-green}{x} + 2\htmlClass{lc-green}{y}} = \mathrlap{12}\hspace{1.2em}
5x−1y=7\hspace{3.3em}\mathllap{5\htmlClass{lc-green}{x} - 1\htmlClass{lc-green}{y}} = \mathrlap{7}\hspace{1.2em}
??
[325−1][xy]=[127]\begin{bmatrix} 3 & 2 \\ 5 & -1 \end{bmatrix}\begin{bmatrix} \htmlClass{lc-green}{x} \\ \htmlClass{lc-green}{y} \end{bmatrix} = \begin{bmatrix} 12 \\ 7 \end{bmatrix}

Walking across each row of coefficients and down the column of unknowns rebuilds the left-hand side of each equation, turning the system 3x+2y=123\unknown{x} + 2\unknown{y} = 12 and 5x−1y=75\unknown{x} - 1\unknown{y} = 7 into A⋅X=BA \cdot \unknown{X} = B:

[325−1]⏟A(coefficients)[xy]⏟X(unknowns)=[127]⏟B(constants)\displaystyle \underbrace{\begin{bmatrix} 3 & 2 \\ 5 & -1 \end{bmatrix}}_{\begin{gathered} \scriptstyle A \\ \scriptstyle \text{(coefficients)} \end{gathered}}\underbrace{\begin{bmatrix} \unknown{x} \\ \unknown{y} \end{bmatrix}}_{\begin{gathered} \scriptstyle \unknown{X} \\ \scriptstyle \text{(unknowns)} \end{gathered}} = \underbrace{\begin{bmatrix} 12 \\ 7 \end{bmatrix}}_{\begin{gathered} \scriptstyle B \\ \scriptstyle \text{(constants)} \end{gathered}}

When setting up AA, keep the variables in the same column order in every equation, writing −1-1 for a subtracted variable like −y-\unknown{y} and 00 whenever a variable is missing from an equation.

6

The Identity Matrix

In ordinary algebra, multiplying a number by 11 leaves it unchanged (1x=x1\unknown{x} = \unknown{x}). The identity matrix II is the matrix version of 11: multiplying a matrix by an identity matrix of the matching size gives the exact same matrix right back.

The Identity Matrix
5x=101x=x\displaystyle {5\htmlClass{lc-green}{x} = 10 \qquad 1\htmlClass{lc-green}{x} = \htmlClass{lc-green}{x}}
[????][xy]=[xy]\displaystyle {\begin{bmatrix} ? & ? \\ ? & ? \end{bmatrix}\begin{bmatrix} \htmlClass{lc-green}{x} \\ \htmlClass{lc-green}{y} \end{bmatrix} = \begin{bmatrix} \htmlClass{lc-green}{x} \\ \htmlClass{lc-green}{y} \end{bmatrix}}

To leave every variable alone in its own row without mixing the other variables in, II puts 11s down the main diagonal and 00s everywhere else:

I=[1001],I=[100010001]\displaystyle I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \qquad I = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}

When II multiplies a column of unknowns, each row keeps one variable and zeroes out the rest:

[1001][xy]=[(1⋅x)+(0⋅y)(0⋅x)+(1⋅y)]=[xy]\displaystyle \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\begin{bmatrix} \unknown{x} \\ \unknown{y} \end{bmatrix} = \begin{bmatrix} (\row{1} \cdot \unknown{x}) + (\row{0} \cdot \unknown{y}) \\ (\row{0} \cdot \unknown{x}) + (\row{1} \cdot \unknown{y}) \end{bmatrix} = \begin{bmatrix} \unknown{x} \\ \unknown{y} \end{bmatrix}

With 11s on the main diagonal and 00s everywhere else, II leaves any matrix it can multiply unchanged.

In each row, 1s keep the matching variables and 0s multiply them by 0. To leave the column unchanged for every choice of x, y, and z, the matrix needs 1s down the main diagonal and 0s everywhere else.

Key concepts

Matrix operations split into two distinct ways of working depending on what the operation is doing:

Spot-by-spot operations (equality, addition, subtraction, and scaling)

Always read sizes and entry addresses as Row×Column\row{\text{Row}} \times \col{\text{Column}} (so a21a_{\row{2}\col{1}} is Row 2, Column 1 of AA). Two matrices can be equal only when their dimensions are identical, and you can add or subtract them only when their dimensions are identical. You work one matching spot at a time, never row-by-column. A scalar in front of a matrix multiplies every entry inside:

2[5218]+[3420]=[138416]\displaystyle \scalar{2}\begin{bmatrix} 5 & 2 \\ 1 & 8 \end{bmatrix} + \begin{bmatrix} 3 & 4 \\ 2 & 0 \end{bmatrix} = \begin{bmatrix} 13 & 8 \\ 4 & 16 \end{bmatrix}

Row-by-column multiplication (ABAB)

Do not multiply matching entries spot-by-spot. First write the dimensions side by side in the exact order of multiplication, such as (2×3)⋅(3×2)(\row{2} \times \col{3}) \cdot (\row{3} \times \col{2}): the inner numbers must match for the product to be defined, and the outer numbers give the size of the answer. To find entry crow, colc_{\row{\text{row}}\text{, }\col{\text{col}}} of the product, walk across that row of the first matrix and down that column of the second, multiplying pairs and adding them up. Because the first matrix uses its rows and the second uses its columns, order matters: ABAB and BABA can differ, and one may be undefined.

Matrix equations and the identity matrix (AX=BA\unknown{X} = B and II)

Row-by-column multiplication writes a linear system as AX=BA\unknown{X} = B, where AA holds the coefficients, X\unknown{X} is the column of unknowns, and BB is the column of constants on the right sides of the equations. The identity matrix I=[1001]I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} has 11s down the main diagonal and 00s everywhere else, leaving any matching matrix unchanged when multiplied.

7

Practice

1

Find the dimensions of A=[4−17039−25681−4]A = \begin{bmatrix} 4 & -1 & 7 & 0 \\ 3 & 9 & -2 & 5 \\ 6 & 8 & 1 & -4 \end{bmatrix}, and find the entries a23a_{23} and a32a_{32}.

Count horizontal rows first and vertical columns second, then use that same row,column\row{\text{row}}, \col{\text{column}} order to read each subscript.

Count 3\row{3} horizontal rows and 4\col{4} vertical columns to get dimensions 3×4\row{3} \times \col{4}. (Warning: Going columns-by-rows gives the wrong dimensions 4×34 \times 3, and swapping the row and column subscripts gives a23=8a_{23} = 8 and a32=−2a_{32} = -2.)
For a23a_{\row{2}\col{3}}, look at Row 2, Column 3 to get −2-2. For a32a_{\row{3}\col{2}}, look at Row 3, Column 2 to get 88.
AnswerDimensions: 3×43 \times 4; a23=−2a_{23} = -2; a32=8a_{32} = 8
2

For A=[4−13052]A = \begin{bmatrix} 4 & -1 & 3 \\ 0 & 5 & 2 \end{bmatrix} and B=[12−1304]B = \begin{bmatrix} 1 & 2 & -1 \\ 3 & 0 & 4 \end{bmatrix}, find 2A−B2A - B.

Multiply every entry of AA by the scalar 2\scalar{2} first, then subtract the matching entry of BB in each spot.

Scale every entry of AA by 2\scalar{2}:
2A=[8−260104]\displaystyle \scalar{2}A = \begin{bmatrix} 8 & -2 & 6 \\ 0 & 10 & 4 \end{bmatrix}
Subtract BB entry by entry (Warning: Watch the negative sign in Row 1, Column 3 when subtracting −1-1; computing 6−16 - 1 instead of 6−(−1)6 - (-1) gives 55 in the top-right spot and the wrong matrix [7−45−3100]\begin{bmatrix} 7 & -4 & 5 \\ -3 & 10 & 0 \end{bmatrix}):
2A−B=[8−1−2−26−(−1)0−310−04−4]=[7−47−3100]\displaystyle \scalar{2}A - B = \begin{bmatrix} 8 - 1 & -2 - 2 & 6 - (-1) \\ 0 - 3 & 10 - 0 & 4 - 4 \end{bmatrix} = \begin{bmatrix} 7 & -4 & 7 \\ -3 & 10 & 0 \end{bmatrix}
Answer[7−47−3100]\begin{bmatrix} 7 & -4 & 7 \\ -3 & 10 & 0 \end{bmatrix}
3

Solve for xx and yy: 3[2x−14]+[−6532y]=[01706]3\begin{bmatrix} 2 & x \\ -1 & 4 \end{bmatrix} + \begin{bmatrix} -6 & 5 \\ 3 & 2y \end{bmatrix} = \begin{bmatrix} 0 & 17 \\ 0 & 6 \end{bmatrix}.

Pull out only the two entry positions where x\unknown{x} and y\unknown{y} sit, making sure the scalar 3\scalar{3} multiplies the first matrix's entries in those spots.

Write the equations for Row 1, Column 2 and Row 2, Column 2 (Warning: Forgetting to multiply x\unknown{x} and 44 by the scalar 3\scalar{3} before adding gives x+5=17  ⟹  x=12\unknown{x} + 5 = 17 \implies \unknown{x} = 12 and 4+2y=6  ⟹  y=14 + 2\unknown{y} = 6 \implies \unknown{y} = 1):
3x+5=17  ⟹  3x=12  ⟹  x=43(4)+2y=6  ⟹  12+2y=6  ⟹  2y=−6  ⟹  y=−3\displaystyle \begin{aligned} \scalar{3}\unknown{x} + 5 &= 17 \\ \implies \scalar{3}\unknown{x} &= 12 \\ \implies \unknown{x} &= 4 \\ \scalar{3}(4) + 2\unknown{y} &= 6 \\ \implies 12 + 2\unknown{y} &= 6 \\ \implies 2\unknown{y} &= -6 \\ \implies \unknown{y} &= -3 \end{aligned}
Answerx=4,y=−3x = 4, y = -3
4

Multiply [3−12041][215−2−13]\begin{bmatrix} 3 & -1 & 2 \\ 0 & 4 & 1 \end{bmatrix}\begin{bmatrix} 2 & 1 \\ 5 & -2 \\ -1 & 3 \end{bmatrix}.

Check the dimensions (2×3)⋅(3×2)(\row{2} \times \col{3}) \cdot (\row{3} \times \col{2}) to see the size of the product, then pair each row of the first matrix with each column of the second.

Walk across Row 1 and Row 2 of the first matrix while walking down Column 1 and Column 2 of the second (Warning: Dropping a negative sign when multiplying (−1)(−2)(\row{-1})(\col{-2}) in Row 1, Column 2 gives 3−2+6=73 - 2 + 6 = 7 instead of 1111, leading to [−1719−5]\begin{bmatrix} -1 & 7 \\ 19 & -5 \end{bmatrix}):
[(3)(2)+(−1)(5)+(2)(−1)(3)(1)+(−1)(−2)+(2)(3)(0)(2)+(4)(5)+(1)(−1)(0)(1)+(4)(−2)+(1)(3)]=[6−5−23+2+60+20−10−8+3]=[−11119−5]\displaystyle \begin{aligned} &\begin{bmatrix} \begin{aligned} &(\row{3})(\col{2}) \\ +&(\row{-1})(\col{5}) \\ +&(\row{2})(\col{-1}) \end{aligned} & \begin{aligned} &(\row{3})(\col{1}) \\ +&(\row{-1})(\col{-2}) \\ +&(\row{2})(\col{3}) \end{aligned} \\[2em] \begin{aligned} &(\row{0})(\col{2}) \\ +&(\row{4})(\col{5}) \\ +&(\row{1})(\col{-1}) \end{aligned} & \begin{aligned} &(\row{0})(\col{1}) \\ +&(\row{4})(\col{-2}) \\ +&(\row{1})(\col{3}) \end{aligned} \end{bmatrix} \\ &= \begin{bmatrix} 6 - 5 - 2 & 3 + 2 + 6 \\ 0 + 20 - 1 & 0 - 8 + 3 \end{bmatrix} \\ &= \begin{bmatrix} -1 & 11 \\ 19 & -5 \end{bmatrix} \end{aligned}
Answer[−11119−5]\begin{bmatrix} -1 & 11 \\ 19 & -5 \end{bmatrix}
5

Matrix AA has dimensions 3×23 \times 2 and matrix BB has dimensions 2×42 \times 4. Find the dimensions of ABAB and BABA, or state if either product is undefined.

Write the dimensions side by side for ABAB, then rewrite them in the reversed order for BABA and check the new inner numbers.

For ABAB, write (3×2)⋅(2×4)(\row{3} \times \col{2}) \cdot (\row{2} \times \col{4}): the inner numbers match (2\col{2} and 2\row{2}), and the outer numbers give dimensions 3×4\row{3} \times \col{4}.
For BABA, reverse the order to (2×4)⋅(3×2)(\row{2} \times \col{4}) \cdot (\row{3} \times \col{2}) (Warning: Flipping the answer dimensions of ABAB to 4×34 \times 3 without checking the new inner numbers 4\col{4} and 3\row{3} misses that the rows of BB and columns of AA have different lengths): since the inner numbers 4\col{4} and 3\row{3} do not match, BABA is undefined.
AnswerABAB has dimensions 3×43 \times 4; BABA is undefined
6

For A=[2−130]A = \begin{bmatrix} 2 & -1 \\ 3 & 0 \end{bmatrix} and B=[142−1]B = \begin{bmatrix} 1 & 4 \\ 2 & -1 \end{bmatrix}, find both ABAB and BABA.

For ABAB, use the rows of AA and columns of BB; for BABA, write BB first so you walk across the rows of BB and down the columns of AA.

Multiply ABAB row by column (Warning: Multiplying matching spots entry-by-entry like addition gives the wrong matrix [2−460]\begin{bmatrix} 2 & -4 \\ 6 & 0 \end{bmatrix}):
AB=[2−130][142−1]=[(2)(1)+(−1)(2)(2)(4)+(−1)(−1)(3)(1)+(0)(2)(3)(4)+(0)(−1)]=[09312]\displaystyle \begin{aligned} AB &= \begin{bmatrix} 2 & -1 \\ 3 & 0 \end{bmatrix}\begin{bmatrix} 1 & 4 \\ 2 & -1 \end{bmatrix} \\ &= \begin{bmatrix} \begin{aligned} &(\row{2})(\col{1}) \\ +&(\row{-1})(\col{2}) \end{aligned} & \begin{aligned} &(\row{2})(\col{4}) \\ +&(\row{-1})(\col{-1}) \end{aligned} \\[1.25em] \begin{aligned} &(\row{3})(\col{1}) \\ +&(\row{0})(\col{2}) \end{aligned} & \begin{aligned} &(\row{3})(\col{4}) \\ +&(\row{0})(\col{-1}) \end{aligned} \end{bmatrix} \\ &= \begin{bmatrix} 0 & 9 \\ 3 & 12 \end{bmatrix} \end{aligned}
Write BB in front of AA to multiply BABA (Warning: Assuming BABA equals ABAB without re-multiplying with the rows of BB repeats [09312]\begin{bmatrix} 0 & 9 \\ 3 & 12 \end{bmatrix}):
BA=[142−1][2−130]=[(1)(2)+(4)(3)(1)(−1)+(4)(0)(2)(2)+(−1)(3)(2)(−1)+(−1)(0)]=[14−11−2]\displaystyle \begin{aligned} BA &= \begin{bmatrix} 1 & 4 \\ 2 & -1 \end{bmatrix}\begin{bmatrix} 2 & -1 \\ 3 & 0 \end{bmatrix} \\ &= \begin{bmatrix} \begin{aligned} &(\row{1})(\col{2}) \\ +&(\row{4})(\col{3}) \end{aligned} & \begin{aligned} &(\row{1})(\col{-1}) \\ +&(\row{4})(\col{0}) \end{aligned} \\[1.25em] \begin{aligned} &(\row{2})(\col{2}) \\ +&(\row{-1})(\col{3}) \end{aligned} & \begin{aligned} &(\row{2})(\col{-1}) \\ +&(\row{-1})(\col{0}) \end{aligned} \end{bmatrix} \\ &= \begin{bmatrix} 14 & -1 \\ 1 & -2 \end{bmatrix} \end{aligned}
AnswerAB=[09312]AB = \begin{bmatrix} 0 & 9 \\ 3 & 12 \end{bmatrix}; BA=[14−11−2]BA = \begin{bmatrix} 14 & -1 \\ 1 & -2 \end{bmatrix}
7

Write the system of equations as a matrix equation AX=B{AX = B}:

4x−y+2z=9x+5z=−3−2x+3y−z=1\displaystyle \begin{aligned} 4x - y + 2z &= 9 \\ x + 5z &= -3 \\ -2x + 3y - z &= 1 \end{aligned}

Line up the x\unknown{x}, y\unknown{y}, and z\unknown{z} columns across all three equations first. What coefficient belongs in the y\unknown{y} spot of the second equation?

Place the coefficients of x\unknown{x}, y\unknown{y}, and z\unknown{z} into the three columns of AA (Warning: Putting 55 into the middle spot of Row 2 because y\unknown{y} is missing gives [150]\begin{bmatrix} 1 & 5 & 0 \end{bmatrix} instead of [105]\begin{bmatrix} 1 & 0 & 5 \end{bmatrix}, and overlooking the minus signs on −y-\unknown{y} and −z-\unknown{z} writes 11 instead of −1-1):
[4−12105−23−1][xyz]=[9−31]\displaystyle \begin{bmatrix} 4 & -1 & 2 \\ 1 & 0 & 5 \\ -2 & 3 & -1 \end{bmatrix}\begin{bmatrix} \unknown{x} \\ \unknown{y} \\ \unknown{z} \end{bmatrix} = \begin{bmatrix} 9 \\ -3 \\ 1 \end{bmatrix}
Answer[4−12105−23−1][xyz]=[9−31]\begin{bmatrix} 4 & -1 & 2 \\ 1 & 0 & 5 \\ -2 & 3 & -1 \end{bmatrix}\begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 9 \\ -3 \\ 1 \end{bmatrix}
8

Find xx and yy so that [1201][1xy1]=I\begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix}\begin{bmatrix} 1 & x \\ y & 1 \end{bmatrix} = I, where II is the 2×22 \times 2 identity matrix.

Write out I=[1001]I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} on the right side, multiply the two matrices on the left row-by-column, and match the resulting entries.

Multiply the left-hand side row by column and set it equal to I=[1001]I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} (Warning: Multiplying entry-by-entry instead of row-by-column gives [12x01]=[1001]\begin{bmatrix} 1 & 2\unknown{x} \\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} and the wrong answer x=0\unknown{x} = 0):
[(1)(1)+(2)(y)(1)(x)+(2)(1)(0)(1)+(1)(y)(0)(x)+(1)(1)]=[1+2yx+2y1]=[1001]\displaystyle \begin{aligned} &\begin{bmatrix} \begin{aligned} &(\row{1})(\col{1}) \\ +&(\row{2})(\unknown{y}) \end{aligned} & \begin{aligned} &(\row{1})(\unknown{x}) \\ +&(\row{2})(\col{1}) \end{aligned} \\[1.25em] \begin{aligned} &(\row{0})(\col{1}) \\ +&(\row{1})(\unknown{y}) \end{aligned} & \begin{aligned} &(\row{0})(\unknown{x}) \\ +&(\row{1})(\col{1}) \end{aligned} \end{bmatrix} \\ &= \begin{bmatrix} 1 + 2\unknown{y} & \unknown{x} + 2 \\ \unknown{y} & 1 \end{bmatrix} \\ &= \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \end{aligned}
Match the bottom-left and top-right entries with the matching entries of II:
y=0x+2=0  ⟹  x=−2\displaystyle \begin{aligned} \unknown{y} &= 0 \\ \unknown{x} + 2 &= 0 \implies \unknown{x} = -2 \end{aligned}
Answerx=−2,y=0x = -2, y = 0