Linear AlgebraMatrix Algebra6 of 9
Matrix Algebra · 6

Computing the Inverse

To solve a matrix system Ax=bAx = b in a single step by undoing AA, we need a way to find its inverse, A−1\inverse{A^{-1}}.

For any matrix AA that mixes inputs together, we are looking for the matrix A−1\inverse{A^{-1}} that un-mixes them, so that A−1\inverse{A^{-1}} times AA is the identity matrix:

A−1A=[1001]⏟identity I\displaystyle \inverse{A^{-1}}A = \underbrace{\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}}_{\text{identity } I}

The −1-1 in A−1\inverse{A^{-1}} means the inverse operation that undoes AA, not dividing 11 by AA.

Un-mixing a Matrix with Row Operations
3x=12Ax=b3−1=13A−1=  ?\displaystyle \begin{alignedat}{2} 3x &= 12 &\qquad\qquad Ax &= b \\[0.3em] \inverse{3^{-1}} &= \inverse{\tfrac{1}{3}} &\qquad\qquad \inverse{A^{-1}} &= \;? \end{alignedat}
1

Recording Row Operations with [ A  |  I ]\left[\, A \;\middle|\; I \,\right]

Row operations can un-mix AA down to II, so we need a way to record those operations in a single matrix as we go. Let's find the inverse of

A=[1237]\displaystyle A = \begin{bmatrix} 1 & 2 \\ 3 & 7 \end{bmatrix}

by placing II right next to AA and applying every row operation across both sides until the left side becomes II.

Inverting a 2×2 Matrix with [A | I]
[12103701]\displaystyle \left[\begin{array}{cc|cc} 1 & 2 & \inverse{1} & \inverse{0} \\ 3 & 7 & \inverse{0} & \inverse{1} \end{array}\right]
↓\displaystyle \rowop{\big\downarrow}
[10??01??]\displaystyle \left[\begin{array}{cc|cc} 1 & 0 & \inverse{?} & \inverse{?} \\ 0 & 1 & \inverse{?} & \inverse{?} \end{array}\right]
Text solution
Set up [ A  |  I ]\left[\, A \;\middle|\; I \,\right] and clear below the first pivotSubtract 3\rowop{3} times Row 1 from Row 2 across all four columns so the 33 below the top-left pivot becomes 00.
[12103701]→R2←R2−3R1[121001−31]\displaystyle \begin{aligned} & \left[\begin{array}{cc|cc} 1 & 2 & \inverse{1} & \inverse{0} \\ 3 & 7 & \inverse{0} & \inverse{1} \end{array}\right] \\[6pt] \xrightarrow{\rowop{R_2 \leftarrow R_2 - 3R_1}} & \left[\begin{array}{cc|cc} 1 & 2 & \inverse{1} & \inverse{0} \\ 0 & 1 & \inverse{-3} & \inverse{1} \end{array}\right] \end{aligned}
Clear above the second pivotUse the 11 in the bottom-right corner of the left side to eliminate the 22 above it.
[121001−31]→R1←R1−2R2[107−201−31]\displaystyle \begin{aligned} & \left[\begin{array}{cc|cc} 1 & 2 & \inverse{1} & \inverse{0} \\ 0 & 1 & \inverse{-3} & \inverse{1} \end{array}\right] \\[6pt] \xrightarrow{\rowop{R_1 \leftarrow R_1 - 2R_2}} & \left[\begin{array}{cc|cc} 1 & 0 & \inverse{7} & \inverse{-2} \\ 0 & 1 & \inverse{-3} & \inverse{1} \end{array}\right] \end{aligned}

Because the left side is now II, the right side has recorded every un-mixing step, giving A−1=[7−2−31]\inverse{A^{-1}} = \inverse{\begin{bmatrix} 7 & -2 \\ -3 & 1 \end{bmatrix}}.

Starting the right side at II records every row operation we do to AA. The moment the left side reaches II, those recorded operations on the right have built A−1\inverse{A^{-1}}.

Because both halves take the exact same row steps, the right side keeps track of what you did to the left side, and turns into the inverse the moment the left side reaches the identity matrix.
2

Inverting a 3×33 \times 3 Matrix with the Two-Phase Sweep

On a larger matrix, clearing entries to zero in a random order can overwrite zeros you already made. Let's find the inverse of the 3×33 \times 3 matrix

A=[110232−103]\displaystyle A = \begin{bmatrix} 1 & 1 & 0 \\ 2 & 3 & 2 \\ -1 & 0 & 3 \end{bmatrix}

by sweeping in a fixed order that keeps each finished column intact.

