Section 17.2 Matrix Multiplication
Definition 17.2.1.
Let \(A=\left(a_{ij}\right)_{m \times n}\) and \(B = \left(b_{ij}\right)_{n \times p}\text{.}\) Then matrix multiplication is defined byIf we call \(C=AB\) then from this definition it can be seen:
For the matrix multiplication \(AB\) to be defined the number of columns in \(A\) has to be equal to the number of rows in \(B\text{.}\) The resulting matrix, \(C\text{,}\) has the same number of rows as \(A\) and the same number of columns as \(B\text{.}\)
Entry \(c_{ij}\) in \(C\) is found by taking the scalar (or dot) product of the \(i^{\mbox{th}}\) row vector from \(A\) with (the transpose of) the \(j^{\mbox{th}}\) column vector from \(B\text{,}\) i.e.
\begin{align*} c_{ij} \amp = (a_{i1},a_{i2}, \ldots, a_{in})\cdot (b_{1j},b_{2j}, \ldots, b_{nj}) \\ \amp = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}. \end{align*}
Example 17.2.2.
Let
Calculate \(AB\text{.}\)
Calculate \(BA\text{.}\)
\(\displaystyle AB=\begin{pmatrix} -3 \amp 4 \\ -7 \amp 23/2 \\ -19 \amp 21 \end{pmatrix}\)
\(BA\) is not defined.
-
Since \(A\) is a \(3 \times 2\) matrix and \(B\) is \(2\times 2\) then \(AB\) is defined since \(A\) has \(2\) columns and \(B\) has \(2\) rows. The resultant matrix will be a \(3 \times 2\) matrix since \(A\) has \(3\) rows and \(B\) has \(2\) columns. Thus \(AB\) will be of the form
\begin{equation*} AB = \begin{pmatrix}c_{11} \amp c_{12}\\ c_{21} \amp c_{22}\\ c_{31} \amp c_{32}\end{pmatrix}. \end{equation*}Now
\begin{align*} c_{11} \amp = (0,1)\cdot (-2,-3) = 0 -3 = -3 \\ c_{12} \amp = (0,1)\cdot (1/2,4) = 0 + 4 = 4 \\ c_{21} \amp = (-1,3)\cdot (-2,-3) = 2 - 9 = -7 \\ c_{22} \amp = (-1,3)\cdot (1/2,4) = -1/2 +12 = 23/2 \\ c_{31} \amp = (2,5)\cdot (-2,-3) = -4 -15 = -19 \\ c_{32} \amp = (2,5)\cdot (1/2,4) = 1 + 20 = 21 \end{align*}and so
\begin{equation*} AB=\begin{pmatrix} -3 \amp 4 \\ -7 \amp 23/2 \\ -19 \amp 21 \end{pmatrix}. \end{equation*} \(BA\) is not defined because the number of columns in \(B\) (i.e. 2) is not equal to the number of rows in \(A\) (i.e. 3).
Notice that this example shows that matrix multiplication is not commutative, i.e. in general
Example 17.2.3.
Let
Calculate \(A(BC)\text{.}\)
Calculate \((AB)C\text{.}\)
\(A(BC) = \begin{pmatrix}84 \amp -7 \amp 105 \\ -12 \amp 6 \amp 0\end{pmatrix} = (AB)C\)
-
\(BC = \begin{pmatrix} 1 \amp 0 \\ -1 \amp 2 \\ 3 \amp 1 \\ 4 \amp 5 \end{pmatrix}\begin{pmatrix}-2 \amp 1 \amp 0 \\ 4 \amp -1 \amp 3\end{pmatrix} = \begin{pmatrix} -2 \amp 1 \amp 0\\ 10 \amp -3 \amp 6 \\ -2 \amp 2 \amp 3 \\ 12 \amp -1 \amp 15\end{pmatrix}\)
\begin{equation*} A(BC) = \begin{pmatrix} 3\amp 2 \amp 1 \amp 6 \\ 2 \amp 1 \amp 3 \amp -1\end{pmatrix}\begin{pmatrix} -2 \amp 1 \amp 0\\ 10 \amp -3 \amp 6 \\ -2 \amp 2 \amp 3 \\ 12 \amp -1 \amp 15\end{pmatrix} = \begin{pmatrix} 84 \amp -7 \amp 105 \\ -12 \amp 6 \amp 0\end{pmatrix}. \end{equation*} -
\(AB = \begin{pmatrix} 3\amp 2 \amp 1 \amp 6 \\ 2 \amp 1 \amp 3 \amp -1\end{pmatrix} \begin{pmatrix} 1 \amp 0 \\ -1 \amp 2 \\ 3 \amp 1 \\ 4 \amp 5 \end{pmatrix} = \begin{pmatrix} 28 \amp 35 \\ 6 \amp 0\end{pmatrix}\)
\begin{equation*} (AB)C = \begin{pmatrix} 28 \amp 35 \\ 6 \amp 0\end{pmatrix} \begin{pmatrix}-2 \amp 1 \amp 0 \\ 4 \amp -1 \amp 3\end{pmatrix} = \begin{pmatrix}84 \amp -7 \amp 105 \\ -12 \amp 6 \amp 0\end{pmatrix}. \end{equation*}
Notice that this example is an illustration that matrix multiplication is associative, i.e. in general
From the definition of matrix multiplication the following properties can be shown to hold.
Theorem 17.2.4. Properties of Matrix Multiplication.
Let \(A\text{,}\) \(B\) and \(C\) be appropriately sized matrices. Then
\(A(BC)=(AB)C \hspace{55mm}\) (Associative Law)
\(A(B+C) = AB + AC \hspace{42mm}\) (Left Distributive Law)
\((A+B)C = AC + BC \hspace{42mm}\) (Right Distributive Law)
\(\displaystyle k(AB) = (kA)B = A(kB)\)
\(I_mA = A = AI_n\) if \(A\) is an \(m \times n\) matrix\(\hspace{5mm}\) (Identity Law)
For later reference, some properties of the transpose of a matrix with respect to the various matrix operations that we have been discussing are listed below.
Theorem 17.2.5. Properties of Matrix Transpose.
Let \(A\) and \(B\) be appropriately sized matrices. Then
\(\displaystyle (A^T)^T = A\)
\(\displaystyle (A+B)^T = A^T + B^T \)
\(\displaystyle (kA)^T = k(A^T) \)
\(\displaystyle (AB)^T = B^TA^T \)
\((A^r)^T = (A^T)^r \) where \(r \in \mathbb{N}\text{.}\)
Example 17.2.6.
Confirm that \((AB)^T = B^T A^T\) holds for the matrices
Firstly
Next
Exercises Example Tasks
1.
Let
Calculate \((A+B)^2\text{.}\)
Calculate \(A^2 + 2AB + B^2\text{.}\)
2.
Let
Calculate \((EF)_{23}\text{.}\)
Calculate \((FE)_{12}\text{.}\)