Determinants & Inverses

Study Sheet

Determinants & Inverses

One number that decides invertibility

The Determinant

Tip
2×2 and 3×3 by hand
xAe₁ = (3, 1)Ae₂ = (1, 2)area 5
The unit square (dashed) goes to the parallelogram on (3, 1) and (1, 2): area 5 = det A.

det⁡(abcd)=ad−bc\det\begin{pmatrix}a&b\\c&d\end{pmatrix} = ad - bc. For a 3×33\times3, expand along a row: each entry times the 2×22\times2 determinant left when its row and column are deleted, with signs alternating +,−,++, -, +. Geometrically, ∣det⁡A∣|\det A| is the factor by which AA scales area (volume in 3D), and the sign says whether AA flips orientation.

Where ad−bcad - bc comes from: AA sends the unit square to the parallelogram spanned by its columns (a,c)(a, c) and (b,d)(b, d), and that parallelogram's signed area is ad−bcad - bc (the proof below cuts it out of a rectangle). For A=(3112)A = \begin{pmatrix}3&1\\1&2\end{pmatrix} the columns are (3,1)(3, 1) and (1,2)(1, 2) and det⁡A=6−1=5\det A = 6 - 1 = 5: the square of area 11 becomes a parallelogram of area 55. Since every region is filled by tiny squares, every area is multiplied by the same 55.

Tip
Invertible ⇔ nonzero determinant

A−1A^{-1} exists exactly when det⁡A≠0\det A \ne 0, and for 2×22\times2: A−1=1det⁡A(d−b−ca)A^{-1} = \tfrac{1}{\det A}\begin{pmatrix} d & -b \\ -c & a\end{pmatrix} — swap the diagonal, negate the off-diagonal, divide by the determinant. Also det⁡(AB)=det⁡A det⁡B\det(AB) = \det A\,\det B, so det⁡(An)=(det⁡A)n\det(A^n) = (\det A)^n.

The geometry explains the test. If det⁡A=0\det A = 0, the square is flattened onto a line (or a point), and different inputs land on the same output — no map can undo that, so there is no inverse. If det⁡A≠0\det A \ne 0, the columns span the plane and every b\mathbf b is hit exactly once. The product rule is the area story twice: applying BB scales areas by det⁡B\det B, then AA scales them by det⁡A\det A.

Example
Singular tuning
xy(2, 3)k = 6k = 8
At k = 8 the columns enclose area 4; at k = 6 the second column lies on the first line.

(243k)\begin{pmatrix}2&4\\3&k\end{pmatrix} fails to invert when 2k=122k = 12: at k=6k = 6 the rows become parallel and the matrix flattens the plane onto a line.

Watch it happen through the columns (2,3)(2, 3) and (4,k)(4, k). At k=8k = 8 the determinant is 16−12=416 - 12 = 4, and the columns span a thin parallelogram of area 44. As kk falls toward 66 the second column swings onto the line through (2,3)(2, 3), the parallelogram's area 2k−122k - 12 shrinks to 00, and at k=6k = 6 the second column is exactly twice the first.

Side note
Significance: one number, many jobs

Jacobians in calculus are determinants (area scaling); Cramer's rule solves small systems by determinants; the characteristic polynomial that finds eigenvalues is a determinant; and orientation (does a transformation flip space?) is its sign. It is the only scalar that summarizes an entire matrix's invertibility and volume behavior.

Try it
Try it: zero without computing

What is det⁡(123456579)\det\begin{pmatrix}1&2&3\\4&5&6\\5&7&9\end{pmatrix}? Look for structure before expanding.

Show the answer

Row 3 is row 1 plus row 2: (1+4, 2+5, 3+6)=(5,7,9)(1 + 4,\ 2 + 5,\ 3 + 6) = (5, 7, 9). So the replacement R3←R3−R1−R2R_3 \gets R_3 - R_1 - R_2, which never changes a determinant, produces a row of zeros, and a matrix with a zero row has determinant 00. The answer is 00. Geometrically, the three rows lie in one plane, so the box they span has no volume. Check by cofactors along row 1: 1(45−42)−2(36−30)+3(28−25)=3−12+9=01(45 - 42) - 2(36 - 30) + 3(28 - 25) = 3 - 12 + 9 = 0 ✓.

