PrecalculusSystems of Equations and Matrices6 of 6
Systems of Equations and Matrices · 6

Inverse Matrices and Determinants

When we write a system of equations as a matrix equation AX=B\mtx{A}X = \rhs{B}, we cannot divide by the matrix A\mtx{A} to get XX alone. Instead, we need a matrix that multiplies with A\mtx{A} to undo it.

1

The Identity Matrix and Inverse Matrices

To solve the system

{3x+2y=75x+4y=13⟹[3254]⏟A[xy]⏟X=[713]⏟B\displaystyle \begin{cases} \mtx{3}x + \mtx{2}y = \rhs{7} \\ \mtx{5}x + \mtx{4}y = \rhs{13} \end{cases} \quad \Longrightarrow \quad \underbrace{\mtx{\begin{bmatrix} 3 & 2 \\ 5 & 4 \end{bmatrix}}}_{\mtx{A}} \underbrace{\begin{bmatrix} x \\ y \end{bmatrix}}_{X} = \underbrace{\rhs{\begin{bmatrix} 7 \\ 13 \end{bmatrix}}}_{\rhs{B}}

for XX, we first need the matrix version of the number 11 (the identity matrix II, which leaves any matrix unchanged when multiplied) and a matrix that undoes A\mtx{A} (the inverse matrix A−1\inv{A^{-1}}) by canceling A\mtx{A} into II.

The Identity Matrix and Inverse Matrices
5x=15AX=Bx=  ?X=  ?\displaystyle \begin{alignedat}{2} \mtx{5}x &= \rhs{15} \qquad\qquad & \mtx{A}X &= \rhs{B} \\ x &= \;? & X &= \;? \end{alignedat}

Multiplying a matrix A\mtx{A} by its inverse A−1\inv{A^{-1}} cancels both matrices down to the identity matrix II, which has 11s down the main diagonal and 00s everywhere else:

A−1⏟inverse matrixA=I⏟identity matrix,I=[1001],I=[100010001]\displaystyle \begin{aligned} \underbrace{\inv{A^{-1}}}_{\text{inverse matrix}} \mtx{A} &= \underbrace{I}_{\text{identity matrix}}, \\ I &= \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \\ I &= \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \end{aligned}

The −1\inv{-1} in A−1\inv{A^{-1}} means the inverse matrix that undoes A\mtx{A}, not 1A\frac{1}{A}. We never put a matrix in the bottom of a fraction.

2

Finding a 2×22 \times 2 Inverse Matrix

For any 2×22 \times 2 matrix A=[abcd]\mtx{A} = \mtx{\begin{bmatrix} a & b \\ c & d \end{bmatrix}}, we want to build the matrix A−1\inv{A^{-1}} that multiplies with A\mtx{A} to give [1001]\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}.

Finding a 2 × 2 Inverse Matrix
[abcd][????]=[1001]\displaystyle \mtx{\begin{bmatrix} a & b \\ c & d \end{bmatrix}}\inv{\begin{bmatrix} ? & ? \\ ? & ? \end{bmatrix}} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}

Swapping the main diagonal entries and flipping the signs on the other two makes the off-diagonal corners cancel to 00. When ad−bc≠0\detv{ad - bc} \neq 0, dividing by it scales the main diagonal to 11s:

A=[abcd]⟹A−1=1ad−bc⏟scales diagonal to 1[d−b−ca]⏟cancels corners to 0\displaystyle \mtx{A} = \mtx{\begin{bmatrix} a & b \\ c & d \end{bmatrix}} \quad \Longrightarrow \quad \inv{A^{-1}} = \frac{\detv{1}}{\underbrace{\detv{ad - bc}}_{\text{scales diagonal to } 1}} \underbrace{\begin{bmatrix} \mtx{d} & \inv{-}\mtx{b} \\ \inv{-}\mtx{c} & \mtx{a} \end{bmatrix}}_{\text{cancels corners to } 0}

Here is how the formula builds the inverse of A=[3254]\mtx{A} = \mtx{\begin{bmatrix} 3 & 2 \\ 5 & 4 \end{bmatrix}} from our system.

Text solution
Swap the main diagonal and flip the other signsSwapping 3\mtx{3} and 4\mtx{4} and changing 2\mtx{2} and 5\mtx{5} to −2\inv{-}\mtx{2} and −5\inv{-}\mtx{5} makes the off-diagonal entries cancel to 00.
[4−2−53]\displaystyle \begin{bmatrix} \mtx{4} & \inv{-}\mtx{2} \\ \inv{-}\mtx{5} & \mtx{3} \end{bmatrix}
Divide by ad−bc\detv{ad - bc}Since (3)(4)−(2)(5)=2(\mtx{3})(\mtx{4}) - (\mtx{2})(\mtx{5}) = \detv{2}, we divide by 2\detv{2} to scale the diagonal entries to 11.
A−1=1(3)(4)−(2)(5)[4−2−53]=12[4−2−53]=[2−1−2.51.5]\displaystyle \begin{aligned} \inv{A^{-1}} &= \detv{\frac{1}{(\mtx{3})(\mtx{4}) - (\mtx{2})(\mtx{5})}} \begin{bmatrix} \mtx{4} & \inv{-}\mtx{2} \\ \inv{-}\mtx{5} & \mtx{3} \end{bmatrix} \\ &= \detv{\frac{1}{2}} \begin{bmatrix} \mtx{4} & \inv{-}\mtx{2} \\ \inv{-}\mtx{5} & \mtx{3} \end{bmatrix} \\ &= \inv{\begin{bmatrix} 2 & -1 \\ -2.5 & 1.5 \end{bmatrix}} \end{aligned}

Multiplying A−1A\inv{A^{-1}}\mtx{A} gives [1001]\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, confirming that A−1\inv{A^{-1}} undoes A\mtx{A}.

3

The Determinant and When No Inverse Exists

The number ad−bc\detv{ad - bc} in the denominator of the inverse formula is the determinant of A\mtx{A}. Its absolute value is the factor by which the matrix scales area, and it tells us whether an inverse matrix exists at all.

