TITLE: Why, historically, do we multiply matrices as we do?
QUESTION [115 upvotes]: Multiplication of matrices — taking the dot product of the $i$th row of the first matrix and the $j$th column of the second to yield the $ij$th entry of the product — is not a very intuitive operation: if you were to ask someone how to mutliply two matrices, he probably would not think of that method. Of course, it turns out to be very useful: matrix multiplication is precisely the operation that represents composition of transformations. But it's not intuitive. So my question is where it came from. Who thought of multiplying matrices in that way, and why? (Was it perhaps multiplication of a matrix and a vector first? If so, who thought of multiplying them in that way, and why?) My question is intact no matter whether matrix multiplication was done this way only after it was used as representation of composition of transformations, or whether, on the contrary, matrix multiplication came first. (Again, I'm not asking about the utility of multiplying matrices as we do: this is clear to me. I'm asking a question about history.)

REPLY [39 votes]: Here is an answer directly reflecting the historical perspective from the paper Memoir on the theory of matrices By Authur Cayley, 1857. This paper is available here.
This paper is credited with "containing the first abstract definition of a matrix" and "a matrix algebra defining addition, multiplication, scalar multiplication and inverses" (source).
In this paper a nonstandard notation is used. I will do my best to place it in a more "modern" (but still nonstandard) notation. The bulk of the contents of this post will come from pages 20-21.
To introduce notation, $$ (X,Y,Z)= \left( \begin{array}{ccc}
a & b & c \\
a' & b' & c' \\
a'' & b'' & c'' \end{array} \right)(x,y,z)$$
will represent the set of linear functions $(ax + by + cz, a'z + b'y + c'z, a''z + b''y + c''z)$ which are then called $(X,Y,Z)$.
Cayley defines addition and scalar multiplication and then moves to matrix multiplication or "composition". He specifically wants to deal with the issue of:
$$(X,Y,Z)= \left( \begin{array}{ccc}
a & b & c \\
a' & b' & c' \\
a'' & b'' & c'' \end{array} \right)(x,y,z) \quad \text{where} \quad (x,y,z)= \left( \begin{array}{ccc}
\alpha & \beta & \gamma \\
\alpha' & \beta' & \gamma' \\
\alpha'' & \beta'' & \gamma'' \\ \end{array} \right)(\xi,\eta,\zeta)$$
He now wants to represent $(X,Y,Z)$ in terms of $(\xi,\eta,\zeta)$. He does this by creating another matrix that satisfies the equation:
$$(X,Y,Z)= \left( \begin{array}{ccc}
A & B & C \\
A' & B' & C' \\
A'' & B'' & C'' \\ \end{array} \right)(\xi,\eta,\zeta)$$
He continues to write that the value we obtain is:
$$\begin{align}\left( \begin{array}{ccc}
A & B & C \\
A' & B' & C' \\
A'' & B'' & C'' \\ \end{array} \right) &= \left( \begin{array}{ccc}
a & b & c \\
a' & b' & c' \\
a'' & b'' & c'' \end{array} \right)\left( \begin{array}{ccc}
\alpha & \beta & \gamma \\
\alpha' & \beta' & \gamma' \\
\alpha'' & \beta'' & \gamma'' \\ \end{array} \right)\\[.25cm] &= \left( \begin{array}{ccc}
a\alpha+b\alpha' + c\alpha'' & a\beta+b\beta' + c\beta'' & a\gamma+b\gamma' + c\gamma'' \\
a'\alpha+b'\alpha' + c'\alpha'' & a'\beta+b'\beta' + c'\beta'' & a'\gamma+b'\gamma' + c'\gamma'' \\
a''\alpha+b''\alpha' + c''\alpha'' & a''\beta+b''\beta' + c''\beta'' & a''\gamma+b''\gamma' + c''\gamma''\end{array} \right)\end{align}$$
This is the standard definition of matrix multiplication. I must believe that matrix multiplication was defined to deal with this specific problem. The paper continues to mention several properties of matrix multiplication such as non-commutativity, composition with unity and zero and exponentiation.
Here is the written rule of composition:

Any line of the compound matrix is obtained by combining the corresponding line of the first component matrix successively with the several columns of the second matrix (p. 21)