Row Operations and the Determinant

Tip
What each move does to det
u = (3, 0)v = (1, 2)v + u = (4, 2)
Adding u to v slides the top edge along y = 2: same base, same height, same area 6.
  • Swapping two rows multiplies det⁡\det by −1-1.
  • Multiplying one row by cc multiplies det⁡\det by cc.
  • Adding a multiple of one row to another leaves det⁡\det unchanged.

So reduce to triangular form, multiply the diagonal, and correct for swaps and scalings: det⁡A=(−1)#swaps×(product of pivots)\det A = (-1)^{\#\text{swaps}}\times(\text{product of pivots}) when only swaps and replacements were used.

The third rule is the important one, and it is a shear. Since det⁡A=det⁡AT\det A = \det A^{\mathsf T}, rows and columns obey the same rules, so picture columns: replacing v\mathbf v by v+u\mathbf v + \mathbf u slides the top of the parallelogram along a line parallel to u\mathbf u. Base and height are unchanged, so the area is too. Scaling one side by cc scales the area by cc, and a swap reverses the order of the two sides, which reverses orientation. A triangular matrix's determinant is the product of its diagonal because expanding down the first column meets only one nonzero entry at each stage.

Example
Worked: a determinant by elimination

Find det⁡(242134379)\det\begin{pmatrix}2&4&2\\1&3&4\\3&7&9\end{pmatrix}. Row 1 has a common factor 22; pull it out (this divides row 1 by 22, so the determinant carries a factor 22): det⁡=2det⁡(121134379)\det = 2\det\begin{pmatrix}1&2&1\\1&3&4\\3&7&9\end{pmatrix}.

Now replacements only, which change nothing: R2←R2−R1R_2 \gets R_2 - R_1 gives (0,1,3)(0, 1, 3) and R3←R3−3R1R_3 \gets R_3 - 3R_1 gives (0,1,6)(0, 1, 6); then R3←R3−R2R_3 \gets R_3 - R_2 gives (0,0,3)(0, 0, 3). The triangular matrix has diagonal 1,1,31, 1, 3, so

det⁡=2⋅(1⋅1⋅3)=6.\det = 2\cdot(1\cdot1\cdot3) = 6.

Check by cofactors along row 1: 2(27−28)−4(9−12)+2(7−9)=−2+12−4=62(27 - 28) - 4(9 - 12) + 2(7 - 9) = -2 + 12 - 4 = 6 ✓. Elimination took three row replacements; for an n×nn\times n matrix it needs about n33\tfrac{n^3}{3} operations, while cofactor expansion needs about n!n!.

Example
Worked: when a swap is needed

Find det⁡(0121034−38)\det\begin{pmatrix}0&1&2\\1&0&3\\4&-3&8\end{pmatrix}. The top-left entry is 00, so there is no pivot to eliminate with. Swap R1↔R2R_1 \leftrightarrow R_2, which flips the sign: det⁡=−det⁡(1030124−38)\det = -\det\begin{pmatrix}1&0&3\\0&1&2\\4&-3&8\end{pmatrix}.

Clear column 1: R3←R3−4R1R_3 \gets R_3 - 4R_1 gives (0,−3,−4)(0, -3, -4). Clear column 2: R3←R3+3R2R_3 \gets R_3 + 3R_2 gives (0,0,2)(0, 0, 2). The pivots are 1,1,21, 1, 2, with product 22, so det⁡=−2\det = -2. Check by cofactors along the first row of the original: 0⋅(…)−1(8−12)+2(−3−0)=4−6=−20\cdot(\ldots) - 1(8 - 12) + 2(-3 - 0) = 4 - 6 = -2 ✓.

Example
Worked: scaling the whole matrix