The Determinant and When No Inverse Exists
A−1=1ad−bc[d−b−ca]\displaystyle \inv{A^{-1}} = \frac{\detv{1}}{\detv{ad - bc}} \begin{bmatrix} \mtx{d} & \inv{-}\mtx{b} \\ \inv{-}\mtx{c} & \mtx{a} \end{bmatrix}
ad−bc\displaystyle \detv{ad - bc} =0  ⇒  A−1\displaystyle = \detv{0} \;\Rightarrow\; \inv{A^{-1}} =  ?\displaystyle = \;?

We write the determinant as det⁡(A)\detv{\det(\mtx{A})} or with vertical bars around the matrix:

det⁡(A)\displaystyle \detv{\det(\mtx{A})} =∣A∣\displaystyle = \detv{|\mtx{A}|} =ad−bc\displaystyle = \detv{ad - bc}

The vertical bars in ∣A∣\detv{|\mtx{A}|} mean the determinant of A\mtx{A}, not absolute value. A determinant can be negative or zero.

Area=1\htmlClass{lc-green}{\text{Area} = 1}
A=[3254]\htmlClass{lc-blue}{A} = \htmlClass{lc-blue}{\begin{bmatrix} 3 & 2 \\ 5 & 4 \end{bmatrix}}
det⁡(A)=2\htmlClass{lc-green}{\det(\htmlClass{lc-blue}{A}) = 2}
(Area=2)(\htmlClass{lc-green}{\text{Area} = 2})
A=[2412]\htmlClass{lc-blue}{A} = \htmlClass{lc-blue}{\begin{bmatrix} 2 & 4 \\ 1 & 2 \end{bmatrix}}
det⁡(A)=0\htmlClass{lc-green}{\det(\htmlClass{lc-blue}{A}) = 0}
(Area=0, no inverse)(\htmlClass{lc-green}{\text{Area} = 0}\text{, no inverse})

Now consider what happens when we try to invert A=[2412]\mtx{A} = \mtx{\begin{bmatrix} 2 & 4 \\ 1 & 2 \end{bmatrix}}.

Text solution
Compute the determinant ad−bc\detv{ad - bc}Multiply down the main diagonal and subtract the other diagonal. The absolute value of the result gives the area scaling factor.
det⁡(A)\displaystyle \detv{\det(\mtx{A})} =(2)(2)−(4)(1)\displaystyle = (\mtx{2})(\mtx{2}) - (\mtx{4})(\mtx{1}) =4−4\displaystyle = 4 - 4 =0\displaystyle = \detv{0}
Check whether 1det⁡(A)\detv{\tfrac{1}{\det(\mtx{A})}} is definedBecause det⁡(A)=0\detv{\det(\mtx{A})} = \detv{0}, the inverse formula would divide by zero, and the top row [24]\mtx{\begin{bmatrix} 2 & 4 \end{bmatrix}} is just 22 times the bottom row [12]\mtx{\begin{bmatrix} 1 & 2 \end{bmatrix}}.
1det⁡(A)\displaystyle \detv{\frac{1}{\det(\mtx{A})}} =10(undefined)\displaystyle = \frac{1}{\detv{0}} \quad \text{(undefined)}

So A=[2412]\mtx{A} = \mtx{\begin{bmatrix} 2 & 4 \\ 1 & 2 \end{bmatrix}} flattens the 2D2\text{D} grid onto a single line and has no inverse.

Try dragging the corner of the parallelogram below to see how stretching the grid changes det⁡(A)\detv{\det(\mtx{A})} and A−1\inv{A^{-1}}, and what happens when the parallelogram collapses onto a line.

A matrix scales area, and its inverse scales it back, unless the grid collapses to zero area and no inverse exists.
4

Solving a System with an Inverse Matrix

Now that we have A−1\inv{A^{-1}} for A=[3254]\mtx{A} = \mtx{\begin{bmatrix} 3 & 2 \\ 5 & 4 \end{bmatrix}}, we can solve our original system for xx and yy:

{3x+2y=75x+4y=13⟹[3254][xy]=[713]\displaystyle \begin{cases} \mtx{3}x + \mtx{2}y = \rhs{7} \\ \mtx{5}x + \mtx{4}y = \rhs{13} \end{cases} \quad \Longrightarrow \quad \mtx{\begin{bmatrix} 3 & 2 \\ 5 & 4 \end{bmatrix}} \begin{bmatrix} x \\ y \end{bmatrix} = \rhs{\begin{bmatrix} 7 \\ 13 \end{bmatrix}}
Solving a System with an Inverse Matrix
3x+2y=75x+4y=13(x, y)=  ?\displaystyle \begin{aligned} \mtx{3}x + \mtx{2}y &= \rhs{7} \\ \mtx{5}x + \mtx{4}y &= \rhs{13} \\[6pt] (x,\ y) &= \;? \end{aligned}

Here is the step-by-step calculation.

Text solution
Multiply both sides on the left by A−1\inv{A^{-1}}Because A\mtx{A} sits on the left of XX in AX=B\mtx{A}X = \rhs{B}, placing A−1\inv{A^{-1}} on the left of both sides lets A−1A\inv{A^{-1}}\mtx{A} cancel to II.
[xy]=A−1B=12[4−2−53][713]\displaystyle \begin{bmatrix} x \\ y \end{bmatrix} = \inv{A^{-1}}\rhs{B} = \detv{\frac{1}{2}} \begin{bmatrix} \mtx{4} & \inv{-}\mtx{2} \\ \inv{-}\mtx{5} & \mtx{3} \end{bmatrix} \rhs{\begin{bmatrix} 7 \\ 13 \end{bmatrix}}
Multiply the matrices first, then divide by det⁡(A)\detv{\det(\mtx{A})}Keeping 12\detv{\frac{1}{2}} out front avoids decimals until the very end.
[xy]=12[(4)(7)+(−2)(13)(−5)(7)+(3)(13)]=12[24]=[12]\displaystyle \begin{aligned} \begin{bmatrix} x \\ y \end{bmatrix} &= \detv{\frac{1}{2}} \begin{bmatrix} (\mtx{4})(\rhs{7}) + (\inv{-}\mtx{2})(\rhs{13}) \\ (\inv{-}\mtx{5})(\rhs{7}) + (\mtx{3})(\rhs{13}) \end{bmatrix} \\ &= \detv{\frac{1}{2}} \begin{bmatrix} 2 \\ 4 \end{bmatrix} \\ &= \begin{bmatrix} 1 \\ 2 \end{bmatrix} \end{aligned}

So the solution to the system is x=1x = 1 and y=2y = 2.

5

Finding Inverses with Row Operations

The 2×22 \times 2 shortcut of swapping the diagonal and flipping signs only works on 2×22 \times 2 matrices. To find the inverse of a 3×33 \times 3 matrix like

A=[121253133]\displaystyle \mtx{A} = \mtx{\begin{bmatrix} 1 & 2 & 1 \\ 2 & 5 & 3 \\ 1 & 3 & 3 \end{bmatrix}}

we place A\mtx{A} beside II in an augmented matrix [A∣I]{[\mtx{A} \mid I]} and use row operations to turn the left side into II, which automatically builds A−1\inv{A^{-1}} on the right side:

[AI]→row operations[IA−1]\displaystyle \left[\begin{array}{c|c} \mtx{A} & I \end{array}\right] \xrightarrow{\rowop{\text{row operations}}} \left[\begin{array}{c|c} I & \inv{A^{-1}} \end{array}\right]
Finding Inverses with Row Operations
[121100253010133001]\displaystyle \left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{2} & \mtx{1} & 1 & 0 & 0 \\ \mtx{2} & \mtx{5} & \mtx{3} & 0 & 1 & 0 \\ \mtx{1} & \mtx{3} & \mtx{3} & 0 & 0 & 1 \end{array}\right]
A−1\displaystyle \inv{A^{-1}} =  ?\displaystyle = \;?

