📚 Linear Algebra, Interactive 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 S moves the plane and then R 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 stay lines, and combinations survive both steps.

Take a shear and a quarter turn:

S = ( 1 1 0 1 ) , R = ( 0 1 1 0 )

S slides each point sideways in proportion to its height; R 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 S, then R", push 𝐞1 and 𝐞2 through both steps and collect the results as columns.

Start with 𝐞1=(1,0). The shear leaves it alone, since S's first column is (1,0). The turn then sends (1,0) to (0,1). So the first column of the composite is (0,1). Now 𝐞2=(0,1). The shear sends it to S's second column, (1,1). The turn sends (1,1) to (1,1), because R maps (x,y) to (y,x). So the second column is (1,1), and

R S = ( 0 1 1 1 )

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𝐱). It reads backwards, and it is worth reading it deliberately every time.

Three flat quadrilaterals lying almost on top of one another in a single vertical plane, seen face-on: a faint gray unit square, and two colored parallelograms that are the same square after the same two transformations applied in the two possible orders. A red arrow marks where one order sends the square's first edge and a blue arrow marks where the other order sends it, and the two arrows point in visibly different directions. 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)
The unit square in faint gray, with its image under both compositions drawn over it: shear-then-turn in warm colors, turn-then-shear in cool ones. The red arrow is where shear-then-turn sends 𝐞1, the blue arrow is where turn-then-shear sends it. The slider s sets how far the shear leans and a 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 two arrows. Shear-then-turn sends 𝐞1 to (0,1), straight up, because the shear does not move 𝐞1 at all and the turn then stands it upright. Turn-then-shear sends 𝐞1 first to (0,1) and then leans it to (1,1). The arrows disagree because the shear meets a different vector each time.
  3. Drag s down to 0. The shear becomes the identity, and the two parallelograms snap together — with one factor doing nothing, order cannot matter. Drag s back up and watch them separate again.
  4. Now drag a to 0 with s back at 1. 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 BA, apply B to each column of A 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 SR — turn first, then shear — push 𝐞1 through: the turn sends it to (0,1), and the shear sends (0,1) to (1,1). Then 𝐞2: the turn sends it to (1,0), and the shear leaves it at (1,0), since a point at height 0 slides by nothing. So

S R = ( 1 1 1 0 ) ( 0 1 1 1 ) = R S

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.

1
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 RS, computed symbolically: exactly 1. A shear preserves area and so does a rotation, so their composition must too — and the number confirms it.

1
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 SR is also 1, even though SR and RS are different matrices. This is the rule det(BA)=detB·detA at work: both orders multiply the same two factors, detR=1 and detS=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,1 can multiply to a matrix with eigenvalues (3±5)/2.

An original work of XYZ Homework, built around interactive XYZ 3D figures. Its chapter sequence is aligned to Interactive Linear Algebra (Margalit & Rabinoff, Georgia Tech, GNU FDL); this work is original, copies nothing from it, and is not affiliated with or endorsed by its authors. License: CC-BY-NC-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.