A 3×33\times3 matrix AA has det⁡A=−2\det A = -2. Find det⁡(3A)\det(3A), det⁡(A−1)\det(A^{-1}) and det⁡(ATA)\det(A^{\mathsf T}A). Multiplying the matrix by 33 multiplies each of its three rows by 33.

Each row scaling contributes a factor 33, so det⁡(3A)=33det⁡A=27⋅(−2)=−54\det(3A) = 3^3\det A = 27\cdot(-2) = -54. From AA−1=IAA^{-1} = I and the product rule, det⁡A⋅det⁡(A−1)=1\det A\cdot\det(A^{-1}) = 1, so det⁡(A−1)=−12\det(A^{-1}) = -\tfrac12. And det⁡(ATA)=det⁡ATdet⁡A=(−2)2=4\det(A^{\mathsf T}A) = \det A^{\mathsf T}\det A = (-2)^2 = 4 — always nonnegative, a fact that returns with least squares and singular values.

Side note
Where it goes wrong: det is not additive, and not linear in the matrix

det⁡(A+B)≠det⁡A+det⁡B\det(A + B) \ne \det A + \det B: with A=B=I2A = B = I_2, det⁡(2I)=4\det(2I) = 4 but det⁡I+det⁡I=2\det I + \det I = 2. The same example exposes the other slip, det⁡(2A)=2det⁡A\det(2A) = 2\det A: for an n×nn\times n matrix the correct factor is 2n2^n, because each of the nn rows is doubled. The determinant is linear in one row at a time, never in the whole matrix.

Try it
Try it: triangularize

Compute det⁡(123257137)\det\begin{pmatrix}1&2&3\\2&5&7\\1&3&7\end{pmatrix} by elimination, and check by cofactors.

Show the answer

Replacements only: R2←R2−2R1R_2 \gets R_2 - 2R_1 gives (0,1,1)(0, 1, 1); R3←R3−R1R_3 \gets R_3 - R_1 gives (0,1,4)(0, 1, 4); then R3←R3−R2R_3 \gets R_3 - R_2 gives (0,0,3)(0, 0, 3). No swaps or scalings were used, so the determinant is the product of the pivots: 1⋅1⋅3=31\cdot1\cdot3 = 3. Cofactors along row 1: 1(35−21)−2(14−7)+3(6−5)=14−14+3=31(35 - 21) - 2(14 - 7) + 3(6 - 5) = 14 - 14 + 3 = 3 ✓.

Cramer's Rule and Area Formulas

Tip
Solving by ratios of determinants

If det⁡A≠0\det A \ne 0, the solution of Ax=bA\mathbf x = \mathbf b is

xi=det⁡Aidet⁡A,x_i = \frac{\det A_i}{\det A},

where AiA_i is AA with column ii replaced by b\mathbf b. The same area idea gives coordinate formulas: the triangle with vertices P,Q,RP, Q, R has area 12∣det⁡(Q−PR−P)∣\tfrac12\left|\det\begin{pmatrix}Q - P & R - P\end{pmatrix}\right|, the two edge vectors from PP used as columns.

Why Cramer's rule holds, in the plane: b=x1a1+x2a2\mathbf b = x_1\mathbf a_1 + x_2\mathbf a_2, so the parallelogram on b\mathbf b and a2\mathbf a_2 is the one on x1a1x_1\mathbf a_1 and a2\mathbf a_2 sheared along a2\mathbf a_2 — same area. Hence det⁡(b,a2)=x1det⁡(a1,a2)\det(\mathbf b, \mathbf a_2) = x_1\det(\mathbf a_1, \mathbf a_2), which is det⁡A1=x1det⁡A\det A_1 = x_1\det A. The rule is elegant and good for one unknown or for proofs; for solving whole systems, elimination is far cheaper.

Example
Worked: Cramer's rule on a 2×2 system
2a₁a₂b
Shaded: 2a₁ and a₂. Dashed: b and a₂. A shear along a₂ turns one into the other, so both have area 10.