Here are the steps that turn [A∣I]{[\mtx{A} \mid I]} into [I∣A−1]{[I \mid \inv{A^{-1}}]} without undoing any zeros along the way.

Text solution
Set up [A∣I]{[\mtx{A} \mid I]} and clear below the diagonal from left to rightUse Row 11 to zero out the entries below it in Column 11, then use the new Row 22 to zero out the entry below it in Column 22.
[121100253010133001]→R2−2R1→R2R3−R1→R3[121100011−210012−101]→R3−R2→R3[121100011−2100011−11]\displaystyle \begin{aligned} &\left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{2} & \mtx{1} & 1 & 0 & 0 \\ \mtx{2} & \mtx{5} & \mtx{3} & 0 & 1 & 0 \\ \mtx{1} & \mtx{3} & \mtx{3} & 0 & 0 & 1 \end{array}\right] \\[6pt] &\quad\xrightarrow{\rowop{\substack{R_2 - 2R_1 \to R_2 \\[3pt] R_3 - R_1 \to R_3}}} \\ &\left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{2} & \mtx{1} & 1 & 0 & 0 \\ \mtx{0} & \mtx{1} & \mtx{1} & -2 & 1 & 0 \\ \mtx{0} & \mtx{1} & \mtx{2} & -1 & 0 & 1 \end{array}\right] \\[6pt] &\quad\xrightarrow{\rowop{R_3 - R_2 \to R_3}} \\ &\left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{2} & \mtx{1} & 1 & 0 & 0 \\ \mtx{0} & \mtx{1} & \mtx{1} & -2 & 1 & 0 \\ \mtx{0} & \mtx{0} & \mtx{1} & 1 & -1 & 1 \end{array}\right] \end{aligned}
Clear above the diagonal from right to leftBecause Row 33 starts with two zeros, subtracting it from Rows 11 and 22 clears Column 33 without changing Columns 11 or 22; then Row 22 clears the remaining 2\mtx{2} in Column 22.
→R2−R3→R2R1−R3→R1[12001−1010−32−10011−11]→R1−2R2→R1[1006−31010−32−10011−11]\displaystyle \begin{aligned} &\quad\xrightarrow{\rowop{\substack{R_2 - R_3 \to R_2 \\[3pt] R_1 - R_3 \to R_1}}} \\ &\left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{2} & \mtx{0} & 0 & 1 & -1 \\ \mtx{0} & \mtx{1} & \mtx{0} & -3 & 2 & -1 \\ \mtx{0} & \mtx{0} & \mtx{1} & 1 & -1 & 1 \end{array}\right] \\[6pt] &\quad\xrightarrow{\rowop{R_1 - 2R_2 \to R_1}} \\ &\left[\begin{array}{ccc|ccc} 1 & 0 & 0 & \inv{6} & \inv{-3} & \inv{1} \\ 0 & 1 & 0 & \inv{-3} & \inv{2} & \inv{-1} \\ 0 & 0 & 1 & \inv{1} & \inv{-1} & \inv{1} \end{array}\right] \end{aligned}

With the identity matrix II completed on the left, the right side gives the inverse:

A−1=[6−31−32−11−11]\displaystyle \inv{A^{-1}} = \inv{\begin{bmatrix} 6 & -3 & 1 \\ -3 & 2 & -1 \\ 1 & -1 & 1 \end{bmatrix}}

When we change the bottom row of A\mtx{A} to [374]\mtx{\begin{bmatrix} 3 & 7 & 4 \end{bmatrix}} (which is Row 11 + Row 22), clearing below the diagonal produces a row of all zeros on the left side:

[121100011−210000⏟all zeros−1−11]\displaystyle \left[\begin{array}{ccc|ccc} & \mtx{1} \quad \mtx{2} \quad \mtx{1} & & 1 & 0 & 0 \\ & \mtx{0} \quad \mtx{1} \quad \mtx{1} & & -2 & 1 & 0 \\ & \underbrace{\mtx{0} \quad \mtx{0} \quad \mtx{0}}_{\text{all zeros}} & & -1 & -1 & 1 \end{array}\right]