1. Sweep down (left to right)
∗\ast
∗\ast
∗\ast
∗\ast
∗\ast
∗\ast
∗\ast
∗\ast
∗\ast
2. Sweep up (right to left)
∗\ast
∗\ast
∗\ast
00
∗\ast
∗\ast
00
00
∗\ast
Inverting a 3×3 Matrix with the Two-Phase Sweep
[110100232010−103001]\displaystyle \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 2 & 3 & 2 & \inverse{0} & \inverse{1} & \inverse{0} \\ -1 & 0 & 3 & \inverse{0} & \inverse{0} & \inverse{1} \end{array}\right]
A−1\displaystyle \inverse{A^{-1}} =  ?\displaystyle = \;?
Text solution
Clear Column 1 below the first pivotUse the top-left 11 in Row 1 to eliminate the 22 and −1-1 below it.
[110100232010−103001]→R2←R2−2R1R3←R3+R1[110100012−210013101]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 2 & 3 & 2 & \inverse{0} & \inverse{1} & \inverse{0} \\ -1 & 0 & 3 & \inverse{0} & \inverse{0} & \inverse{1} \end{array}\right] \\[2pt] & \qquad \xrightarrow{\substack{\rowop{R_2 \leftarrow R_2 - 2R_1} \\[3pt] \rowop{R_3 \leftarrow R_3 + R_1}}} \\[2pt] & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 2 & \inverse{-2} & \inverse{1} & \inverse{0} \\ 0 & 1 & 3 & \inverse{1} & \inverse{0} & \inverse{1} \end{array}\right] \end{aligned}
Clear Column 2 below the middle pivotSubtract Row 2 from Row 3; because both rows already have 00 in Column 1, Column 1 stays untouched.
[110100012−210013101]→R3←R3−R2[110100012−2100013−11]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 2 & \inverse{-2} & \inverse{1} & \inverse{0} \\ 0 & 1 & 3 & \inverse{1} & \inverse{0} & \inverse{1} \end{array}\right] \\[2pt] & \qquad \xrightarrow{\rowop{R_3 \leftarrow R_3 - R_2}} \\[2pt] & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 2 & \inverse{-2} & \inverse{1} & \inverse{0} \\ 0 & 0 & 1 & \inverse{3} & \inverse{-1} & \inverse{1} \end{array}\right] \end{aligned}
Sweep up from right to leftUse Row 3 (which starts with two zeros) to clear Column 3, and then use Row 2 to clear Column 2.
[110100012−2100013−11]→R2←R2−2R3[110100010−83−20013−11]→R1←R1−R2[1009−32010−83−20013−11]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 2 & \inverse{-2} & \inverse{1} & \inverse{0} \\ 0 & 0 & 1 & \inverse{3} & \inverse{-1} & \inverse{1} \end{array}\right] \\[2pt] & \qquad \xrightarrow{\rowop{R_2 \leftarrow R_2 - 2R_3}} \\[2pt] & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 0 & \inverse{-8} & \inverse{3} & \inverse{-2} \\ 0 & 0 & 1 & \inverse{3} & \inverse{-1} & \inverse{1} \end{array}\right] \\[2pt] & \qquad \xrightarrow{\rowop{R_1 \leftarrow R_1 - R_2}} \\[2pt] & \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & \inverse{9} & \inverse{-3} & \inverse{2} \\ 0 & 1 & 0 & \inverse{-8} & \inverse{3} & \inverse{-2} \\ 0 & 0 & 1 & \inverse{3} & \inverse{-1} & \inverse{1} \end{array}\right] \end{aligned}

With II on the left, the right side gives A−1=[9−32−83−23−11]\inverse{A^{-1}} = \inverse{\begin{bmatrix} 9 & -3 & 2 \\ -8 & 3 & -2 \\ 3 & -1 & 1 \end{bmatrix}}.

Clearing entries out of order can add numbers from the pivot row back into columns you already finished, ruining the zeros you made.

Clearing down from left to right and then up from right to left keeps each new step from undoing the zeros you already made.
3

Row Swaps and Pivots That Are Not 1

In the first two matrices every pivot landed on 11 automatically, but most matrices need you to swap rows when a 0\fails{0} lands in a pivot spot or divide a row when a pivot is not 11. Let's invert

B=[2145]\displaystyle B = \begin{bmatrix} 2 & 1 \\ 4 & 5 \end{bmatrix}

where neither pivot starts out as 11.