Solve 2x+y=72x + y = 7, x+3y=11x + 3y = 11. First the denominator: det⁡A=det⁡(2113)=6−1=5\det A = \det\begin{pmatrix}2&1\\1&3\end{pmatrix} = 6 - 1 = 5. Replace column 1 by b=(7,11)\mathbf b = (7, 11): det⁡A1=det⁡(71113)=21−11=10\det A_1 = \det\begin{pmatrix}7&1\\11&3\end{pmatrix} = 21 - 11 = 10.

So x=105=2x = \tfrac{10}{5} = 2. Replace column 2 instead: det⁡A2=det⁡(27111)=22−7=15\det A_2 = \det\begin{pmatrix}2&7\\1&11\end{pmatrix} = 22 - 7 = 15, so y=155=3y = \tfrac{15}{5} = 3. Check: 4+3=74 + 3 = 7 and 2+9=112 + 9 = 11 ✓. In the figure, the parallelogram on b\mathbf b and a2\mathbf a_2 (dashed) has area 1010, exactly twice the area 55 of the one on a1\mathbf a_1 and a2\mathbf a_2 — that factor 22 is xx.

Example
Worked: one unknown of a 3×3 system

Find only zz in x+y+z=6x + y + z = 6, 2y+5z=−42y + 5z = -4, 2x+5y−z=272x + 5y - z = 27. The denominator, by cofactors along row 1: det⁡A=det⁡(11102525−1)=1(−2−25)−1(0−10)+1(0−4)=−21\det A = \det\begin{pmatrix}1&1&1\\0&2&5\\2&5&-1\end{pmatrix} = 1(-2 - 25) - 1(0 - 10) + 1(0 - 4) = -21.

Replace column 3 by b=(6,−4,27)\mathbf b = (6, -4, 27): det⁡A3=det⁡(11602−42527)=1(54+20)−1(0+8)+6(0−4)=74−8−24=42\det A_3 = \det\begin{pmatrix}1&1&6\\0&2&-4\\2&5&27\end{pmatrix} = 1(54 + 20) - 1(0 + 8) + 6(0 - 4) = 74 - 8 - 24 = 42. So z=42−21=−2z = \tfrac{42}{-21} = -2. This is where Cramer's rule earns its keep: one unknown from two determinants, without solving for the others. (The full solution is (5,3,−2)(5, 3, -2); check the second equation: 6−10=−46 - 10 = -4 ✓.)

Example
Worked: the area of a triangle from its vertices
xy(1, 1)(4, 2)(2, 5)
The triangle is half the parallelogram on (3, 1) and (1, 4).

Find the area of the triangle with vertices P=(1,1)P = (1, 1), Q=(4,2)Q = (4, 2), R=(2,5)R = (2, 5). Edge vectors from PP: Q−P=(3,1)Q - P = (3, 1) and R−P=(1,4)R - P = (1, 4).

They span a parallelogram of area ∣det⁡(3114)∣=∣12−1∣=11\left|\det\begin{pmatrix}3&1\\1&4\end{pmatrix}\right| = |12 - 1| = 11, and the triangle is half of it: area 112\tfrac{11}{2}. The determinant is positive, which says the order P→Q→RP \to Q \to R runs counterclockwise; listing the vertices the other way round would give −11-11. The formula needs no heights, no angles, and no square roots.

Side note
Where it goes wrong: Cramer's rule when det A = 0

For x+y=2x + y = 2, 2x+2y=42x + 2y = 4, all three determinants vanish: det⁡A=2−2=0\det A = 2 - 2 = 0 and det⁡A1=2⋅2−1⋅4=0\det A_1 = 2\cdot2 - 1\cdot4 = 0. Writing x=00x = \tfrac00 and concluding "xx can be anything, so yy can too" is wrong — x=0x = 0, y=5y = 5 fails the first equation. With det⁡A=0\det A = 0 Cramer's rule says nothing at all; elimination shows the solutions are the line x+y=2x + y = 2. Change the second equation to 2x+2y=52x + 2y = 5 and det⁡A1=2⋅2−1⋅5=−1≠0\det A_1 = 2\cdot2 - 1\cdot5 = -1 \ne 0, yet there is no solution. Only elimination tells these cases apart.