The zero row shows that the rows on the left are dependent. Row operations preserve that dependence, so the left side cannot become II. The matrix has no inverse and det⁡(A)=0\detv{\det(\mtx{A})} = \detv{0}.

6

Determinants of 3×33 \times 3 Matrices

For a 3×33 \times 3 matrix, the absolute value of the determinant gives the factor by which the matrix scales 3D3\text{D} volume. To find the determinant of

A=[213041125]\displaystyle \mtx{A} = \mtx{\begin{bmatrix} 2 & 1 & 3 \\ 0 & 4 & 1 \\ 1 & 2 & 5 \end{bmatrix}}

we can either break it into three 2×22 \times 2 determinants along any row or column, or multiply down its full diagonals.

Determinants of 3 × 3 Matrices

When expanding along a row or column, each entry takes its sign from the checkerboard pattern (starting with ++ in the top-left corner and alternating horizontally and vertically) and multiplies the 2×22 \times 2 determinant left uncovered when you cross out that entry's row and column:

[+−+−+−+−+]\displaystyle \begin{bmatrix} + & - & + \\ - & + & - \\ + & - & + \end{bmatrix}

Here are both ways to find det⁡(A)\detv{\det(\mtx{A})} for A=[213041125]\mtx{A} = \mtx{\begin{bmatrix} 2 & 1 & 3 \\ 0 & 4 & 1 \\ 1 & 2 & 5 \end{bmatrix}}.

Text solution
Expand down Column 11 to take advantage of its 0\mtx{0}Using the left column of the checkerboard (+,−,++, -, +), the 0\mtx{0} in Row 22 makes the entire middle 2×22 \times 2 determinant 00.
det⁡(A)=+2det⁡[4125]−0det⁡[1325]⏟0+1det⁡[1341]\displaystyle \begin{aligned} \detv{\det(\mtx{A})} &= +\mtx{2} \detv{\det}\begin{bmatrix} \mtx{4} & \mtx{1} \\ \mtx{2} & \mtx{5} \end{bmatrix} \\ &\quad - \underbrace{\mtx{0} \detv{\det}\begin{bmatrix} \mtx{1} & \mtx{3} \\ \mtx{2} & \mtx{5} \end{bmatrix}}_{0} \\ &\quad + \mtx{1} \detv{\det}\begin{bmatrix} \mtx{1} & \mtx{3} \\ \mtx{4} & \mtx{1} \end{bmatrix} \end{aligned}
Evaluate the remaining two 2×22 \times 2 determinants (ad−bc\detv{ad - bc})Compute the first and third pieces and add them together.
det⁡(A)=2((4)(5)−(1)(2))+1((1)(1)−(3)(4))=2(18)+1(−11)=36−11=25\displaystyle \begin{aligned} \detv{\det(\mtx{A})} &= \mtx{2}\big((\mtx{4})(\mtx{5}) - (\mtx{1})(\mtx{2})\big) \\ &\quad + \mtx{1}\big((\mtx{1})(\mtx{1}) - (\mtx{3})(\mtx{4})\big) \\ &= \mtx{2}(\detv{18}) + \mtx{1}(\detv{-11}) \\ &= 36 - 11 = \detv{25} \end{aligned}
Alternative, copy the first two columns and multiply diagonalsRewrite Columns 11 and 22 to the right of the matrix, then subtract the sum of the three backward diagonals from the sum of the three forward diagonals.
213210410412512⟹det⁡(A)=(2)(4)(5)+(1)(1)(1)+(3)(0)(2)⏟forward =41−((3)(4)(1)+(2)(1)(2)+(1)(0)(5))⏟backward =16=25\displaystyle \begin{aligned} &\left.\begin{array}{ccc|cc} \mtx{2} & \mtx{1} & \mtx{3} & \mtx{2} & \mtx{1} \\ \mtx{0} & \mtx{4} & \mtx{1} & \mtx{0} & \mtx{4} \\ \mtx{1} & \mtx{2} & \mtx{5} & \mtx{1} & \mtx{2} \end{array}\right. \Longrightarrow \\ &\detv{\det(\mtx{A})} = \\ &\underbrace{(\mtx{2})(\mtx{4})(\mtx{5}) + (\mtx{1})(\mtx{1})(\mtx{1}) + (\mtx{3})(\mtx{0})(\mtx{2})}_{\text{forward } = 41} - \\ &\underbrace{((\mtx{3})(\mtx{4})(\mtx{1}) + (\mtx{2})(\mtx{1})(\mtx{2}) + (\mtx{1})(\mtx{0})(\mtx{5}))}_{\text{backward } = 16} \\ &= \detv{25} \end{aligned}

Both methods give det⁡(A)=25\detv{\det(\mtx{A})} = \detv{25}, so A\mtx{A} scales 3D3\text{D} volume by 25\detv{25} and has an inverse.

Compare the six possible expansions below to see why every row and column gives 25\detv{25}.

Expanding along any row or column gives the exact same determinant, and any zero entry cancels its entire smaller piece.
7

Cramer's Rule

Writing out X=A−1BX = \inv{A^{-1}}\rhs{B} for a general system turns each variable into a fraction of two determinants. This gives us Cramer's Rule, which solves directly for any single variable without having to find the others first.

Cramer's Rule
[abcd][xy]=[ef]\displaystyle \mtx{\begin{bmatrix} a & b \\ c & d \end{bmatrix}} \begin{bmatrix} x \\ y \end{bmatrix} = \rhs{\begin{bmatrix} e \\ f \end{bmatrix}}
x\displaystyle x =  ?\displaystyle = \;?

For any 2×22 \times 2 or 3×33 \times 3 system with coefficient determinant D=det⁡(A)≠0\detv{D} = \detv{\det(\mtx{A})} \neq 0, each variable equals the determinant formed by replacing that variable's column with the answer column B\rhs{B}, divided by D\detv{D}:

x\displaystyle x =DxD,y\displaystyle = \frac{\detv{D_x}}{\detv{D}}, \qquad y =DyD,z\displaystyle = \frac{\detv{D_y}}{\detv{D}}, \qquad z =DzD\displaystyle = \frac{\detv{D_z}}{\detv{D}}

