# Matrix Multiplication

Definition: Given matrix $A$ of size $m \times r$ and matrix $B$ of size $r \times n$, their product denoted $AB$ is the $m \times n$ matrix whose $ij^{th}$ entries result from taking row $i$ in matrix $A$ and multiplying corresponding entries of column $j$ in matrix $B$ and summing their products. |

For example, consider the following matrices:

(1)We first note that matrix $A$ is of size $2 \times 2$, and matrix $B$ is of size $2 \times 3$, hence the product $AB$ is defined and will be of size $2 \times 3$. To find the first entry of our matrix $AB$, we will take row $1$ of $A$ and multiply corresponding entries of column $1$ of $B$ (and then sum then) to get $2\cdot3 + 1 \cdot 6 = 12$. Therefore, the first entry of our product matrix is $12$, and the rest of the entries are as follows:

(2)In general given $A_{m \times r}$ and $B_{r \times n}$:

(3)Furthermore, $ij^{th}$ entry in the product $AB$ can be obtained by the following formula:

(4)# The Cancellation Law for Multiplication Does NOT Hold

Suppose we have three matrices $A$, $B$, and $C$ and assume the products $AB$ and $AC$ are defined and $AB = AC$. We may be quick to assume that $B = C$, however this is not true for all cases (though in certain cases it is true). For example, consider the following $2 \times 2$ matrices:

(5)Note that $AB = AC = \begin{bmatrix} 3 & 4\\ 6 & 8 \end{bmatrix}$. However clearly $B ≠ C$.

## Example 1

**Show that if $A$ is a matrix of size $m \times n$ then $AA^T$ is always defined and will be a square matrix.**

**Proof:**We first note that $A^T$ will be an $n \times m$ sized matrix. The matrix product $A_{m \times n}A^T_{n \times m}$ will always be defined since $A$ has n columns and $A^T$ has n rows. Furthermore, the product will be of size $m \times m$ and will hence be square $\blacksquare$.