Try it
Try it: Cramer's rule

Solve 5x−2y=45x - 2y = 4, 3x+y=93x + y = 9 by Cramer's rule, and check.

Show the answer

Denominator: det⁡A=5⋅1−(−2)⋅3=11\det A = 5\cdot1 - (-2)\cdot3 = 11. Column 1 replaced by (4,9)(4, 9): det⁡A1=4⋅1−(−2)⋅9=22\det A_1 = 4\cdot1 - (-2)\cdot9 = 22, so x=2211=2x = \tfrac{22}{11} = 2. Column 2 replaced: det⁡A2=5⋅9−4⋅3=33\det A_2 = 5\cdot9 - 4\cdot3 = 33, so y=3311=3y = \tfrac{33}{11} = 3. Check: 10−6=410 - 6 = 4 and 6+3=96 + 3 = 9 ✓.

Proofs & Why It Matters

Tip
Proof: ad − bc is the area factor
(5, 4)(1, 3)(4, 1)11
The parallelogram is the 5 × 4 rectangle minus four triangles and two 1 × 1 squares.

The matrix sends the unit square (spanned by e1,e2\mathbf e_1, \mathbf e_2) to the parallelogram spanned by the columns (a,c)(a, c) and (b,d)(b, d).

Embed in 3D and take the cross product: (a,c,0)×(b,d,0)=(0,0,ad−bc)(a, c, 0)\times(b, d, 0) = (0, 0, ad - bc), so the parallelogram's area is ∣ad−bc∣|ad - bc| — the factor by which every area scales, since any region is a limit of little squares. The sign records whether orientation flips. ■\blacksquare A cut-and-paste proof avoids the cross product. With columns (a,c)=(4,1)(a, c) = (4, 1) and (b,d)=(1,3)(b, d) = (1, 3), the parallelogram sits in a 5×45\times4 rectangle of area (a+b)(c+d)=20(a + b)(c + d) = 20. Around it are two triangles of area 12ac=2\tfrac12ac = 2, two of area 12bd=32\tfrac12bd = \tfrac32, and two b×cb\times c rectangles of area 11. What is left is 20−4−3−2=11=4⋅3−1⋅120 - 4 - 3 - 2 = 11 = 4\cdot3 - 1\cdot1. In general (a+b)(c+d)−ac−bd−2bc=ad−bc(a + b)(c + d) - ac - bd - 2bc = ad - bc.

Tip
Proof: the 2×2 inverse formula

Multiply directly: (abcd)(d−b−ca)=(ad−bc00ad−bc)=(det⁡A) I\begin{pmatrix}a&b\\c&d\end{pmatrix}\begin{pmatrix}d&-b\\-c&a\end{pmatrix} = \begin{pmatrix}ad-bc & 0\\ 0 & ad-bc\end{pmatrix} = (\det A)\,I.

When det⁡A≠0\det A \ne 0, dividing by it gives A−1A^{-1}; when det⁡A=0\det A = 0 the product is the zero matrix, so no inverse can exist (an invertible product would force det⁡A⋅det⁡A−1=1\det A \cdot \det A^{-1} = 1). ■\blacksquare

Tip
Proof: det(AB) = det A · det B (2×2, by areas)

The map x↦ABx\mathbf x \mapsto AB\mathbf x first scales areas by det⁡B\det B (applying BB), then by det⁡A\det A (applying AA) — so the composite scales areas by the product. Since the determinant is the (signed) area factor, det⁡(AB)=det⁡A det⁡B\det(AB) = \det A\,\det B. Setting B=An−1B = A^{n-1} repeatedly gives det⁡(An)=(det⁡A)n\det(A^n) = (\det A)^n. ■\blacksquare

Going Deeper: Explanations & Worked Problems

