Linear Algebra, Live
Strang §2.4 · Rules for matrix operations

AB means: apply B first, then A.

Multiplying matrices chains two moves into one. (AB)v = A(Bv): B moves the plane first, then A moves the result.

AB = A b₁b₂ = Ab₁Ab₂

Think: socks and shoes

Socks first, then shoes. Swap the order and you get a very different result. Matrix moves work the same way.

Read a product from right to left, like f(g(x)) in maths. In AB, B acts first.

Column by column

Where does (1, 0) end up after both moves? B sends it to b₁, the first column of B. Then A sends that to Ab₁. So the first column of AB is A times the first column of B. Same for the second column.

You already know matrix times vector. Matrix times matrix is just that, once per column.

Worked example

R turns by 90°. S is a shear.
R = 0-110   S = 1101
RS = 0-111   SR = 1-110
RS shears, then turns. SR turns, then shears. Different matrices, different moves. Look where the F ends up.

The rules

  • AB is usually not BA. Order matters.
  • (AB)C = A(BC). Either way, C acts first, then B, then A. Brackets only change how you write it.
  • det(AB) = det(A)·det(B). If B doubles areas and A triples them, together they multiply areas by 6 (chapter 5).

Where you meet this

A robot arm is a chain of rotations, one per joint. To find the gripper, multiply them in joint order. Swap two and the gripper ends up somewhere else.

Worked examples

Example 1 · Two orders

A = 1201 (shear), B = 2001 (stretch).

AB = 2201    BA = 2401

Stretch then shear differs from shear then stretch.

Example 2 · Two quarter turns

R = 0−110 turns by 90°.

RR = −100−1

Two quarter turns make a half turn. For rotations, multiplying adds the angles.

Problems

Try each one before you open the solution.

1

Compute AB and BA for A = 1110 and B = 0110.

Show solutionHide solution

AB = 1101 and BA = 1011. Different.

2

A = 2003, B = 1401. Find det(AB) without multiplying.

Show solutionHide solution

det A = 6 and det B = 1, so det(AB) = 6. Check: AB = 2803, det = 6 ✓

3

Find only the first column of AB for A = 1234 and B = 1011.

Show solutionHide solution

Column 1 of AB = A times column 1 of B = A·(1, 1) = (1 + 2, 3 + 4) = (3, 7).

Exercise Run it, then show S @ R instead and compare the F. Edit the code and press Run.
slide_6.py Loading Python…
1
Output · Ctrl+Enter runs
Press Run to execute this slide's code. Ctrl+Enter works too.
✎Lesson review
3 more worked examples and 5 mixed problems with solutions
→