Row Swaps and Non-Unit Pivots
[ B∣I ]=[21104501]B−1=  ?\displaystyle \begin{aligned} [\,B \mid I\,] &= \left[\begin{array}{cc|cc} 2 & 1 & \inverse{1} & \inverse{0} \\ 4 & 5 & \inverse{0} & \inverse{1} \end{array}\right] \\[0.5em] \inverse{B^{-1}} &= \;? \end{aligned}
Text solution
Clear below the first pivot before dividingBecause the 44 in Row 2 is a multiple of the pivot 22 in Row 1, eliminate the 44 first so you hold off on fractions until the end.
[21104501]→R2←R2−2R1[211003−21]\displaystyle \begin{aligned} & \left[\begin{array}{cc|cc} 2 & 1 & \inverse{1} & \inverse{0} \\ 4 & 5 & \inverse{0} & \inverse{1} \end{array}\right] \\[6pt] \xrightarrow{\rowop{R_2 \leftarrow R_2 - 2R_1}} & \left[\begin{array}{cc|cc} 2 & 1 & \inverse{1} & \inverse{0} \\ 0 & 3 & \inverse{-2} & \inverse{1} \end{array}\right] \end{aligned}
Scale the second pivot to 11 and clear above itDivide Row 2 by 3\rowop{3} across both sides, then subtract Row 2 from Row 1 to clear the second column.
[211003−21]→R2←R2÷3[211001−2313]→R1←R1−R2[2053−1301−2313]\displaystyle \begin{aligned} & \left[\begin{array}{cc|cc} 2 & 1 & \inverse{1} & \inverse{0} \\ 0 & 3 & \inverse{-2} & \inverse{1} \end{array}\right] \\[6pt] \xrightarrow{\rowop{R_2 \leftarrow R_2 \div 3}} & \left[\begin{array}{cc|cc} 2 & 1 & \inverse{1} & \inverse{0} \\ 0 & 1 & \inverse{-\frac{2}{3}} & \inverse{\frac{1}{3}} \end{array}\right] \\[6pt] \xrightarrow{\rowop{R_1 \leftarrow R_1 - R_2}} & \left[\begin{array}{cc|cc} 2 & 0 & \inverse{\frac{5}{3}} & \inverse{-\frac{1}{3}} \\ 0 & 1 & \inverse{-\frac{2}{3}} & \inverse{\frac{1}{3}} \end{array}\right] \end{aligned}
Scale the first pivot to 11Divide Row 1 by 2\rowop{2} across both sides to finish reducing the left side to II.
[2053−1301−2313]→R1←R1÷2[1056−1601−2313]\displaystyle \begin{aligned} & \left[\begin{array}{cc|cc} 2 & 0 & \inverse{\frac{5}{3}} & \inverse{-\frac{1}{3}} \\ 0 & 1 & \inverse{-\frac{2}{3}} & \inverse{\frac{1}{3}} \end{array}\right] \\[6pt] \xrightarrow{\rowop{R_1 \leftarrow R_1 \div 2}} & \left[\begin{array}{cc|cc} 1 & 0 & \inverse{\frac{5}{6}} & \inverse{-\frac{1}{6}} \\ 0 & 1 & \inverse{-\frac{2}{3}} & \inverse{\frac{1}{3}} \end{array}\right] \end{aligned}

This leaves the inverse B−1=[56−16−2313]\inverse{B^{-1}} = \inverse{\begin{bmatrix} \tfrac{5}{6} & -\tfrac{1}{6} \\ -\tfrac{2}{3} & \tfrac{1}{3} \end{bmatrix}} on the right side.

4

The 2×22 \times 2 Inverse Formula

For any 2×22 \times 2 matrix

A=[abcd]\displaystyle A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}

doing these exact row-reduction steps once with letters gives a shortcut formula that goes straight to A−1\inverse{A^{-1}}.

The 2×2 Inverse Formula
[2145]−1=[56−16−2313][abcd]−1=  ?\displaystyle \begin{aligned} \begin{bmatrix} 2 & 1 \\ 4 & 5 \end{bmatrix}^{\inverse{-1}} &= \inverse{\begin{bmatrix} \tfrac{5}{6} & -\tfrac{1}{6} \\[0.35em] -\tfrac{2}{3} & \tfrac{1}{3} \end{bmatrix}} \\[1em] \begin{bmatrix} a & b \\ c & d \end{bmatrix}^{\inverse{-1}} &= \;? \end{aligned}

To invert a 2×22 \times 2 matrix directly, swap the main diagonal entries aa and dd, flip the signs of bb and cc, and divide by ad−bcad - bc:

A−1=1ad−bc⏟determinant[d−b−ca]\displaystyle \inverse{A^{-1}} = \frac{1}{\underbrace{ad - bc}_{\text{determinant}}} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

When ad−bc=1ad - bc = 1, as in our first matrix [1237]\begin{bmatrix} 1 & 2 \\ 3 & 7 \end{bmatrix} where (1)(7)−(2)(3)=1(1)(7) - (2)(3) = 1, the fraction out front is 11\frac{1}{1} and the inverse has only whole numbers.

5

When a Matrix Has No Inverse

The 2×22 \times 2 formula divides by ad−bcad - bc, which brings up a natural question: what happens when ad−bc=0ad - bc = \fails{0}, such as for the matrix