Here is how Cramer's Rule solves our original system {3x+2y=75x+4y=13\begin{cases} \mtx{3}x + \mtx{2}y = \rhs{7} \\ \mtx{5}x + \mtx{4}y = \rhs{13} \end{cases}.

Text solution
Find the base determinant D\detv{D} from the coefficient matrixTake the determinant of the original xx- and yy-columns.
D=det⁡[3254]=(3)(4)−(2)(5)=2\displaystyle \begin{aligned} \detv{D} &= \detv{\det}\begin{bmatrix} \mtx{3} & \mtx{2} \\ \mtx{5} & \mtx{4} \end{bmatrix} \\ &= (\mtx{3})(\mtx{4}) - (\mtx{2})(\mtx{5}) = \detv{2} \end{aligned}
Replace each variable's column with the answers [713]\rhs{\begin{bmatrix} 7 \\ 13 \end{bmatrix}}Swap the answer column into the xx-column to get Dx\detv{D_x}, and into the yy-column to get Dy\detv{D_y}.
Dx=det⁡[72134]=(7)(4)−(2)(13)=2,Dy=det⁡[37513]=(3)(13)−(7)(5)=4\displaystyle \begin{aligned} \detv{D_x} &= \detv{\det}\begin{bmatrix} \rhs{7} & \mtx{2} \\ \rhs{13} & \mtx{4} \end{bmatrix} \\ &= (\rhs{7})(\mtx{4}) - (\mtx{2})(\rhs{13}) = \detv{2}, \\ \detv{D_y} &= \detv{\det}\begin{bmatrix} \mtx{3} & \rhs{7} \\ \mtx{5} & \rhs{13} \end{bmatrix} \\ &= (\mtx{3})(\rhs{13}) - (\rhs{7})(\mtx{5}) = \detv{4} \end{aligned}
Divide by D\detv{D}Divide each numerator determinant by D=2\detv{D} = \detv{2}.
x=DxD=22=1,y=DyD=42=2\displaystyle \begin{aligned} x &= \frac{\detv{D_x}}{\detv{D}} = \frac{\detv{2}}{\detv{2}} = 1, \\ y &= \frac{\detv{D_y}}{\detv{D}} = \frac{\detv{4}}{\detv{2}} = 2 \end{aligned}

This gives x=1x = 1 and y=2y = 2 in one direct step per variable.

Key concepts

Undoing a matrix A\mtx{A} means multiplying by its inverse A−1\inv{A^{-1}} to get the identity matrix II (A−1A=I\inv{A^{-1}}\mtx{A} = I, where II has 11s on the main diagonal and 00s elsewhere). When A\mtx{A} has an inverse, that lets us solve a system AX=B\mtx{A}X = \rhs{B} by multiplying on the left: X=A−1BX = \inv{A^{-1}}\rhs{B}. For a square matrix, whether an inverse exists depends on the determinant det⁡(A)\detv{\det(\mtx{A})}. Its absolute value gives the area or volume scaling factor. If det⁡(A)=0\detv{\det(\mtx{A})} = \detv{0}, the matrix collapses space and has no inverse.

The size of the matrix and what the question asks for tell you which method to pick:

2×22 \times 2 inverse and determinant

When det⁡(A)=ad−bc≠0\detv{\det(\mtx{A})} = \detv{ad - bc} \neq 0, swap the main diagonal, flip the signs on the other two entries, and divide by the determinant:

A=[abcd]⟹A−1=1ad−bc[d−b−ca]\displaystyle \mtx{A} = \mtx{\begin{bmatrix} a & b \\ c & d \end{bmatrix}} \quad \Longrightarrow \quad \inv{A^{-1}} = \detv{\frac{1}{ad - bc}}\begin{bmatrix} \mtx{d} & \inv{-}\mtx{b} \\ \inv{-}\mtx{c} & \mtx{a} \end{bmatrix}
For A=[3254]\mtx{A} = \mtx{\begin{bmatrix} 3 & 2 \\ 5 & 4 \end{bmatrix}}, det⁡(A)=(3)(4)−(2)(5)=2\detv{\det(\mtx{A})} = (\mtx{3})(\mtx{4}) - (\mtx{2})(\mtx{5}) = \detv{2}, so A−1=12[4−2−53]\inv{A^{-1}} = \detv{\frac{1}{2}}\begin{bmatrix} \mtx{4} & \inv{-}\mtx{2} \\ \inv{-}\mtx{5} & \mtx{3} \end{bmatrix}. When solving X=A−1B{X = \inv{A^{-1}}\rhs{B}}, leave 1det⁡(A)\detv{\frac{1}{\det(\mtx{A})}} factored out front until after you multiply the matrices.

3×33 \times 3 inverse

Set up [AI]\left[\begin{array}{c|c} \mtx{A} & I \end{array}\right] and row-reduce to [IA−1]\left[\begin{array}{c|c} I & \inv{A^{-1}} \end{array}\right] by clearing below the diagonal from left to right, then above the diagonal from right to left. Swap rows when needed to get a nonzero pivot, and scale pivot rows to make the diagonal entries 11. If an entire row on the left turns into [000]\mtx{\begin{bmatrix} 0 & 0 & 0 \end{bmatrix}}, stop immediately: det⁡(A)=0\detv{\det(\mtx{A})} = \detv{0} and A\mtx{A} has no inverse.

3×33 \times 3 determinant

Scan for zeros first. If a row or column contains zeros (like Column 11 of [213041125]\mtx{\begin{bmatrix} 2 & 1 & 3 \\ 0 & 4 & 1 \\ 1 & 2 & 5 \end{bmatrix}}), expand along that line using the checkerboard signs [+−+−+−+−+]\begin{bmatrix} + & - & + \\ - & + & - \\ + & - & + \end{bmatrix} so every zero term drops out. If there are no zeros, copy the first two columns to the right and compute (sum of forward diagonals)(\text{sum of forward diagonals}) −(sum of backward diagonals)- (\text{sum of backward diagonals}).

When finding one variable

