Linear Algebra, Live
Strang §2.5 · Inverse of a product

Inverse of a product: undo the steps in reverse order

Slides 1 and 2 undid one matrix. Now two matrices act one after the other. In the morning you put on socks, then shoes. In the evening you take off the shoes first, then the socks: the same steps, in the opposite order. Matrices work the same way. The product AB means "do B first, then A", because B sits next to the vector. To undo it, first undo A, the last step, and then undo B. So the inverse of a product is (AB)⁻¹ = B⁻¹A⁻¹, with the order reversed. Get the order wrong and you do not get back to the start.

Lesson 3 · slide 3Inverse of AB
(AB)⁻¹ = B⁻¹A⁻¹     (ABC)⁻¹ = C⁻¹B⁻¹A⁻¹
Key ideas
  1. ABx means: B acts on x first, then A acts on the result.
  2. (AB)⁻¹ = B⁻¹A⁻¹. The order reverses: the last step done is the first undone.
  3. For three matrices: (ABC)⁻¹ = C⁻¹B⁻¹A⁻¹.
  4. The check: B⁻¹A⁻¹AB = B⁻¹IB = B⁻¹B = I.

Socks and shoes with row steps

Take two row steps, like those in lesson 2. Each one is a matrix acting on the left, like lesson 2's elimination matrices. Step E: row 2 − 3·row 1. Step F: row 1 + 2·row 2. Do E first, then F, on the matrix 1235. Then undo them: first undo F (row 1 − 2·row 2), then undo E (row 2 + 3·row 1).

1235  → E →  120−1  → F →  100−1
100−1  → undo F →  120−1  → undo E →  1235 ✓ back to the start
E, then F. To go back, undo F first and E second. The last picture matches the first.

Now undo them in the wrong order, undo-E first:

100−1  → undo E →  103−1  → undo F →  −523−1 ✗
The same two undo steps in the wrong order. Undo-F must subtract 2 times the same row 2 that F added. Undo-E ran first and changed row 2, so undo-F subtracts the wrong row.

The same rule with matrices

Matrix products act right to left: the step nearest the matrix acts first, so E then F is written FE. The right undo was E⁻¹F⁻¹. In general, in ABx, B is next to x, so B acts first. A went on last, so A⁻¹ must act first. In B⁻¹A⁻¹ the factor on the right, A⁻¹, acts first, which is what we need. The algebra check:

(B⁻¹A⁻¹)(AB) = B⁻¹(A⁻¹A)B = B⁻¹ I B = B⁻¹B = I ✓

A meets A⁻¹ in the middle, and they cancel. Then B and B⁻¹ cancel. In the other order, A⁻¹B⁻¹AB, nothing meets its own inverse, and the result is usually not I.

A worked example: two simple steps

B = 1101 adds the second entry to the first (slide 1). A = 2001 doubles the first entry. Do B first, then A:

AB = 20011101 = 2201
B⁻¹A⁻¹ = 1−101½001 = ½−101
(B⁻¹A⁻¹)(AB) = ½·2 + (−1)·0½·2 + (−1)·101 = 1001 ✓
B⁻¹A⁻¹ times AB, in the right order. Every entry comes out as the identity.

The wrong order, A⁻¹B⁻¹, fails:

A⁻¹B⁻¹ = ½0011−101 = ½−½01
(A⁻¹B⁻¹)(AB) = ½·2½·2 − ½·101 = 1½01 ≠ I ✗
The wrong order. The top-right number comes out 0.5 instead of 0, so this product is not I.

Another example: R and S from slide 1

R = 0−110 sends pq to −qp (slide 1's examples). S = 1101 adds the second entry to the first (slide 1). Multiplying as in lesson 2, RS = 0−111.
R⁻¹ = 01−10   S⁻¹ = 1−101 (both from slide 1)
S⁻¹R⁻¹ = 11−10   but   R⁻¹S⁻¹ = 01−11
Check: (S⁻¹R⁻¹)(RS) = 1·0 + 1·11·(−1) + 1·1−1·0 + 0·1(−1)(−1) + 0·1 = 1001 ✓
Only S⁻¹R⁻¹ undoes RS. In the lab, follow v = 11 through S and R, then try both orders on the way back.

A bigger example: three 3 × 3 steps

Lesson 2 eliminated with three steps, E₃₂E₃₁E₂₁A = U. E₂₁ subtracts 2·row 1 from row 2, E₃₁ adds row 1 to row 3, and E₃₂ adds row 2 to row 3. To undo all three, reverse the order and undo each one:

(E₃₂E₃₁E₂₁)⁻¹ = E₂₁⁻¹ E₃₁⁻¹ E₃₂⁻¹
= 100210001 100010−101 1000100−11 = 100210−1−11 = L

That is lesson 2's L, the matrix in A = LU. Each undo flips the sign of its multiplier, and in this reversed order the multipliers drop into L without mixing (see lesson 2, slide 7). A computer chaining a thousand steps undoes them the same way: last step first.

Where this is used

A robot arm chains joint moves, one after another. To reverse them, undo the last joint first.

Next: The 2 by 2 recipe does not work for bigger matrices. Slide 4 finds any inverse with elimination, by working on A and I side by side.

Examples

Example 1 · Two steps, undone

A = 2001, B = 1101.

Show solutionHide solution
(AB)⁻¹ = B⁻¹A⁻¹ = 1−101½001 = ½−101
Check: AB = 2201, whose inverse is ½·1−202 ✓

Example 2 · Powers

If A is invertible, so is A²:

Show solutionHide solution
(A²)⁻¹ = (AA)⁻¹ = A⁻¹A⁻¹ = (A⁻¹)²
(A⁻¹)⁻¹ = A: undoing the undo gets you back

Example 3 · Three steps

For three invertible matrices:

Show solutionHide solution
(ABC)⁻¹ = C⁻¹B⁻¹A⁻¹

C acted first, so it is undone last.

Example 4

A = 1021, B = 1301. Find (AB)⁻¹.

Show solutionHide solution

B⁻¹A⁻¹ = 1−30110−21 = 7−3−21. Check: AB = 1327 has det 1 and that inverse ✓

Example 5

True or false: (A + B)⁻¹ = A⁻¹ + B⁻¹.

Show solutionHide solution

False. Take A = B = I: (2I)⁻¹ = ½I, but A⁻¹ + B⁻¹ = 2I.

Exercise Fix the order in undo so that the last arrow comes back to v. Edit the code and press Run.
slide_3.py Loading Python…
1
Output · Ctrl+Enter runs
Press Run to execute this slide's code. Ctrl+Enter works too.

Enjoying lesson 3? Get the full course: all 8 lessons through the SVD and PCA, your progress saved lesson by lesson, every solution and 5 extra problems per lesson. $20 once, yours for life.

Questions and comments

Stuck on something, or found a mistake? Ask here and I'll answer. You sign in with GitHub.

The full course

From Ax = b to PCA, by running it

Lessons 1 to 3 are free. Finish all eight and you will be able to:

You get: all 8 lessons with Python labs · every worked example and solution · 5 extra problems per lesson · your progress tracked · answers to your questions · every future update.

$20 once · lifetime access
Continue to checkout →

Already a member? Log in to the course