A=[1224]?\displaystyle A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}\text{?}
When a Matrix Has No Inverse
A−1=1ad−bc[d−b−ca]\displaystyle \inverse{A^{-1}} = \frac{1}{ad - bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}
ad−bc\displaystyle ad - bc =0  ⟹  A−1\displaystyle = \fails{0} \;\Longrightarrow\; \inverse{A^{-1}} =  ?\displaystyle = \;?
[2113]\begin{bmatrix} \htmlClass{lc-green}{2} & \htmlClass{lc-pink}{1} \\ \htmlClass{lc-green}{1} & \htmlClass{lc-pink}{3} \end{bmatrix}
Area=ad−bc≠0\text{Area} = ad - bc \neq 0
(2D stays 2D, reversible)
[1224]\begin{bmatrix} \htmlClass{lc-green}{1} & \htmlClass{lc-pink}{2} \\ \htmlClass{lc-green}{2} & \htmlClass{lc-pink}{4} \end{bmatrix}
Area=ad−bc=0\text{Area} = ad - bc = \htmlClass{lc-orange}{0}
(2D squished to 1D, no inverse)
Text solution
Eliminate below the first pivotSubtract 2\rowop{2} times Row 1 from Row 2 to clear the bottom-left entry.
[12102401]→R2←R2−2R1[121000−21]\displaystyle \begin{aligned} & \left[\begin{array}{cc|cc} 1 & 2 & \inverse{1} & \inverse{0} \\ 2 & 4 & \inverse{0} & \inverse{1} \end{array}\right] \\[6pt] \xrightarrow{\rowop{R_2 \leftarrow R_2 - 2R_1}} & \left[\begin{array}{cc|cc} 1 & 2 & \inverse{1} & \inverse{0} \\ \fails{0} & \fails{0} & \inverse{-2} & \inverse{1} \end{array}\right] \end{aligned}

Because the entire bottom row on the left side became [00]\fails{\begin{bmatrix} 0 & 0 \end{bmatrix}}, no row operation can ever put a pivot of 11 in the second column, so AA has no inverse.

When one row of AA is a multiple of the other, the rows aren't independent: the zero row in [ A  |  I ]\left[\, A \;\middle|\; I \,\right], the zero area ad−bc=0ad - bc = \fails{0}, and the division by zero in the formula are all showing the same collapse.

When one row of a matrix is a multiple of the other, the parallelogram the rows span squishes flat onto a line, a row cancels out to zeros during reduction, and the matrix has no inverse.
6

Solving Systems with the Inverse

Once we have found A−1\inverse{A^{-1}}, we can solve any system Ax=bAx = b that uses the coefficient matrix AA without doing elimination again. Let's solve

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

using the inverse A−1\inverse{A^{-1}} we already found for this 3×33 \times 3 matrix.

Solving Systems with the Inverse
A−1=[9−32−83−23−11]b=[541][xyz]=  ?\displaystyle \begin{aligned} \inverse{A^{-1}} &= \inverse{\begin{bmatrix} 9 & -3 & 2 \\ -8 & 3 & -2 \\ 3 & -1 & 1 \end{bmatrix}} \\[0.6em] b &= \begin{bmatrix} 5 \\ 4 \\ 1 \end{bmatrix} \\[0.6em] \begin{bmatrix} x \\ y \\ z \end{bmatrix} &= \;? \end{aligned}
Text solution
Isolate xx by multiplying by A−1\inverse{A^{-1}}Write the system as Ax=bAx = b with b=[541]b = \begin{bmatrix} 5 \\ 4 \\ 1 \end{bmatrix} and multiply both sides on the left by A−1\inverse{A^{-1}}.
x=A−1b=[9−32−83−23−11][541]\displaystyle x = \inverse{A^{-1}}b = \inverse{\begin{bmatrix} 9 & -3 & 2 \\ -8 & 3 & -2 \\ 3 & -1 & 1 \end{bmatrix}} \begin{bmatrix} 5 \\ 4 \\ 1 \end{bmatrix}
Multiply A−1\inverse{A^{-1}} by bb row by rowTake the dot product of each row of A−1\inverse{A^{-1}} with the column vector bb.
x=[9(5)−3(4)+2(1)−8(5)+3(4)−2(1)3(5)−1(4)+1(1)]=[35−3012]\displaystyle x = \begin{bmatrix} 9(5) - 3(4) + 2(1) \\ -8(5) + 3(4) - 2(1) \\ 3(5) - 1(4) + 1(1) \end{bmatrix} = \begin{bmatrix} 35 \\ -30 \\ 12 \end{bmatrix}

So the solution is x=35x = 35, y=−30y = -30, z=12z = 12, and we can solve for any new right-hand side vector bb in one multiplication by the same A−1\inverse{A^{-1}}.

