Matrices & Transformations · Lesson 2 of 3 · ~6 min

Composition is multiplication

Predict

The instrument can rotate the lattice by $30^\circ$ (matrix $A$) and shear it sideways (matrix $B$). You run rotate-then-shear; a friend runs shear-then-rotate. Do the two lattices end up in the same place?

Hold that thought. Press Apply A · Rot 30° then Apply B · Shear, press Reset, and run the pair the other way.
Try
Try itPress Apply A · Rot 30°, then Apply B · Shear, and read product M in the stats bar. Press Reset and apply the same two motions in the opposite order — watch where the lattice lands and where the entry $1.17$ moves.
Notice

Rotate-then-shear leaves the label reading M = B·A, with product M showing $1.17$, $0.02$ over $0.50$, $0.87$. After Reset, shear-then-rotate reads M = A·B: the lattice leans differently, and the $1.17$ has moved to the bottom-right corner. Two orders, two matrices, two destinations. One number refuses to change — det M reads $1.00$ after every press.

Explain

Chaining two linear motions gives a linear motion, so A-then-B must be some single matrix. That matrix is the product $BA$ — written right to left, because in $BA\,\mathbf{x}$ the matrix nearest $\mathbf{x}$ acts first, exactly like $f(g(x))$, where the inner $g$ runs first. Each new motion joins the product on the left, which is why the label wrote B·A when you pressed A first:

$$(BA)\,\mathbf{x} = B(A\mathbf{x})$$

Order matters because each motion acts on the result of the one before — shearing a rotated lattice is a different job from rotating a sheared one. So in general $AB \neq BA$: multiplication is composition, and composition does not commute. Determinants still multiply in any order, $\det(BA) = \det B \cdot \det A$, and both of these motions have determinant $1$, so every stack of them does too.

Apply
Checkpoint — prove it to yourself

You press Apply A · Rot 30° first, then Apply B · Shear. Which single matrix now moves the lattice in one step?

You stack rotations and shears in any order, ten presses in a row. What does det M read at the end?

Transfer: $R_{30}$ turns the plane $30^\circ$ and $R_{60}$ turns it $60^\circ$, and $R_{30} R_{60} = R_{60} R_{30}$ exactly. Does that contradict what you just saw?

Key idea

Matrix multiplication is function composition. $BA$ means $A$ first, then $B$ — read products right to left, expect $AB \neq BA$, and trust what survives any order: associativity and $\det(BA) = \det B \cdot \det A$.

← Lesson 1