Given matrices $A=\left(\begin{array}{cc}\hfill {A}_{11}\hfill & \hfill {A}_{12}\hfill \\ \hfill {A}_{21}\hfill & \hfill {A}_{22}\hfill \end{array}\right)$ , and $B=\left(\begin{array}{cc}\hfill {B}_{11}\hfill & \hfill {B}_{12}\hfill \\ \hfill {B}_{21}\hfill & \hfill {B}_{22}\hfill \end{array}\right)$ , we define the matrix product $$AB=\left(\begin{array}{cc}\hfill {A}_{11}{B}_{11}+{A}_{12}{B}_{21}\hfill & \hfill {A}_{11}{B}_{12}+{A}_{12}{B}_{22}\hfill \\ \hfill {A}_{21}{B}_{11}+{A}_{22}{B}_{21}\hfill & \hfill {A}_{21}{B}_{12}+{A}_{22}{B}_{22}\hfill \end{array}\right).$$

# 04. Matrix multiplication, 1

## 04. Matrix multiplication, 1

### Composing transformations

Recall that a 2-by-2 matrix defines for us a transformation of the plane. Suppose we are given two matrices $$A=\left(\begin{array}{cc}\hfill {A}_{11}\hfill & \hfill {A}_{12}\hfill \\ \hfill {A}_{21}\hfill & \hfill {A}_{22}\hfill \end{array}\right),B=\left(\begin{array}{cc}\hfill {B}_{11}\hfill & \hfill {B}_{12}\hfill \\ \hfill {B}_{21}\hfill & \hfill {B}_{22}\hfill \end{array}\right).$$
They each define a transformation of the plane. What happens if we *first* do the transformation associated to $B$
, and *then* do the transformation associated to $A$
?

We get a new transformation associated to a new matrix, which we call $AB$ . $$A(B(v))=\left(\begin{array}{cc}\hfill {A}_{11}\hfill & \hfill {A}_{12}\hfill \\ \hfill {A}_{21}\hfill & \hfill {A}_{22}\hfill \end{array}\right)\left(\begin{array}{cc}\hfill {B}_{11}\hfill & \hfill {B}_{12}\hfill \\ \hfill {B}_{21}\hfill & \hfill {B}_{22}\hfill \end{array}\right)\left(\begin{array}{c}\hfill x\hfill \\ \hfill y\hfill \end{array}\right)$$ $$=\left(\begin{array}{cc}\hfill {A}_{11}\hfill & \hfill {A}_{12}\hfill \\ \hfill {A}_{21}\hfill & \hfill {A}_{22}\hfill \end{array}\right)\left(\begin{array}{c}\hfill {B}_{11}x+{B}_{12}y\hfill \\ \hfill {B}_{21}x+{B}_{22}y\hfill \end{array}\right)$$ $$=\left(\begin{array}{c}\hfill {A}_{11}{B}_{11}x+{A}_{11}{B}_{12}y+{A}_{12}{B}_{21}x+{A}_{12}{B}_{22}y\hfill \\ \hfill {A}_{21}{B}_{11}x+{A}_{21}{B}_{12}y+{A}_{22}{B}_{21}x+{A}_{22}{B}_{22}y\hfill \end{array}\right)$$ $$=\left(\begin{array}{cc}\hfill {A}_{11}{B}_{11}+{A}_{12}{B}_{21}\hfill & \hfill {A}_{11}{B}_{12}+{A}_{12}{B}_{22}\hfill \\ \hfill {A}_{21}{B}_{11}+{A}_{22}{B}_{21}\hfill & \hfill {A}_{21}{B}_{12}+{A}_{22}{B}_{22}\hfill \end{array}\right)\left(\begin{array}{c}\hfill x\hfill \\ \hfill y\hfill \end{array}\right)$$ $$=:(AB)v$$

### Mnemonic

How on earth can we remember this formula? Here is a mnemonic. Just like when we act on a vector using a matrix, we can think of the entries of $AB$ as "multiplying a row of $A$ into a column of $B$ ". More specifically, to get the $ij$ th entry of $AB$ (i.e. $i$ th row and $j$ th column) we multiply the $i$ th row of $A$ into the $j$ th column of $B$ :