Key concepts

When you need to invert a matrix or use an inverse, choose your method based on the size of the matrix and what you are given:

For a 2×22 \times 2 matrix A=[abcd]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}, skip row reduction and use the formula directly: swap the main diagonal, flip the signs on the other diagonal, and divide by the determinant ad−bcad - bc:

A−1=1ad−bc[d−b−ca],so for B=[2145],B−1=12(5)−1(4)[5−1−42]=16[5−1−42]\displaystyle \begin{aligned} \inverse{A^{-1}} &= \frac{1}{ad - bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}, \\[6pt] \text{so for } B &= \begin{bmatrix} 2 & 1 \\ 4 & 5 \end{bmatrix}, \\[6pt] \inverse{B^{-1}} &= \frac{1}{2(5) - 1(4)}\begin{bmatrix} 5 & -1 \\ -4 & 2 \end{bmatrix} \\[6pt] &= \frac{1}{6}\begin{bmatrix} 5 & -1 \\ -4 & 2 \end{bmatrix} \end{aligned}

For a 3×33 \times 3 (or larger) matrix, set up [ A  |  I ]\left[\, A \;\middle|\; I \,\right] and reduce the left side to II using the two-phase sweep: sweep down from left to right to clear below the pivots, then sweep up from right to left to clear above them, turning [ A  |  I ]\left[\, A \;\middle|\; I \,\right] into [ I  |  A−1 ]\left[\, I \;\middle|\; \inverse{A^{-1}} \,\right]. If a 0\fails{0} lands in a pivot spot, swap only with a row below it (across all columns), and if a pivot is not 11, use it to clear multiples in its column before dividing so you hold off on fractions until the end.

If ad−bc=0ad - bc = \fails{0} in a 2×22 \times 2 matrix, or if an entire row on the left side becomes all zeros during elimination (such as [121000−21]\left[\begin{array}{cc|cc} 1 & 2 & \inverse{1} & \inverse{0} \\ \fails{0} & \fails{0} & \inverse{-2} & \inverse{1} \end{array}\right]), stop right away: one row is a combination of the others and A−1\inverse{A^{-1}} does not exist.

Finally, know when not to find A−1\inverse{A^{-1}}: if you only need to solve Ax=bAx = b once for a single vector bb and aren't given A−1\inverse{A^{-1}}, reducing [ A  |  b ]\left[\, A \;\middle|\; b \,\right] is much faster than finding A−1\inverse{A^{-1}}. Use x=A−1bx = \inverse{A^{-1}}b when A−1\inverse{A^{-1}} is already given or when you have to solve for several different right-hand sides b1,b2,…b_1, b_2, \dots; and if you are given the solutions to Ax=[10]Ax = \firstcol{\begin{bmatrix} 1 \\ 0 \end{bmatrix}} and Ax=[01]Ax = \secondcol{\begin{bmatrix} 0 \\ 1 \end{bmatrix}}, put those solution vectors directly in as the columns of A−1\inverse{A^{-1}} without doing any row reduction at all.

7

Practice

1

Use the 2×22 \times 2 inverse formula to find the inverse of A=[3254]A = \begin{bmatrix} 3 & 2 \\ 5 & 4 \end{bmatrix}.

Find ad−bcad - bc first, then check which diagonal swaps places and which diagonal flips sign.

Find the determinant:
ad−bc\displaystyle ad - bc =(3)(4)−(2)(5)\displaystyle = (3)(4) - (2)(5) =12−10\displaystyle = 12 - 10 =2\displaystyle = 2
Swap the main diagonal entries 33 and 44, flip the signs of the off-diagonal entries 22 and 55 (watch out: forgetting to flip the signs of 22 and 55 gives [215232]\begin{bmatrix} 2 & 1 \\ \tfrac{5}{2} & \tfrac{3}{2} \end{bmatrix}, and subtracting in the wrong order 10−12=−210 - 12 = -2 flips every sign to [−2152−32]\begin{bmatrix} -2 & 1 \\ \tfrac{5}{2} & -\tfrac{3}{2} \end{bmatrix}), and divide by 22:
A−1=12[4−2−53]=[2−1−5232]\displaystyle \inverse{A^{-1}} = \frac{1}{2}\begin{bmatrix} 4 & -2 \\ -5 & 3 \end{bmatrix} = \inverse{\begin{bmatrix} 2 & -1 \\ -\frac{5}{2} & \frac{3}{2} \end{bmatrix}}
2

Find the inverse of A=[120131012]A = \begin{bmatrix} 1 & 2 & 0 \\ 1 & 3 & 1 \\ 0 & 1 & 2 \end{bmatrix} by row-reducing [ A  |  I ]\left[\, A \;\middle|\; I \,\right] with the two-phase sweep.