If a problem gives a 3×33 \times 3 system with nonzero coefficient determinant and only asks for one variable like zz, you can use Cramer's Rule, replacing only the zz-column with the constants B\rhs{B}:

z\displaystyle z =DzD\displaystyle = \frac{\detv{D_z}}{\detv{D}}

8

Practice

1

Find the inverse of the matrix A=[4−3−22]\mtx{A} = \mtx{\begin{bmatrix} 4 & -3 \\ -2 & 2 \end{bmatrix}}.

Which two entries swap places, which two flip signs, and what happens to the signs in ad−bc\detv{ad - bc} when both b\mtx{b} and c\mtx{c} are negative?

First find the determinant ad−bc\detv{ad - bc}:
det⁡(A)\displaystyle \detv{\det(\mtx{A})} =(4)(2)−(−3)(−2)\displaystyle = (\mtx{4})(\mtx{2}) - (\mtx{-3})(\mtx{-2}) =8−6\displaystyle = 8 - 6 =2\displaystyle = \detv{2}
(Watch out: (−3)(−2)(\mtx{-3})(\mtx{-2}) is +6+6, so subtracting bc\mtx{bc} gives 8−6=28 - 6 = \detv{2}; adding them to get 1414 gives the wrong fraction 114\frac{1}{14} out front.)
Next, swap the main diagonal (4\mtx{4} and 2\mtx{2}) and flip the signs of the other two entries (−3\mtx{-3} and −2\mtx{-2} become +3\inv{+}\mtx{3} and +2\inv{+}\mtx{2}):
A−1=12[2324]=[11.512]\displaystyle \inv{A^{-1}} = \detv{\frac{1}{2}} \begin{bmatrix} \mtx{2} & \mtx{3} \\ \mtx{2} & \mtx{4} \end{bmatrix} = \inv{\begin{bmatrix} 1 & 1.5 \\ 1 & 2 \end{bmatrix}}
2

Solve the system 4x+3y=104x + 3y = 10, 3x+2y=73x + 2y = 7 by writing it as a matrix equation AX=B\mtx{A}X = \rhs{B} and using A−1\inv{A^{-1}}.

Write A=[4332]\mtx{A} = \mtx{\begin{bmatrix} 4 & 3 \\ 3 & 2 \end{bmatrix}} and B=[107]\rhs{B} = \rhs{\begin{bmatrix} 10 \\ 7 \end{bmatrix}}, and pay close attention to the sign of det⁡(A)\detv{\det(\mtx{A})}.

In matrix form, [4332][xy]=[107]\mtx{\begin{bmatrix} 4 & 3 \\ 3 & 2 \end{bmatrix}} \begin{bmatrix} x \\ y \end{bmatrix} = \rhs{\begin{bmatrix} 10 \\ 7 \end{bmatrix}}. Compute det⁡(A)\detv{\det(\mtx{A})}:
det⁡(A)\displaystyle \detv{\det(\mtx{A})} =(4)(2)−(3)(3)\displaystyle = (\mtx{4})(\mtx{2}) - (\mtx{3})(\mtx{3}) =8−9\displaystyle = 8 - 9 =−1\displaystyle = \detv{-1}
(Watch out: dropping the negative sign on det⁡(A)=−1\detv{\det(\mtx{A})} = \detv{-1} leaves the signs of A−1\inv{A^{-1}} backwards and gives the wrong answer x=−1,y=−2x = -1, y = -2.)
Build A−1\inv{A^{-1}} and multiply on the left of B\rhs{B}:
A−1=1−1[2−3−34]=[−233−4]\displaystyle \inv{A^{-1}} = \detv{\frac{1}{-1}} \begin{bmatrix} \mtx{2} & \inv{-}\mtx{3} \\ \inv{-}\mtx{3} & \mtx{4} \end{bmatrix} = \inv{\begin{bmatrix} -2 & 3 \\ 3 & -4 \end{bmatrix}}
[xy]=A−1B=[−233−4][107]=[(−2)(10)+(3)(7)(3)(10)+(−4)(7)]=[12]\displaystyle \begin{aligned} \begin{bmatrix} x \\ y \end{bmatrix} = \inv{A^{-1}}\rhs{B} &= \inv{\begin{bmatrix} -2 & 3 \\ 3 & -4 \end{bmatrix}} \rhs{\begin{bmatrix} 10 \\ 7 \end{bmatrix}} \\ &= \begin{bmatrix} (\inv{-2})(\rhs{10}) + (\inv{3})(\rhs{7}) \\ (\inv{3})(\rhs{10}) + (\inv{-4})(\rhs{7}) \end{bmatrix} \\ &= \begin{bmatrix} 1 \\ 2 \end{bmatrix} \end{aligned}
x\displaystyle x =1,y\displaystyle = 1, \quad y =2\displaystyle = 2
3

For what value of kk does the matrix A=[6k34]\mtx{A} = \mtx{\begin{bmatrix} 6 & k \\ 3 & 4 \end{bmatrix}} have no inverse?

What value of det⁡(A)\detv{\det(\mtx{A})} makes the inverse formula divide by zero?

A matrix has no inverse when its determinant is 0\detv{0}:
det⁡(A)\displaystyle \detv{\det(\mtx{A})} =(6)(4)−(k)(3)\displaystyle = (\mtx{6})(\mtx{4}) - (\mtx{k})(\mtx{3}) =24−3k\displaystyle = 24 - 3k =0\displaystyle = \detv{0}
(Watch out: the formula is ad−bc\detv{ad - bc}, not ad+bcad + bc; adding the diagonals as 24+3k=024 + 3k = 0 gives the wrong sign k=−8k = -8.)
Solving 24−3k=024 - 3k = 0 gives:
k\displaystyle k =8\displaystyle = 8
4

Find the determinant of A=[21403−2125]\mtx{A} = \mtx{\begin{bmatrix} 2 & 1 & 4 \\ 0 & 3 & -2 \\ 1 & 2 & 5 \end{bmatrix}}.

Which column contains a 00, and what are the checkerboard signs down that column?

