Linear Algebra, Interactive EditionXYZ Homework Edition

⇩ Download ▾

3.4 Composition Is Multiplication

Nothing so far forces a matrix product to mean anything. It becomes inevitable the moment you ask a natural question: if SS moves the plane and then RR moves it again, what single matrix describes the combined motion? There must be one, because doing two linear transformations in a row is still linear — the origin stays put, lines go to lines or collapse to points, and combinations survive both steps.

Take a shear and a quarter turn:

S = ( 1 1 0 1 ) , R = ( 0 − 1 1 0 ) S = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, \qquad R = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}

SS slides each point sideways in proportion to its height; RR rotates the plane a quarter turn counterclockwise. Finding the combined matrix needs only the reading of a matrix you already have from section 3.1: the columns are the images of the basis vectors. So to find the matrix of "do SS, then RR", push 𝐞1\mathbf{e}_1 and 𝐞2\mathbf{e}_2 through both steps and collect the results as columns.

Start with 𝐞1=(1,0)\mathbf{e}_1 = (1, 0). The shear leaves it alone, since SS's first column is (1,0)(1, 0). The turn then sends (1,0)(1, 0) to (0,1)(0, 1). So the first column of the composite is (0,1)(0, 1). Now 𝐞2=(0,1)\mathbf{e}_2 = (0, 1). The shear sends it to SS's second column, (1,1)(1, 1). The turn sends (1,1)(1, 1) to (−1,1)(-1, 1), because RR maps (x,y)(x, y) to (−y,x)(-y, x). So the second column is (−1,1)(-1, 1), and

R S = ( 0 − 1 1 1 ) RS = \begin{pmatrix} 0 & -1 \\ 1 & 1 \end{pmatrix}

Notice the order in the name. The matrix written on the right is the transformation applied first, because that is how the notation composes: R(S𝐱)R(S\mathbf{x}). It reads backwards, and it is worth reading it deliberately every time.

Seen face-on in one upright plane, against a gray horizontal axis and a gray vertical axis with numbered ticks: a light gray outline of the unit square, and two semi-transparent colored parallelograms, one outlined in pale orange and the other in pale blue, that are the same square after the same two transformations applied in the two possible orders. A red segment from the origin marks where one order sends the square's first edge and a blue segment marks where the other order sends it; at the starting setting the red one points straight up the vertical axis and the blue one points diagonally up and to the right. Two sliders set how far the shear leans and how far the turn rotates; at almost every setting the two colored parallelograms are different shapes, though they always have the same area.Explore in 3D (opens in a new tab)

Seen face-on in one upright plane, against a gray horizontal axis and a gray vertical axis with numbered ticks: a light gray outline of the unit square, and two semi-transparent colored parallelograms, one outlined in pale orange and the other in pale blue, that are the same square after the same two transformations applied in the two possible orders. A red segment from the origin marks where one order sends the square's first edge and a blue segment marks where the other order sends it; at the starting setting the red one points straight up the vertical axis and the blue one points diagonally up and to the right. Two sliders set how far the shear leans and how far the turn rotates; at almost every setting the two colored parallelograms are different shapes, though they always have the same area.

The unit square as a gray outline, and its images under both compositions, seen face-on: shear-then-turn in warm colors, turn-then-shear in cool ones. The red segment from the origin is where shear-then-turn sends 𝐞1\mathbf{e}_1, the blue segment is where turn-then-shear sends it. The slider ss sets how far the shear leans and aa sets the angle of the turn; the defaults are the full shear and a quarter turn.

Explore the figure

  1. At the defaults the two colored parallelograms are plainly different shapes. Same two transformations, same square, different order, different answer.
  2. Follow the red and blue segments. Shear-then-turn sends 𝐞1\mathbf{e}_1 to (0,1)(0, 1), straight up, because the shear does not move 𝐞1\mathbf{e}_1 at all and the turn then stands it upright. Turn-then-shear sends 𝐞1\mathbf{e}_1 first to (0,1)(0, 1) and then leans it to (1,1)(1, 1). The segments disagree because the shear meets a different vector each time.
  3. Drag ss down to 00. The shear becomes the identity, and the two parallelograms snap together — with one factor doing nothing, order cannot matter. Drag ss back up and watch them separate again.
  4. Now drag aa to 00 with ss back at 11. The turn becomes the identity and the shapes coincide again. A factor that does nothing cannot be disturbed by the other, so order stops mattering — but acting non-trivially is not by itself enough to make order matter, as the worked example below shows.

Reading the product off the columns

The column recipe generalizes into the multiplication rule. To compute BABA, apply BB to each column of AA in turn, and collect the results as the columns of the answer. Every entry rule you may have memorized is bookkeeping for that sentence.

Do the other order to see the disagreement in symbols. For SRSR — turn first, then shear — push 𝐞1\mathbf{e}_1 through: the turn sends it to (0,1)(0, 1), and the shear sends (0,1)(0, 1) to (1,1)(1, 1). Then 𝐞2\mathbf{e}_2: the turn sends it to (−1,0)(-1, 0), and the shear leaves it at (−1,0)(-1, 0), since a point at height 00 slides by nothing. So

S R = ( 1 − 1 1 0 ) ≠ ( 0 − 1 1 1 ) = R S SR = \begin{pmatrix} 1 & -1 \\ 1 & 0 \end{pmatrix} \ne \begin{pmatrix} 0 & -1 \\ 1 & 1 \end{pmatrix} = RS

Matrix multiplication is not commutative, and the geometry says why without any arithmetic: the shear's effect on a vector depends on how high that vector sits, so turning first hands the shear a different vector to work on. Two operations commute only when neither disturbs what the other is looking at.

One quantity does ignore the order.

11
Area after shear, then turn ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text Area after shear, then turn, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The determinant of RSRS, computed symbolically: exactly 11. A shear preserves area and so does a rotation, so their composition must too — and the number confirms it.

11
Area after turn, then shear ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text Area after turn, then shear, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The determinant of SRSR is also 11, even though SRSR and RSRS are different matrices. This is the rule det(BA)=detB·detA\det(BA) = \det B \cdot \det A at work: both orders multiply the same two factors, detR=1\det R = 1 and detS=1\det S = 1, and multiplication of numbers does commute. The two parallelograms in the figure differ in shape but never in area.

That last observation is a good habit in disguise. Products of matrices are awkward to compare directly, but a quantity that is genuinely multiplicative over products — the determinant — collapses the comparison to arithmetic you can do in your head. Be careful which quantities those are: eigenvalues are not multiplicative. Two shears with eigenvalues 1,11, 1 can multiply to a matrix with eigenvalues (3±5)/2(3 \pm \sqrt5)/2.

An original work of XYZ Homework, built around interactive XYZ 3D figures. Chapters 1–6 follow the topic sequence of Interactive Linear Algebra (Margalit & Rabinoff, Georgia Tech, GNU FDL). Chapter 0's scope (its topics, their order, and the idea each figure shows) follows the Vectors chapter of Ximera's Linear Algebra: An Interactive Introduction. The prose, worked examples and figures were written for this book, which is not affiliated with or endorsed by the authors of either work. License: CC-BY-NC-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or any other accessibility standard. Every page is built against an automated accessibility gate, and our target for the published editions is WCAG 2.2 Level AA. If something is unusable, please tell us.