Row 3 already has a 00 in Column 1, so only Row 2 needs clearing in the first column before you move to the middle pivot.

Set up [ A  |  I ]\left[\, A \;\middle|\; I \,\right] and sweep down left to right with R2←R2−R1\rowop{R_2 \leftarrow R_2 - R_1} and then R3←R3−R2\rowop{R_3 \leftarrow R_3 - R_2}:
[120100131010012001]→R2←R2−R1[120100011−110012001]→R3←R3−R2[120100011−1100011−11]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|ccc} 1 & 2 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 1 & 3 & 1 & \inverse{0} & \inverse{1} & \inverse{0} \\ 0 & 1 & 2 & \inverse{0} & \inverse{0} & \inverse{1} \end{array}\right] \\[6pt] & \xrightarrow{\rowop{R_2 \leftarrow R_2 - R_1}} \\ &\quad \left[\begin{array}{ccc|ccc} 1 & 2 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 1 & \inverse{-1} & \inverse{1} & \inverse{0} \\ 0 & 1 & 2 & \inverse{0} & \inverse{0} & \inverse{1} \end{array}\right] \\[6pt] & \xrightarrow{\rowop{R_3 \leftarrow R_3 - R_2}} \\ &\quad \left[\begin{array}{ccc|ccc} 1 & 2 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 1 & \inverse{-1} & \inverse{1} & \inverse{0} \\ 0 & 0 & 1 & \inverse{1} & \inverse{-1} & \inverse{1} \end{array}\right] \end{aligned}
(Watch the sign on the right side in R3←R3−R2\rowop{R_3 \leftarrow R_3 - R_2}: subtracting −1-1 in the first column gives 0−(−1)=+10 - (-1) = +1; writing −1-1 there leads to the wrong answer [1−4202−1−1−11]\begin{bmatrix} 1 & -4 & 2 \\ 0 & 2 & -1 \\ -1 & -1 & 1 \end{bmatrix}.)
Now sweep up right to left with R2←R2−R3\rowop{R_2 \leftarrow R_2 - R_3} and then R1←R1−2R2\rowop{R_1 \leftarrow R_1 - 2R_2}:
[120100011−1100011−11]→R2←R2−R3[120100010−22−10011−11]→R1←R1−2R2[1005−42010−22−10011−11]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|ccc} 1 & 2 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 1 & \inverse{-1} & \inverse{1} & \inverse{0} \\ 0 & 0 & 1 & \inverse{1} & \inverse{-1} & \inverse{1} \end{array}\right] \\[6pt] & \xrightarrow{\rowop{R_2 \leftarrow R_2 - R_3}} \\ & \left[\begin{array}{ccc|ccc} 1 & 2 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 0 & \inverse{-2} & \inverse{2} & \inverse{-1} \\ 0 & 0 & 1 & \inverse{1} & \inverse{-1} & \inverse{1} \end{array}\right] \\[6pt] & \xrightarrow{\rowop{R_1 \leftarrow R_1 - 2R_2}} \\ & \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & \inverse{5} & \inverse{-4} & \inverse{2} \\ 0 & 1 & 0 & \inverse{-2} & \inverse{2} & \inverse{-1} \\ 0 & 0 & 1 & \inverse{1} & \inverse{-1} & \inverse{1} \end{array}\right] \end{aligned}
A−1=[5−42−22−11−11]\displaystyle \inverse{A^{-1}} = \inverse{\begin{bmatrix} 5 & -4 & 2 \\ -2 & 2 & -1 \\ 1 & -1 & 1 \end{bmatrix}}
3

Find the inverse of B=[110221031]B = \begin{bmatrix} 1 & 1 & 0 \\ 2 & 2 & 1 \\ 0 & 3 & 1 \end{bmatrix} by row-reducing [ B  |  I ]\left[\, B \;\middle|\; I \,\right].

After clearing the 22 in Column 1, look at what lands in the middle pivot spot. Which row can you swap with without undoing Column 1?

