Hexa Scholar

Matrix multiplication is composition

Which single matrix represents two transformations of the plane applied in sequence?

Follow e₁ and e₂ through both transformations. Their final positions form the two columns of one matrix, and that matrix is the product of the two.

Before you start · 3 quick checks on matrices and functions, about 2 min
Setup: four moves, and one map after another

From the previous page: a 2×2 matrix \(A\) moves the plane, its columns are \(Ae_1\) and \(Ae_2\), the images of \(e_1 = (1, 0)\) and \(e_2 = (0, 1)\), and \(Ax = x_1(\text{column } 1) + x_2(\text{column } 2)\) for \(x = (x_1, x_2)\).

This page uses four basic moves. Each column is where the move sends \(e_1\) or \(e_2\).

  • \(R = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}\): rotate by 90° counterclockwise about the origin.
  • \(M = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\): mirror in the \(x_1\)-axis.
  • \(S = \begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix}\): stretch by 2 along the \(x_1\)-axis.
  • \(H = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}\): shear sideways, \((x_1, x_2) \mapsto (x_1 + x_2, x_2)\).

The identity \(I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\) leaves every point where it is.

If a point \(x\) is moved first by a matrix \(B\), to \(Bx\), and the result is then moved by \(A\), it ends at \(A(Bx)\). This two-step map is written \(x \mapsto A(Bx)\). As in \(f(g(x))\), the map applied first is the one next to \(x\).

How the pictures on this page are drawn

Each picture starts from the ordinary grid. The shaded region is the image of the unit square, the square with corners \(0\), \(e_1\), \(e_1 + e_2\) and \(e_2\), and the F drawn in it shows the square's orientation: a turned F and a mirrored F can be told apart.

The two colored arrows end where \(e_1\) and \(e_2\) land. Their end points are the columns of the matrix of the map that is drawn.

1 See

Does the order of two moves matter?

Answer with one click. The page then draws both orders and their matrices.

Four more pairs open after you answer.

2 Try

Build the goal from four moves

One question first, on how the page writes a sequence of moves. The builder opens when you have answered it.

The builder opens when you have answered the question above.

3 Prove

Why a product is computed row times column

Theorem

Let \(A\) and \(B\) be any two 2×2 matrices, and let \(T\) be the map \(x \mapsto A(Bx)\): first \(B\), then \(A\). Then \(T\) is linear, so it has a matrix; that matrix is called the product \(AB\). Column \(j\) of \(AB\) is \(A\) times column \(j\) of \(B\), and the entry in row \(i\) and column \(j\) is

\[ (AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j}, \]

row \(i\) of \(A\) dotted with column \(j\) of \(B\). Here \(a_{ik}\) is the entry of \(A\) in row \(i\) and column \(k\), and \(b_{kj}\) is the entry of \(B\) in row \(k\) and column \(j\).

Build the proof one line at a time. Each line has one correct choice.

Scratch work, not part of the proof.

Rules that follow

Associativity and the identity

Associativity. For 2×2 matrices \(A\), \(B\) and \(C\), \((AB)C = A(BC)\). By the theorem, used twice on each side,

\[ \begin{aligned} ((AB)C)x &= (AB)(Cx) \\ &= A(B(Cx)), \\ (A(BC))x &= A((BC)x) \\ &= A(B(Cx)). \end{aligned} \]

Both are the matrix of “first \(C\), then \(B\), then \(A\)”, and two matrices that give the same map have the same columns, so they are equal. A product of three matrices needs no brackets: \(ABC\). This holds because doing maps one after another is associative, whatever the maps.

The identity. \(Ix = x\) for every \(x\), so \(A(Ix) = Ax\) and \(I(Ax) = Ax\): \(AI = IA = A\) for every \(A\).

Key point Column \(j\) of \(AB\) is \(A\) times column \(j\) of \(B\), so entry \((i, j)\) is row \(i\) of \(A\) dotted with column \(j\) of \(B\). This rule comes from doing \(B\) first and \(A\) second, which is why the factor on the right acts first.
4 Apply

Problems

Each problem has hints and a full solution. Where the answer is a matrix \(\begin{pmatrix} a & b \\ c & d \end{pmatrix}\), type its entries row by row, a, b, c, d, separated by commas; the forms [[a, b], [c, d]] and a, b; c, d are read too. Answers are graded exactly: type whole numbers, exact decimals such as 0.5, or fractions such as 1/2.

Key point Write the map applied first on the right. Compute a product column by column, \(A\) times each column of \(B\), or entry by entry, row of \(A\) times column of \(B\), and check the order before you multiply.
Level Intro Prerequisites A matrix is a function that moves the plane Time ~30 min

Next in linear algebra: What the determinant measures (in preparation).

Further reading