Expand down Column 11 ([201]\mtx{\begin{bmatrix} 2 \\ 0 \\ 1 \end{bmatrix}}), where the checkerboard signs are +,−,++, -, + and the middle term with 0\mtx{0} drops out:
det⁡(A)=+2det⁡[3−225]−0det⁡[1425]+1det⁡[143−2]\displaystyle \begin{aligned} \detv{\det(\mtx{A})} &= +\mtx{2} \detv{\det}\begin{bmatrix} \mtx{3} & \mtx{-2} \\ \mtx{2} & \mtx{5} \end{bmatrix} \\ &\quad - \mtx{0} \detv{\det}\begin{bmatrix} \mtx{1} & \mtx{4} \\ \mtx{2} & \mtx{5} \end{bmatrix} \\ &\quad + \mtx{1} \detv{\det}\begin{bmatrix} \mtx{1} & \mtx{4} \\ \mtx{3} & \mtx{-2} \end{bmatrix} \end{aligned}
Compute the two 2×22 \times 2 determinants using ad−bc\detv{ad - bc}:
det⁡[3−225]=(3)(5)−(−2)(2)=15−(−4)=19\displaystyle \detv{\det}\begin{bmatrix} \mtx{3} & \mtx{-2} \\ \mtx{2} & \mtx{5} \end{bmatrix} = (\mtx{3})(\mtx{5}) - (\mtx{-2})(\mtx{2}) = 15 - (-4) = \detv{19}
(Watch out: subtracting (−2)(2)=−4(\mtx{-2})(\mtx{2}) = -4 means 15−(−4)=1915 - (-4) = \detv{19}; subtracting 15−4=1115 - 4 = 11 instead leads to the wrong determinant 88.)
det⁡[143−2]=(1)(−2)−(4)(3)=−2−12=−14\displaystyle \detv{\det}\begin{bmatrix} \mtx{1} & \mtx{4} \\ \mtx{3} & \mtx{-2} \end{bmatrix} = (\mtx{1})(\mtx{-2}) - (\mtx{4})(\mtx{3}) = -2 - 12 = \detv{-14}
Put the pieces together:
det⁡(A)\displaystyle \detv{\det(\mtx{A})} =2(19)+1(−14)\displaystyle = \mtx{2}(\detv{19}) + \mtx{1}(\detv{-14}) =38−14\displaystyle = 38 - 14 =24\displaystyle = \detv{24}
5

Use row operations on [A∣I]{[\mtx{A} \mid I]} to find the inverse of A=[112123236]\mtx{A} = \mtx{\begin{bmatrix} 1 & 1 & 2 \\ 1 & 2 & 3 \\ 2 & 3 & 6 \end{bmatrix}}.

Clear below the diagonal from left to right first (R2−R1\rowop{R_2 - R_1}, R3−2R1\rowop{R_3 - 2R_1}, then R3−R2\rowop{R_3 - R_2}), then clear above the diagonal from right to left.

Set up [A∣I]{[\mtx{A} \mid I]} and clear below the main diagonal from left to right:
[112100123010236001]→R2−R1→R2R3−2R1→R3[112100011−110012−201]→R3−R2→R3[112100011−110001−1−11]\displaystyle \begin{aligned} &\left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{1} & \mtx{2} & 1 & 0 & 0 \\ \mtx{1} & \mtx{2} & \mtx{3} & 0 & 1 & 0 \\ \mtx{2} & \mtx{3} & \mtx{6} & 0 & 0 & 1 \end{array}\right] \\[6pt] &\quad\xrightarrow{\rowop{\substack{R_2 - R_1 \to R_2 \\[3pt] R_3 - 2R_1 \to R_3}}} \\ &\left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{1} & \mtx{2} & 1 & 0 & 0 \\ \mtx{0} & \mtx{1} & \mtx{1} & -1 & 1 & 0 \\ \mtx{0} & \mtx{1} & \mtx{2} & -2 & 0 & 1 \end{array}\right] \\[6pt] &\quad\xrightarrow{\rowop{R_3 - R_2 \to R_3}} \\ &\left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{1} & \mtx{2} & 1 & 0 & 0 \\ \mtx{0} & \mtx{1} & \mtx{1} & -1 & 1 & 0 \\ \mtx{0} & \mtx{0} & \mtx{1} & -1 & -1 & 1 \end{array}\right] \end{aligned}
(Watch out: in R3−R2→R3\rowop{R_3 - R_2 \to R_3} on the right side, −2−(−1)-2 - (-1) is −1-1, not −3-3; missing that double negative throws off the entire bottom row and everything above it when you clear upward.)
Now clear above the diagonal from right to left, using Row 33 to clear Column 33 and then Row 22 to clear Column 22:
→R2−R3→R2R1−2R3→R1[11032−201002−1001−1−11]→R1−R2→R1[10030−101002−1001−1−11]\displaystyle \begin{aligned} &\quad\xrightarrow{\rowop{\substack{R_2 - R_3 \to R_2 \\[3pt] R_1 - 2R_3 \to R_1}}} \\ &\left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{1} & \mtx{0} & 3 & 2 & -2 \\ \mtx{0} & \mtx{1} & \mtx{0} & 0 & 2 & -1 \\ \mtx{0} & \mtx{0} & \mtx{1} & -1 & -1 & 1 \end{array}\right] \\[6pt] &\quad\xrightarrow{\rowop{R_1 - R_2 \to R_1}} \\ &\left[\begin{array}{ccc|ccc} 1 & 0 & 0 & \inv{3} & \inv{0} & \inv{-1} \\ 0 & 1 & 0 & \inv{0} & \inv{2} & \inv{-1} \\ 0 & 0 & 1 & \inv{-1} & \inv{-1} & \inv{1} \end{array}\right] \end{aligned}
A−1=[30−102−1−1−11]\displaystyle \inv{A^{-1}} = \inv{\begin{bmatrix} 3 & 0 & -1 \\ 0 & 2 & -1 \\ -1 & -1 & 1 \end{bmatrix}}
6