Clear Column 1 with R2←R2−2R1\rowop{R_2 \leftarrow R_2 - 2R_1}:
[110100221010031001]→R2←R2−2R1[110100001−210031001]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 2 & 2 & 1 & \inverse{0} & \inverse{1} & \inverse{0} \\ 0 & 3 & 1 & \inverse{0} & \inverse{0} & \inverse{1} \end{array}\right] \\[6pt] \xrightarrow{\rowop{R_2 \leftarrow R_2 - 2R_1}} & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & \fails{0} & 1 & \inverse{-2} & \inverse{1} & \inverse{0} \\ 0 & 3 & 1 & \inverse{0} & \inverse{0} & \inverse{1} \end{array}\right] \end{aligned}
A 0\fails{0} landed in the second pivot spot, so swap Row 2 with Row 3 below it, never with Row 1 above, and be sure to swap the right side across the bar as well (forgetting to swap the right side leaves the identity columns matched with the wrong rows and gives [53−1313−2313−13001]\begin{bmatrix} \tfrac{5}{3} & -\tfrac{1}{3} & \tfrac{1}{3} \\ -\tfrac{2}{3} & \tfrac{1}{3} & -\tfrac{1}{3} \\ 0 & 0 & 1 \end{bmatrix}):
→R2↔R3[110100031001001−210]\displaystyle \begin{aligned} \xrightarrow{\rowop{R_2 \leftrightarrow R_3}} & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 3 & 1 & \inverse{0} & \inverse{0} & \inverse{1} \\ 0 & 0 & 1 & \inverse{-2} & \inverse{1} & \inverse{0} \end{array}\right] \end{aligned}
Sweep up by clearing Column 3 with R2←R2−R3\rowop{R_2 \leftarrow R_2 - R_3}, dividing Row 2 by 3\rowop{3}, and clearing Column 2 with R1←R1−R2\rowop{R_1 \leftarrow R_1 - R_2}:
→R2←R2−R3[1101000302−11001−210]→R2←R2÷3[11010001023−1313001−210]→R1←R1−R2[1001313−1301023−1313001−210]\displaystyle \begin{aligned} & \xrightarrow{\rowop{R_2 \leftarrow R_2 - R_3}} \\ & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 3 & 0 & \inverse{2} & \inverse{-1} & \inverse{1} \\ 0 & 0 & 1 & \inverse{-2} & \inverse{1} & \inverse{0} \end{array}\right] \\[6pt] & \xrightarrow{\rowop{R_2 \leftarrow R_2 \div 3}} \\ & \left[\begin{array}{ccc|ccc} 1 & 1 & 0 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 0 & \inverse{\frac{2}{3}} & \inverse{-\frac{1}{3}} & \inverse{\frac{1}{3}} \\ 0 & 0 & 1 & \inverse{-2} & \inverse{1} & \inverse{0} \end{array}\right] \\[6pt] & \xrightarrow{\rowop{R_1 \leftarrow R_1 - R_2}} \\ & \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & \inverse{\frac{1}{3}} & \inverse{\frac{1}{3}} & \inverse{-\frac{1}{3}} \\ 0 & 1 & 0 & \inverse{\frac{2}{3}} & \inverse{-\frac{1}{3}} & \inverse{\frac{1}{3}} \\ 0 & 0 & 1 & \inverse{-2} & \inverse{1} & \inverse{0} \end{array}\right] \end{aligned}
B−1=[1313−1323−1313−210]\displaystyle \inverse{B^{-1}} = \inverse{\begin{bmatrix} \frac{1}{3} & \frac{1}{3} & -\frac{1}{3} \\ \frac{2}{3} & -\frac{1}{3} & \frac{1}{3} \\ -2 & 1 & 0 \end{bmatrix}}
4

Determine whether C=[12−1251370]C = \begin{bmatrix} 1 & 2 & -1 \\ 2 & 5 & 1 \\ 3 & 7 & 0 \end{bmatrix} has an inverse by row-reducing [ C  |  I ]\left[\, C \;\middle|\; I \,\right].

Start the downward sweep on Column 1, then compare the new Row 2 and Row 3 on the left side.

Clear Column 1 below the first pivot using R2←R2−2R1\rowop{R_2 \leftarrow R_2 - 2R_1} and R3←R3−3R1\rowop{R_3 \leftarrow R_3 - 3R_1}:
[12−1100251010370001]→R2←R2−2R1R3←R3−3R1[12−1100013−210013−301]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|ccc} 1 & 2 & -1 & \inverse{1} & \inverse{0} & \inverse{0} \\ 2 & 5 & 1 & \inverse{0} & \inverse{1} & \inverse{0} \\ 3 & 7 & 0 & \inverse{0} & \inverse{0} & \inverse{1} \end{array}\right] \\[6pt] & \xrightarrow{\substack{\rowop{R_2 \leftarrow R_2 - 2R_1} \\[3pt] \rowop{R_3 \leftarrow R_3 - 3R_1}}} \\ &\quad \left[\begin{array}{ccc|ccc} 1 & 2 & -1 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 3 & \inverse{-2} & \inverse{1} & \inverse{0} \\ 0 & 1 & 3 & \inverse{-3} & \inverse{0} & \inverse{1} \end{array}\right] \end{aligned}
(Watch the negative sign in Column 3 of Row 1: 1−2(−1)=31 - 2(-1) = 3 and 0−3(−1)=30 - 3(-1) = 3; missing a minus sign to get −1-1 in Row 2 hides the matching rows and leaves a false pivot of 44 in the bottom-right corner.)
Now subtract Row 2 from Row 3:
→R3←R3−R2[12−1100013−210000−1−11]\displaystyle \begin{aligned} & \xrightarrow{\rowop{R_3 \leftarrow R_3 - R_2}} \\ & \left[\begin{array}{ccc|ccc} 1 & 2 & -1 & \inverse{1} & \inverse{0} & \inverse{0} \\ 0 & 1 & 3 & \inverse{-2} & \inverse{1} & \inverse{0} \\ \fails{0} & \fails{0} & \fails{0} & \inverse{-1} & \inverse{-1} & \inverse{1} \end{array}\right] \end{aligned}
Because Row 3 on the left side becomes [000]\fails{\begin{bmatrix} 0 & 0 & 0 \end{bmatrix}}, CC has no inverse.
5

