Folioby Interconnected
Log InSign Up

Why matrix multiplication works that way: when linear maps become matrices

The definition of matrix multiplication looks arbitrary — until you realize it encodes composition of linear maps. We compute a concrete composition by hand and watch the "row-times-column" rule emerge naturally.

FO
Folio Official
March 1, 2026

Most students, on first encountering the definition of matrix multiplication, have the same reaction: why on earth is it defined this way?

Given A=(ac​bd​) and B=(eg​fh​), the product is

AB=(ae+bgce+dg​af+bhcf+dh​).

Multiplying entry-by-entry would be much simpler. But the "row-times-column" rule is not a convention chosen for aesthetic reasons. It is forced on us by the fact that matrices represent linear maps, and matrix multiplication represents composition.

1 Matrices as linear maps

A linear map T:R2→R3 is completely determined by what it does to a basis. If we know T(e1​) and T(e2​), we know everything.

Example 1.
Let T(e1​)=​120​​ and T(e2​)=​3−14​​. Then for any vector (xy​),
T(xy​)=xT(e1​)+yT(e2​)=​x+3y2x−y4y​​=​120​3−14​​(xy​).

The recipe is simple: place the images of the basis vectors as columns. The resulting matrix is the representation of T.

2 Composition forces the rule

Here is the crux. Take two linear maps and compose them — apply one after the other — and compute the representation matrix of the composition by hand.

Example 2.
Let T:R2→R3 have matrix A=​101​011​​ and S:R3→R2 have matrix B=(10​01​−1−1​). The composition S∘T:R2→R2 acts as follows.

On e1​:
S(T(e1​))=S​101​​=1(10​)+0(01​)+1(−1−1​)=(0−1​).

On e2​:
S(T(e2​))=S​011​​=0(10​)+1(01​)+1(−1−1​)=(−10​).

So the matrix of S∘T is (0−1​−10​).

Now look carefully at what happened. To get the (i,j) entry of the result, we took the dot product of the i-th row of B with the j-th column of A. That is precisely the definition of matrix multiplication:

BA=(10​01​−1−1​)​101​011​​=(0−1​−10​).

A perfect match.

3 Size constraints become obvious

An m×n matrix represents a map Rn→Rm, and a p×q matrix represents a map Rq→Rp. The composition A∘B makes sense only when the output of B can be fed into A — that is, when p=n. The result is a map Rq→Rm, hence an m×q matrix.

4 Associativity is just composition

The associative law (AB)C=A(BC) for matrices is a reflection of the associativity of function composition: (f∘g)∘h=f∘(g∘h). Applying three maps in succession, it does not matter which pair you compose first — the final result is the same. There is nothing to prove about matrices specifically; associativity is inherited from the nature of function composition itself.

5 WhyAB=BA

The non-commutativity of matrix multiplication is also transparent from the map perspective.

Example 3.
Let R=(01​−10​) (rotation by 90°) and S=(20​01​) (horizontal stretch by factor 2). Then
SR=(01​−20​),RS=(02​−10​).
Stretching and then rotating gives a different result from rotating and then stretching. The matrices are not commuting because the geometric operations are not commuting.

6 Change of basis: the same map in a different outfit

The same linear map can look very different depending on the choice of basis. If P is the change-of-basis matrix from basis B to basis B′, then the representation matrix transforms as

A′=P−1AP.

Remark 4.
Diagonalization is the search for a basis in which A becomes a diagonal matrix — a basis in which the map is nothing more than scaling along each axis. In other words, it is the search for the simplest possible description of a linear map.

7 The takeaway

The "row-times-column" rule for matrix multiplication is not an arbitrary convention. It is the unique rule that makes the product of two matrices equal the matrix of the composed maps. Size constraints, associativity, non-commutativity — they all follow from thinking of matrices not as tables of numbers but as proxies for linear maps.

Linear AlgebraAlgebraBetween the Lines
FO
Folio Official

Mathematics "between the lines" — exploring the intuition textbooks leave out, written in LaTeX on Folio.

1 followers·107 articles
Linear Algebra — Between the LinesPart 3 of 6
Previous
What is "dimension," really? The truth about degrees of freedom
Next
What does the determinant measure? Area, volume, and orientation

Share your expertise with the world

Write articles with LaTeX support, build your audience, and earn from your knowledge.

Start Writing — It's Free

More from Folio Official

Folio Official·March 1, 2026

What is "dimension," really? The truth about degrees of freedom

We all say "three-dimensional space" without blinking — but what exactly does the "three" mean? The answer is less obvious than it seems, and proving it requires the Steinitz exchange lemma.

Linear AlgebraAlgebraBetween the Lines
1
Folio Official·March 1, 2026

The geometry that inner products unlock: orthogonality, projection, and least squares

A vector space, by itself, has no concept of length or angle. Inner products supply both — and with them come orthogonal projections, the Gram–Schmidt process, least squares, and the bridge to Fourier analysis.

Linear AlgebraAlgebraBetween the Lines
Folio Official·March 1, 2026

Cosets and quotient groups: the art of controlled forgetting

The quotient group G/N is the first major conceptual hurdle in group theory. By computing small examples by hand -- from clock arithmetic to D4 modulo its center -- we build the intuition for what "dividing" a group really means, and why normality is indispensable.

Group TheoryAlgebraBetween the Lines
1
Folio Official·March 1, 2026

Matrices and Representation of Linear Maps

Every linear map between finite-dimensional spaces is uniquely represented by a matrix once bases are chosen, and composition of maps corresponds to matrix multiplication. We derive the change-of-basis formula, characterize invertible matrices, and show that matrix rank equals the rank of the corresponding linear map.

Linear AlgebraAlgebraTextbook