Introduction
When you first learn matrix multiplication, a question comes up.
"Why, when multiplying matrices, do we pull out the row of the first matrix and the column of the second and take their dot product? Couldn't we just multiply entry by entry?"
Here is the answer up front — a matrix is a transformation of space (translating, rotating, stretching), and matrix multiplication is what you get when you combine the result of applying two transformations in turn into a single transformation. The "row × column" computation rule is the inevitable shape needed to express this composition exactly.
A matrix is a transformation
Multiplying the 2×2 matrix
$$A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$$by the vector \(\mathbf{v} = (x, y)\) gives:
$$A\mathbf{v} = \begin{pmatrix} ax + by \\ cx + dy \end{pmatrix}$$This operation is a transformation that moves every point \((x, y)\) in the plane to a new position \((ax+by,\; cx+dy)\). For example:
| Matrix | What it does |
|---|---|
| \(\begin{pmatrix}2&0\\0&2\end{pmatrix}\) | Scale by 2 about the origin |
| \(\begin{pmatrix}0&-1\\1&0\end{pmatrix}\) | Rotate 90° counterclockwise |
| \(\begin{pmatrix}1&0\\0&-1\end{pmatrix}\) | Reflect across the x-axis |
The two columns of the matrix, \((a,c)\) and \((b,d)\), each show where the standard basis vectors \(\mathbf{e}_1=(1,0)\) and \(\mathbf{e}_2=(0,1)\) move to. Once you know the destinations of the two basis vectors, the destinations of all other points are determined — because the transformation is linear.
What if you apply two transformations in a row?
Now suppose you apply transformation A first, then apply transformation B to the result.
$$\mathbf{v} \xrightarrow{A} A\mathbf{v} \xrightarrow{B} B(A\mathbf{v})$$Rearranging the expression:
$$B(A\mathbf{v}) = (BA)\mathbf{v}$$Changing the order in which the parentheses are placed does not change the result (the associative law of matrix multiplication). In other words, "apply A, then apply B" is exactly the same as applying the composed matrix \(BA\) once.
Where do the entries of the composed matrix come from?
Let's directly compute the (row 1, column 1) entry of \(BA\). Applying \(B\) to the first column \((a_{11}, a_{21})\) of \(A\) gives the new first column.
$$B\begin{pmatrix}a_{11}\\a_{21}\end{pmatrix} = \begin{pmatrix}b_{11}a_{11}+b_{12}a_{21}\\ b_{21}a_{11}+b_{22}a_{21}\end{pmatrix}$$This is exactly the rule of taking the dot product of each row of \(B\) with each column of \(A\). It isn't a "strange" computation method; it's the result of compressing into one step the process where A moves the basis vectors and B then moves the result again.
Written as a general formula:
$$(BA)_{ij} = \sum_{k} b_{ik}\, a_{kj}$$Each of these sums computes "where B sends the destination that A gives to the \(j\)-th basis vector."
A concrete example — scale by 2, then rotate 90°
$$A = \begin{pmatrix}2&0\\0&2\end{pmatrix}, \quad B = \begin{pmatrix}0&-1\\1&0\end{pmatrix}$$Computing \(BA\):
$$BA = \begin{pmatrix}0\cdot2+(-1)\cdot0 & 0\cdot0+(-1)\cdot2 \\ 1\cdot2+0\cdot0 & 1\cdot0+0\cdot2\end{pmatrix} = \begin{pmatrix}0&-2\\2&0\end{pmatrix}$$Check: applying it to the point \((1, 0)\) gives \((0,2)\). That is, the unit vector in the x direction is stretched by 2 and rotated 90°, rising into the y direction.
- A first: \((1,0) \to (2, 0)\)
- B next: \((2,0) \to (0, 2)\)
- BA at once: \((1,0) \to (0, 2)\) ← the same
What if the order is reversed?
$$AB = \begin{pmatrix}0&-2\\2&0\end{pmatrix}$$In this case it happens that \(BA = AB\), but in general \(AB \neq BA\), as in the preset "reflect across the x-axis → rotate 45°" below. That is because the order of transformations changes the result — just as getting dressed and then showering differs from showering and then getting dressed.
Try it yourself
In the interactive below, selecting a preset shows the three stages side by side.
- Left (blue): the original unit square
- Middle (orange): after applying transformation A
- Right (purple): after applying transformation B as well → this is the same as applying the composed matrix BA once
If you alternately click "scale by 2 → rotate 90°" and "rotate 90° → scale by 2," BA comes out the same both ways — because scaling by 2 (2I) is a special case that can swap order with any transformation. By contrast, when rotation, reflection, and shear are mixed, as in "reflect across the x-axis → rotate 45°" or "stretch in the x direction → shear," the middle shape (with only A applied) and the right shape (with BA applied) differ noticeably — this is the general case of BA ≠ AB, where changing the order changes the result.
Key takeaways
| Question | Answer |
|---|---|
| What is a matrix? | A transformation of space — a function that moves vectors to new positions |
| Why row × column? | Combining transformation A followed by B makes that computation arise naturally |
| What does BA mean? | The composed transformation: apply A first, then B |
| Why is \(AB \neq BA\)? | Because the order of transformations changes the result |
| What do the column vectors mean? | Where the basis vectors \(\mathbf{e}_1, \mathbf{e}_2\) go after the transformation |
Studying this with AI
AI handles matrix computation itself quickly. It's worth asking why it computes the way it does.
Useful questions to ask:
- "What transformation do you get when you multiply a rotation matrix by a reflection matrix? Does it change if you swap the order?"
- "What is the condition for being able to multiply a 3×3 matrix by a 2×3 matrix? Why that condition?"
- "Explain why multiplying by the identity matrix I results in no transformation."
Wrapping up
The "row × column" rule of matrix multiplication is not arbitrary. Applying two transformations in turn automatically produces that computation. The moment you see a matrix not as an array of numbers but as a transformation of space, you understand all at once why the multiplication rule has that shape and why changing the order changes the result.
Related reading — Read first: Why Does Cramer's Rule Have That Form → Up next: Why Is the Determinant an "Area/Volume" (coming soon) · Compute it yourself: Wolfram Alpha · Desmos matrix calculator