Given that A−1=[4−1−31]\inverse{A^{-1}} = \inverse{\begin{bmatrix} 4 & -1 \\ -3 & 1 \end{bmatrix}}, solve Ax=bAx = b for b=[25]b = \begin{bmatrix} 2 \\ 5 \end{bmatrix} and then for b=[−13]b = \begin{bmatrix} -1 \\ 3 \end{bmatrix} without doing row reduction.

Since A−1\inverse{A^{-1}} is already given, how do you isolate xx in Ax=bAx = b?

Multiply each vector bb directly by A−1\inverse{A^{-1}} using x=A−1bx = \inverse{A^{-1}}b (watch out: do not invert the given matrix A−1\inverse{A^{-1}} first, because inverting it turns it back into A=[1134]A = \begin{bmatrix} 1 & 1 \\ 3 & 4 \end{bmatrix} and gives the wrong answers [726]\begin{bmatrix} 7 \\ 26 \end{bmatrix} and [29]\begin{bmatrix} 2 \\ 9 \end{bmatrix}).
For b=[25]b = \begin{bmatrix} 2 \\ 5 \end{bmatrix}:
x=A−1b=[4−1−31][25]=[4(2)−1(5)−3(2)+1(5)]=[3−1]\displaystyle x = \inverse{A^{-1}}b = \inverse{\begin{bmatrix} 4 & -1 \\ -3 & 1 \end{bmatrix}}\begin{bmatrix} 2 \\ 5 \end{bmatrix} = \begin{bmatrix} 4(2) - 1(5) \\ -3(2) + 1(5) \end{bmatrix} = \begin{bmatrix} 3 \\ -1 \end{bmatrix}
For b=[−13]b = \begin{bmatrix} -1 \\ 3 \end{bmatrix}:
x=A−1b=[4−1−31][−13]=[4(−1)−1(3)−3(−1)+1(3)]=[−76]\displaystyle x = \inverse{A^{-1}}b = \inverse{\begin{bmatrix} 4 & -1 \\ -3 & 1 \end{bmatrix}}\begin{bmatrix} -1 \\ 3 \end{bmatrix} = \begin{bmatrix} 4(-1) - 1(3) \\ -3(-1) + 1(3) \end{bmatrix} = \begin{bmatrix} -7 \\ 6 \end{bmatrix}
6

Suppose solving Ax=[10]Ax = \begin{bmatrix} 1 \\ 0 \end{bmatrix} gives x=[5−2]x = \begin{bmatrix} 5 \\ -2 \end{bmatrix} and solving Ax=[01]Ax = \begin{bmatrix} 0 \\ 1 \end{bmatrix} gives x=[−73]x = \begin{bmatrix} -7 \\ 3 \end{bmatrix}. Write down A−1\inverse{A^{-1}} directly from these two solutions, and then find AA.

Compare AA−1=[1001]A\inverse{A^{-1}} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} column by column with the two given equations.

Because AA−1=IA\inverse{A^{-1}} = I, the two solutions are the columns of A−1\inverse{A^{-1}} (watch out: putting them in as rows instead of columns gives the transposed matrix [5−2−73]\begin{bmatrix} 5 & -2 \\ -7 & 3 \end{bmatrix}, which then inverts to [3275]\begin{bmatrix} 3 & 2 \\ 7 & 5 \end{bmatrix}):
A−1=[5−7−23]\displaystyle \inverse{A^{-1}} = \begin{bmatrix} \firstcol{5} & \secondcol{-7} \\ \firstcol{-2} & \secondcol{3} \end{bmatrix}
Now invert A−1\inverse{A^{-1}} with the 2×22 \times 2 formula to get AA back. Since (5)(3)−(−7)(−2)=15−14=1(5)(3) - (-7)(-2) = 15 - 14 = 1:
A=11[3725]=[3725]\displaystyle A = \frac{1}{1}\begin{bmatrix} 3 & 7 \\ 2 & 5 \end{bmatrix} = \begin{bmatrix} 3 & 7 \\ 2 & 5 \end{bmatrix}