To solve a matrix system Ax=b in a single step by undoing A, we need a way to find its inverse, A−1.
For any matrix A that mixes inputs together, we are looking for the matrix A−1 that un-mixes them, so that A−1 times A is the identity matrix:
A−1A=identity I[1001]
The −1 in A−1 means the inverse operation that undoes A, not dividing 1 by A.
Un-mixing a Matrix with Row Operations
3x3−1=12=31AxA−1=b=?
1
Recording Row Operations with [A∣I]
Row operations can un-mix A down to I, so we need a way to record those operations in a single matrix as we go. Let's find the inverse of
A=[1327]
by placing I right next to A and applying every row operation across both sides until the left side becomes I.
Inverting a 2×2 Matrix with [A | I]
[13271001]
↓⏐
[1001????]
Text solution
Set up [A∣I] and clear below the first pivotSubtract 3 times Row 1 from Row 2 across all four columns so the 3 below the top-left pivot becomes 0.
R2←R2−3R1[13271001][10211−301]
Clear above the second pivotUse the 1 in the bottom-right corner of the left side to eliminate the 2 above it.
R1←R1−2R2[10211−301][10017−3−21]
Because the left side is now I, the right side has recorded every un-mixing step, giving A−1=[7−3−21].
Starting the right side at I records every row operation we do to A. The moment the left side reaches I, those recorded operations on the right have built 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×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×3 matrix
A=12−1130023
by sweeping in a fixed order that keeps each finished column intact.
Inverting a 3×3 Matrix with the Two-Phase Sweep
12−1130023100010001
A−1=?
Text solution
Clear Column 1 below the first pivotUse the top-left 1 in Row 1 to eliminate the 2 and −1 below it.
With I on the left, the right side gives A−1=9−83−33−12−21.
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 1 automatically, but most matrices need you to swap rows when a 0 lands in a pivot spot or divide a row when a pivot is not 1. Let's invert
B=[2415]
where neither pivot starts out as 1.
Row Swaps and Non-Unit Pivots
[B∣I]B−1=[24151001]=?
Text solution
Clear below the first pivot before dividingBecause the 4 in Row 2 is a multiple of the pivot 2 in Row 1, eliminate the 4 first so you hold off on fractions until the end.
R2←R2−2R1[24151001][20131−201]
Scale the second pivot to 1 and clear above itDivide Row 2 by 3 across both sides, then subtract Row 2 from Row 1 to clear the second column.
This leaves the inverse B−1=[65−32−6131] on the right side.
4
The 2×2 Inverse Formula
For any 2×2 matrix
A=[acbd]
doing these exact row-reduction steps once with letters gives a shortcut formula that goes straight to A−1.
The 2×2 Inverse Formula
[2415]−1[acbd]−1=[65−32−6131]=?
To invert a 2×2 matrix directly, swap the main diagonal entries a and d, flip the signs of b and c, and divide by ad−bc:
A−1=determinantad−bc1[d−c−ba]
When ad−bc=1, as in our first matrix [1327] where (1)(7)−(2)(3)=1, the fraction out front is 11 and the inverse has only whole numbers.
5
When a Matrix Has No Inverse
The 2×2 formula divides by ad−bc, which brings up a natural question: what happens when ad−bc=0, such as for the matrix
A=[1224]?
When a Matrix Has No Inverse
A−1=ad−bc1[d−c−ba]
ad−bc=0⟹A−1=?
Text solution
Eliminate below the first pivotSubtract 2 times Row 1 from Row 2 to clear the bottom-left entry.
R2←R2−2R1[12241001][10201−201]
Because the entire bottom row on the left side became [00], no row operation can ever put a pivot of 1 in the second column, so A has no inverse.
When one row of A is a multiple of the other, the rows aren't independent: the zero row in [A∣I], the zero area ad−bc=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, we can solve any system Ax=b that uses the coefficient matrix A without doing elimination again. Let's solve
1x+1y+0z2x+3y+2z−1x+0y+3z=5=4=1
using the inverse A−1 we already found for this 3×3 matrix.
Solving Systems with the Inverse
A−1bxyz=9−83−33−12−21=541=?
Text solution
Isolate x by multiplying by A−1Write the system as Ax=b with b=541 and multiply both sides on the left by A−1.
x=A−1b=9−83−33−12−21541
Multiply A−1 by b row by rowTake the dot product of each row of A−1 with the column vector b.
So the solution is x=35,y=−30,z=12, and we can solve for any new right-hand side vector b in one multiplication by the same 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×2 matrixA=[acbd], 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−bc:
A−1so for BB−1=ad−bc1[d−c−ba],=[2415],=2(5)−1(4)1[5−4−12]=61[5−4−12]
For a 3×3 (or larger) matrix, set up [A∣I] and reduce the left side to I 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] into [IA−1]. If a 0 lands in a pivot spot, swap only with a row below it (across all columns), and if a pivot is not 1, use it to clear multiples in its column before dividing so you hold off on fractions until the end.
If ad−bc=0 in a 2×2 matrix, or if an entire row on the left side becomes all zeros during elimination (such as [10201−201]), stop right away: one row is a combination of the others and A−1 does not exist.
Finally, know when not to find A−1: if you only need to solve Ax=b once for a single vector b and aren't given A−1, reducing [A∣b] is much faster than finding A−1. Use x=A−1b when A−1 is already given or when you have to solve for several different right-hand sides b1,b2,…; and if you are given the solutions to Ax=[10] and Ax=[01], put those solution vectors directly in as the columns of A−1 without doing any row reduction at all.
7
Practice
1
Use the 2×2 inverse formula to find the inverse of A=[3524].
Watch out: subtracting in the wrong order 10−12=−2 flips every sign to [−2251−23].
Find ad−bc first, then check which diagonal swaps places and which diagonal flips sign.
Find the determinant:
ad−bc=(3)(4)−(2)(5)=12−10=2
Swap the main diagonal entries 3 and 4, flip the signs of the off-diagonal entries 2 and 5 (watch out: forgetting to flip the signs of 2 and 5 gives [225123], and subtracting in the wrong order 10−12=−2 flips every sign to [−2251−23]), and divide by 2:
A−1=21[4−5−23]=[2−25−123]
2
Find the inverse of A=110231012 by row-reducing [A∣I] with the two-phase sweep.
Watch the sign on the right side in R3←R3−R2: subtracting −1 in the first column gives 0−(−1)=+1; writing −1 there leads to the wrong answer 10−1−42−12−11.
Row 3 already has a 0 in Column 1, so only Row 2 needs clearing in the first column before you move to the middle pivot.
Set up [A∣I] and sweep down left to right with R2←R2−R1 and then R3←R3−R2:
(Watch the sign on the right side in R3←R3−R2: subtracting −1 in the first column gives 0−(−1)=+1; writing −1 there leads to the wrong answer 10−1−42−12−11.)
Now sweep up right to left with R2←R2−R3 and then R1←R1−2R2:
Find the inverse of B=120123011 by row-reducing [B∣I].
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 35−320−3131031−311.
After clearing the 2 in Column 1, look at what lands in the middle pivot spot. Which row can you swap with without undoing Column 1?
A 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 35−320−3131031−311):
R2↔R310013001110−2001010
Sweep up by clearing Column 3 with R2←R2−R3, dividing Row 2 by 3, and clearing Column 2 with R1←R1−R2:
(Watch the negative sign in Column 3 of Row 1: 1−2(−1)=3 and 0−3(−1)=3; missing a minus sign to get −1 in Row 2 hides the matching rows and leaves a false pivot of 4 in the bottom-right corner.)
Now subtract Row 2 from Row 3:
R3←R3−R2100210−1301−2−101−1001
Because Row 3 on the left side becomes [000],C has no inverse.
5
Given that A−1=[4−3−11], solve Ax=b for b=[25] and then for b=[−13] without doing row reduction.
Watch out: do not invert the given matrix A−1 first, because inverting it turns it back into A=[1314] and gives the wrong answers [726] and [29].
Since A−1 is already given, how do you isolate x in Ax=b?
Multiply each vector b directly by A−1 using x=A−1b (watch out: do not invert the given matrix A−1 first, because inverting it turns it back into A=[1314] and gives the wrong answers [726] and [29]).
Suppose solving Ax=[10] gives x=[5−2] and solving Ax=[01] gives x=[−73]. Write down A−1 directly from these two solutions, and then find A.
Compare AA−1=[1001] column by column with the two given equations.
Because AA−1=I, the two solutions are the columns of A−1 (watch out: putting them in as rows instead of columns gives the transposed matrix [5−7−23], which then inverts to [3725]):
A−1=[5−2−73]
Now invert A−1 with the 2×2 formula to get A back. Since (5)(3)−(−7)(−2)=15−14=1: