# Why, historically, do we multiply matrices as we do?

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.)

-
 As to the last, matrix multiplication definitely came first (centuries first), and I'm reasonably certain from a compact representation of systems of linear equations. Leibniz already had a determinant formula. As I have no historic sources for first use, this doesn't answer your question though. – gnometorule Jan 7 at 4:19 Matrices are linear operators and have meaning only when it acts on vectors. Given matrices $A$ and $B$, what would we want the operator/matrix $BA$ to mean? Ideally, we would want $BA$ to mean the following. For all vectors $x$, we want $(BA)x = B(Ax)$ Once we have this i.e. $(BA)x = B(Ax)$ for all $x$, then we are forced to live with the way we currently multiply matrices. And as to why matrix-vector product is defined in the way it is, the primary reason for introducing matrices was to handle linear transformation in a notationally convenient way. – user17762 Jan 7 at 4:21 @HarryStern, explicitly, I thought. Anyway, yes, that's what I want. – msh210 Jan 7 at 4:44 I actually missed your explicit question in the middle of the body. Perhaps you should change that to the title. – Harry Stern Jan 7 at 4:46 There is another question, of course, which is not so much why matrix multiplication was defined like this, but why it stuck - why this apparently curious definition took off, and didn't die the death of so many putative definitions. And that was because it proved mathematically fruitful. – Mark Bennet Jan 7 at 8:47

Matrix multiplication is a symbolic way of substituting one linear change of variables into another one. If $x' = ax + by$ and $y' = cx+dy$, and $x'' = a'x' + b'y'$ and $y'' = c'x' + d'y'$ then we can plug the first pair of formulas into the second to express $x''$ and $y''$ in terms of $x$ and $y$: $$x'' = a'x' + b'y' = a'(ax + by) + b'(cx+dy) = (a'a + b'c)x + (a'b + b'd)y$$ and $$y'' = c'x' + d'y' = c'(ax+by) + d'(cx+dy) = (c'a+d'c)x + (c'b+d'd)y.$$ It can be tedious to keep writing the variables, so we use arrays to track the coefficients, with the formulas for $x'$ and $x''$ on the first row and for $y'$ and $y''$ on the second row. The above two linear substitutions coincide with the matrix product $$\left( \begin{array}{cc} a'&b'\\c'&d' \end{array} \right) \left( \begin{array}{cc} a&b\\c&d \end{array} \right) = \left( \begin{array}{cc} a'a+b'c&a'b+b'd\\c'a+d'c&c'b+d'd \end{array} \right).$$ So matrix multiplication is just a bookkeeping device for systems of linear substitutions plugged into one another (order matters). The formulas are not intuitive, but it's nothing other than the simple idea of combining two linear changes of variables in succession.

Matrix multiplication was first defined explicitly in print by Cayley in 1858, in order to reflect the effect of composition of linear transformations. See paragraph 3 at http://darkwing.uoregon.edu/~vitulli/441.sp04/LinAlgHistory.html. However, the idea of tracking what happens to coefficients when one linear change of variables is substituted into another (which we view as matrix multiplication) goes back further. For instance, the work of number theorists in the early 19th century on binary quadratic forms $ax^2 + bxy + cy^2$ was full of linear changes of variables plugged into each other (especially linear changes of variable that we would recognize as coming from ${\rm SL}_2({\mathbf Z})$). For more on the background, see the paper by Thomas Hawkins on matrix theory in the 1974 ICM. Google "ICM 1974 Thomas Hawkins" and you'll find his paper among the top 3 hits.

-
This is interesting, but does not really answer the question, which is mainly historical. – MJD Jan 7 at 4:33
Huh? The question is, historically, why do we multiply matrices the way we do. I answered that question: it is a shorthand for substituting one linear change of variables into another. – KCd Jan 7 at 4:36
Who thought of multiplying matrices in that way? When? How do you know that this was the first reason found for defining matrix multiplication in this way? – MJD Jan 7 at 4:38
What @MJD said. – msh210 Jan 7 at 4:45
@MJD: Cayley thought of multiplying matrices that way when he defined matrix multiplication. I won't say that it was the reason for defining matrix multiplication, but just that it was a way to think about the total process. If you read about the way linear algebra developed, you'll find that the subject came from several directions; adding one system of linear equations (with the same variables) led to addition of matrices and the algebraic calculations that arise when dealing with substitutions of linear changes of variables led to matrix multiplication. – KCd Jan 7 at 5:01
\begin{align} u & = 3x + 7y \\ v & = -2x + 11y \\ \\ \\ \\ p & =13u-20v \\ q & = 2u+6v \end{align} Given $x$ and $y$, how do you find $p$ and $q$? How do you wrote \begin{align} p & = \bullet x + \bullet y \\ q & = \bullet x+\bullet y\quad\text{?} \end{align} What numbers go where the four $\bullet$s are?