Concept
Three faces of one number
xAe₁ = (1, 2)Ae₂ = (2, 1)
det [[1, 2], [2, 1]] = −3: area triples, and Ae₁ now sits counterclockwise of Ae₂ — a flip.

The determinant answers three seemingly different questions with one number. Algebra: Ax=bA\mathbf x = \mathbf b has a unique solution iff det⁡A≠0\det A \ne 0 — the determinant is the product of the pivots (up to sign from row swaps), so "no zero pivot" and "nonzero determinant" are the same statement.

Geometry: ∣det⁡A∣|\det A| is the factor by which AA scales all areas (volumes in 3D), and its sign records orientation — negative means the plane got flipped. Computation: expand along any row or column (each entry times its minor, alternating signs +,−,+,…+,-,+,\ldots in a checkerboard), or better, row reduce and multiply pivots — for large matrices, elimination is exponentially faster than cofactors. Useful consequences worth having at your fingertips: a matrix with two equal rows has determinant 00 (swap them: the sign flips yet nothing changed); triangular matrices have determinant == product of the diagonal; and det⁡(AT)=det⁡A\det(A^{\mathsf T}) = \det A.

Example
Worked: a 3×3 determinant by cofactors, then again by elimination

Let M=(213041120)M = \begin{pmatrix}2&1&3\\0&4&1\\1&2&0\end{pmatrix}. Cofactors along row 1: det⁡M=2det⁡(4120)−1det⁡(0110)+3det⁡(0412)\det M = 2\det\begin{pmatrix}4&1\\2&0\end{pmatrix} - 1\det\begin{pmatrix}0&1\\1&0\end{pmatrix} + 3\det\begin{pmatrix}0&4\\1&2\end{pmatrix}. Evaluate each 2×22\times2: (0−2)=−2(0 - 2) = -2; (0−1)=−1(0 - 1) = -1; (0−4)=−4(0 - 4) = -4.

Assemble with the +,−,++, -, + signs: 2(−2)−1(−1)+3(−4)=−4+1−12=−152(-2) - 1(-1) + 3(-4) = -4 + 1 - 12 = -15. Now by elimination: swap R1↔R3R_1 \leftrightarrow R_3 to get the pivot 11 on top (the swap flips the sign), then R3←R3−2R1R_3 \gets R_3 - 2R_1 gives (0,−3,3)(0, -3, 3), and R3←R3+34R2R_3 \gets R_3 + \tfrac34R_2 gives (0,0,154)(0, 0, \tfrac{15}{4}). The pivots are 1,4,1541, 4, \tfrac{15}{4} with product 1515, and the one swap makes it −15-15 ✓. Same number, two engines — cofactors for small or sparse matrices, elimination for everything else.

Example
Worked: using the inverse formula end to end

Solve (3152)x=(712)\begin{pmatrix}3&1\\5&2\end{pmatrix}\mathbf x = \begin{pmatrix}7\\12\end{pmatrix} by the inverse.

Step 1 — determinant: 3⋅2−1⋅5=13\cdot2 - 1\cdot5 = 1.

Step 2 — the 2×22\times2 inverse recipe (swap diagonal, negate off-diagonal, divide): A−1=11(2−1−53)A^{-1} = \tfrac11\begin{pmatrix}2&-1\\-5&3\end{pmatrix}.

Step 3 — multiply: x=(2−1−53)(712)=(14−12−35+36)=(21)\mathbf x = \begin{pmatrix}2&-1\\-5&3\end{pmatrix}\begin{pmatrix}7\\12\end{pmatrix} = \begin{pmatrix}14 - 12\\-35 + 36\end{pmatrix} = \begin{pmatrix}2\\1\end{pmatrix}.

Step 4 — check in the original system: 3⋅2+1=73\cdot2 + 1 = 7 ✓, 5⋅2+2=125\cdot2 + 2 = 12 ✓. Because det⁡=1\det = 1, this matrix even preserves areas exactly — an example of the geometry and the algebra agreeing to the digit.