Use row operations on [A∣I]{[\mtx{A} \mid I]} to determine whether A=[12−125037−1]\mtx{A} = \mtx{\begin{bmatrix} 1 & 2 & -1 \\ 2 & 5 & 0 \\ 3 & 7 & -1 \end{bmatrix}} has an inverse.

Clear Column 11 below the top-left 11, then use the new Row 22 to clear Row 33 and look at the left side of the bottom row.

Set up [A∣I]{[\mtx{A} \mid I]} and clear Column 11 using Row 11:
[12−110025001037−1001]→R2−2R1→R2R3−3R1→R3[12−1100012−210012−301]\displaystyle \begin{aligned} &\left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{2} & \mtx{-1} & 1 & 0 & 0 \\ \mtx{2} & \mtx{5} & \mtx{0} & 0 & 1 & 0 \\ \mtx{3} & \mtx{7} & \mtx{-1} & 0 & 0 & 1 \end{array}\right] \\[6pt] &\quad\xrightarrow{\rowop{\substack{R_2 - 2R_1 \to R_2 \\[3pt] R_3 - 3R_1 \to R_3}}} \\ &\left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{2} & \mtx{-1} & 1 & 0 & 0 \\ \mtx{0} & \mtx{1} & \mtx{2} & -2 & 1 & 0 \\ \mtx{0} & \mtx{1} & \mtx{2} & -3 & 0 & 1 \end{array}\right] \end{aligned}
(Watch out: in Column 33 of Row 22, 0−2(−1)=+20 - 2(-1) = +2, and in Row 33, −1−3(−1)=+2-1 - 3(-1) = +2; getting −2-2 or −4-4 here hides the fact that the two rows match.)
Now subtract Row 22 from Row 33 (R3−R2→R3\rowop{R_3 - R_2 \to R_3}):
[12−1100012−210000−1−11]\displaystyle \left[\begin{array}{ccc|ccc} \mtx{1} & \mtx{2} & \mtx{-1} & 1 & 0 & 0 \\ \mtx{0} & \mtx{1} & \mtx{2} & -2 & 1 & 0 \\ \mtx{0} & \mtx{0} & \mtx{0} & -1 & -1 & 1 \end{array}\right]
Because the entire bottom row on the left side becomes [000]\mtx{\begin{bmatrix} 0 & 0 & 0 \end{bmatrix}} (Row 33 was Row 11 + Row 22), it is impossible to reach II:
No inverse (det⁡(A)=0)\displaystyle \text{No inverse } (\det(A) = 0)
7

Use Cramer's Rule to find the value of zz in the system 2x+y+z=62x + y + z = 6, 3y−z=43y - z = 4, x+2y+z=7x + 2y + z = 7.

Notice that the second equation 3y−z=43y - z = 4 has no xx-term. What number belongs in Row 22, Column 11, and which column gets replaced by [647]\rhs{\begin{bmatrix} 6 \\ 4 \\ 7 \end{bmatrix}} to form Dz\detv{D_z}?

Because 3y−z=43y - z = 4 has 0x\mtx{0}x, Row 22 of the coefficient matrix begins with 0\mtx{0}. Expand D\detv{D} down Column 11:
D=det⁡[21103−1121]=+2det⁡[3−121]−0+1det⁡[113−1]=2(3−(−2))+1(−1−3)=10−4=6\displaystyle \begin{aligned} \detv{D} &= \detv{\det}\begin{bmatrix} \mtx{2} & \mtx{1} & \mtx{1} \\ \mtx{0} & \mtx{3} & \mtx{-1} \\ \mtx{1} & \mtx{2} & \mtx{1} \end{bmatrix} \\ &= +\mtx{2}\detv{\det}\begin{bmatrix} \mtx{3} & \mtx{-1} \\ \mtx{2} & \mtx{1} \end{bmatrix} - \mtx{0} \\ &\quad + \mtx{1}\detv{\det}\begin{bmatrix} \mtx{1} & \mtx{1} \\ \mtx{3} & \mtx{-1} \end{bmatrix} \\ &= \mtx{2}(3 - (-2)) + \mtx{1}(-1 - 3) \\ &= 10 - 4 = \detv{6} \end{aligned}
(Watch out: forgetting the 0\mtx{0} for the missing xx-term in 3y−z=43y - z = 4 and writing Row 22 as [3−10]\begin{bmatrix} 3 & -1 & 0 \end{bmatrix} throws off both determinants.)
Now replace the zz-column (Column 33) with the answers [647]\rhs{\begin{bmatrix} 6 \\ 4 \\ 7 \end{bmatrix}} to form Dz\detv{D_z}, and expand down Column 11 again:
Dz=det⁡[216034127]=+2det⁡[3427]−0+1det⁡[1634]=2(21−8)+1(4−18)=26−14=12\displaystyle \begin{aligned} \detv{D_z} &= \detv{\det}\begin{bmatrix} \mtx{2} & \mtx{1} & \rhs{6} \\ \mtx{0} & \mtx{3} & \rhs{4} \\ \mtx{1} & \mtx{2} & \rhs{7} \end{bmatrix} \\ &= +\mtx{2}\detv{\det}\begin{bmatrix} \mtx{3} & \rhs{4} \\ \mtx{2} & \rhs{7} \end{bmatrix} - \mtx{0} \\ &\quad + \mtx{1}\detv{\det}\begin{bmatrix} \mtx{1} & \rhs{6} \\ \mtx{3} & \rhs{4} \end{bmatrix} \\ &= \mtx{2}(21 - 8) + \mtx{1}(4 - 18) \\ &= 26 - 14 = \detv{12} \end{aligned}
Divide Dz\detv{D_z} by D\detv{D} (watch out: it is DzD=126\frac{\detv{D_z}}{\detv{D}} = \frac{\detv{12}}{\detv{6}}, not DDz=612=12\frac{\detv{D}}{\detv{D_z}} = \frac{6}{12} = \frac{1}{2}):
z\displaystyle z =DzD\displaystyle = \frac{\detv{D_z}}{\detv{D}} =126\displaystyle = \frac{\detv{12}}{\detv{6}} =2\displaystyle = 2