If matrix \(\mathbf{A}\) is matrix-row which can be written as:
\begin{eqnarray}
\mathbf{A} &=& \left(\begin{matrix}a_1&a_2&...& a_n\end{matrix}\right),
\end{eqnarray}
and matrix \(\mathbf{B}\) is matrix-colum which can be written as:
\begin{eqnarray}
\mathbf{B} &=& \left(\begin{matrix}b_1\\ b_2 \\ \vdots\\ b_n\end{matrix}\right),
\end{eqnarray}
then the result of \(\mathbf{AB}\) is:
\begin{eqnarray}
\mathbf{C} &=& \mathbf{AB} = \left(\begin{matrix}a_1&a_2&...& a_n\end{matrix}\right)\left(\begin{matrix}b_1\\ b_2 \\ \vdots\\ b_n\end{matrix}\right) = \left(a_1b_1 + a_2b_2 + \cdots a_nb_n\right).
\end{eqnarray}
Example of multiplication of vector-column and vector-row.
\begin{eqnarray}
\left(\begin{matrix}1&2&3\end{matrix}\right)\left(\begin{matrix}2\\ 4\\ 5\end{matrix}\right) &=& \left(1\cdot 2 + 2\cdot4 + 3\cdot 5\right) = 25.
\end{eqnarray}
It should be noted that result of matrix multiplication is matrix, not a number!!!
One element matrix \([a]\) can be multiplied from the right side with one vector:
\begin{eqnarray}
[a]\left(\begin{matrix}b_1& b_2&...&b_n\end{matrix}\right) &=& \left(\begin{matrix}ab_1&ab_2&...&ab_n\end{matrix}\right),
\end{eqnarray}
or from the left side with one vector-column:
\begin{eqnarray}
\left(\begin{matrix}b_1\\ \vdots \\ b_n\end{matrix}\right)[a] &=& \left(\begin{matrix}b_1a\\ \vdots \\ b_n a\end{matrix}\right),
\end{eqnarray}
Two vectors (column and row form) multiplied togehter in general form can be written as:
\begin{eqnarray}
\left(\begin{matrix}b_1\\ b_2 \\ b_3\end{matrix}\right)\left(\begin{matrix}a_1&a_2&a_3\end{matrix}\right) &=& \left(\begin{matrix}b_1a_1&b_1a_2&b_1a_3\\ b_2a_1&b_2a_2&b_2a_3\\ b_3a_1&b_3a_2&b_3a_3\end{matrix}\right).
\end{eqnarray}
Generally, multiplication of two matrices can be written as:
\begin{eqnarray}
\mathbf{AB} &=& \left(\begin{matrix}a_{11}&a_{12}&a_{13}\\ a_{21}&a_{22}&a_23\end{matrix}\right)\cdot\left(\begin{matrix}b_{11}&b_{12}\\ b_{21}&b_{22}\\ b_{31}&b_{32}\end{matrix}\right)\\
\mathbf{AB} &=& \left(\begin{matrix}a_{11}b_{11} + a_{12}b_{21} + a_{13}b_{31} & a_{11}b_{12} + a_{12}b_{22} + a_{13}b_{32}\\ a_{21}b_{11} + a_{22}b_{21} + a_{23}b_{31} & a_{21}b_{12} + a_{22}b_{22} + a_{23}b_{32}\end{matrix}\right)
\end{eqnarray}
- Example 1 Multiply two matrices \(\left(\begin{matrix}2&1&1\\ 3&0&1\end{matrix}\right)\cdot\left(\begin{matrix}3&1\\ 2&1\\ 1&0\end{matrix}\right)\) .
Solution \begin{eqnarray} \left(\begin{matrix}2&1&1\\ 3&0&1\end{matrix}\right)\cdot\left(\begin{matrix}3&1\\ 2&1\\ 1&0\end{matrix}\right) &=& \left(\begin{matrix}2\cdot 3 + 1\cdot 2 + 1\cdot 1 & 2\cdot 1 + 1\cdot 1 + 1\cdot 0 \\ 3\cdot 3 + 0\cdot 2 + 1\cdot 1 & 3\cdot 1+ 0\cdot 1 + 1\cdot 0\end{matrix}\right)\\ &=& \left(\begin{matrix}9&3\\ 10&3\end{matrix}\right) \end{eqnarray} - Example 2 Multiply two matrices \(\left(\begin{matrix}2\\ 1\\ 3\end{matrix}\right)\cdot\left(\begin{matrix}1&2&3\end{matrix}\right)\) .
Solution \begin{eqnarray} \left(\begin{matrix}2\\1 \\ 3\end{matrix}\right)\cdot\left(\begin{matrix}1&2&3\end{matrix}\right) &=& \left(\begin{matrix}2\cdot 1&2\cdot 2 & 2\cdot 3\\ 1\cdot 1 & 1\cdot 2 & 1\cdot 3\\ 3\cdot 1& 3\cdot 2& 3\cdot 3\end{matrix}\right)\\ &=& \left(\begin{matrix}2&4&6\\ 1&2&3\\ 3&6&9\end{matrix}\right) \end{eqnarray} while \begin{eqnarray} \left(\begin{matrix}1&2&3\end{matrix}\right)\cdot\left(\begin{matrix}2\\ 1\\ 3\end{matrix}\right) &=& \left(\begin{matrix}1\cdot 2+ 2\cdot 1 + 3\cdot 3\end{matrix}\right)\\ &=& 13 \end{eqnarray} - Example 3 Investigate the relation \(\mathbf{BA} = \mathbf{AB}\) if
\begin{eqnarray} \mathbf{A} &=& \left(\begin{matrix}2&1&1\\ 3&0&1\end{matrix}\right), \mathbf{B} &=& \left(\begin{matrix}3&1\\ 2&1\\ 1&0\end{matrix}\right). \end{eqnarray}
Solution \begin{eqnarray} \mathbf{BA} &=& \left(\begin{matrix}3&1\\ 2&1\\ 1&0\end{matrix}\right)\cdot\left(\begin{matrix}2&1&1\\ 3&0&1\end{matrix}\right) \\ &=& \left(\begin{matrix}3\cdot 2 + 1\cdot 3 & 3\cdot 1 + 1\cdot 0 & 3\cdot 1 + 1\cdot 1\\ 2\cdot 2 +1\cdot 3 & 2\cdot 1+ 1\cdot 0 & 2\cdot 1+1\cdot1\\ 1\cdot 2+0\cdot 3 & 1\cdot 1+ 0\cdot 0 & 1\cdot 1 + 0\cdot 1 \end{matrix}\right) \\ &=& \left(\begin{matrix}9&3&4\\ 7&2&3\\ 2&1&1\end{matrix}\right) \end{eqnarray} \begin{eqnarray} \mathbf{AB} &=& \left(\begin{matrix}2&1&1\\ 3&0&1\end{matrix}\right)\cdot\left(\begin{matrix}3&1\\ 2&1\\ 1&0\end{matrix}\right)\\ &=& \left(\begin{matrix}2\cdot 3 + 1\cdot 2 + 1\cdot 1 & 2\cdot 1+1\cdot 1+ 1\cdot 0\\ 3\cdot 3 + 0\cdot 2 + 1\cdot 1 & 3\cdot 1 + 0 \cdot 1 + 1\cdot 0\end{matrix}\right)\\ &=& \left(\begin{matrix}9&3\\ 10&3\end{matrix}\right) \end{eqnarray} From obtained solutions it can be concluded that \(\mathbf{BA} \neq \mathbf{AB}\). Two matrices \(\mathbf{A}\) and \(\mathbf{B}\) are anticommutative, if \begin{eqnarray} \mathbf{AB} &=& -\mathbf{BA}. \end{eqnarray} For the product of two matrices two laws of distribution are valid and these are: \begin{eqnarray} (\mathbf{A}+\mathbf{B}) \mathbf{C} &=& \mathbf{AC} +\mathbf{BC},\\ \mathbf{C}(\mathbf{A}+\mathbf{B}) &=& \mathbf{CA} + \mathbf{CB}. \end{eqnarray} - Example 4 Proove that \(\mathbf{BA}\) does not exits if:
\begin{eqnarray}
\mathbf{A} &=& \left(\begin{matrix}2&1&1\\ 3&0&1\end{matrix}\right),\\
\mathbf{B} &=& \left(\begin{matrix}1&2&3\\ 2&4&6\\ 4&3&0\end{matrix}\right)
\end{eqnarray}
Solution \begin{eqnarray} \mathbf{AB} &=& \left(\begin{matrix}2&1&1\\ 3&0&1\end{matrix}\right)\cdot \left(\begin{matrix}1&2&3\\ 2&4&6\\ 4&3&0\end{matrix}\right)\\ &=& \left(\begin{matrix}5\cdot1 +0\cdot 2 +7\cdot 4 & 5\cdot 2+ 0\cdot 4+7\cdot 3& 5\cdot 3 + 0\cdot 6 + 7\cdot 0 \\4\cdot 1 +1\cdot 2 + 3\cdot 4 & 4\cdot 2 + 1\cdot 4 + 3\cdot 3 & 4\cdot 3 + 1\cdot 6 + 3\cdot 0\end{matrix}\right)\\ &=& \left(\begin{matrix}33&31&15\\ 18&21&18\end{matrix}\right) \end{eqnarray} \begin{eqnarray} \mathbf{BA}&=& \left(\begin{matrix}1&2&3\\ 2&4&6\\ 4&3&0\end{matrix}\right)\cdot\left(\begin{matrix}2&1&1\\ 3&0&1\end{matrix}\right) \end{eqnarray} The \(\mathbf{BA}\) is impossible to multiply since number of columns (3) in \(\mathbf{B}\) is not equal to the number of rows (2) in \(\mathbf{A}\). - Example 5 Multiply two squarematrices \(A=\left(\begin{matrix}1&-2\\ 2&0\end{matrix}\right)\) and \(B=\left(\begin{matrix}-3&-2\\ 2&-4\end{matrix}\right)\).
Solution \begin{eqnarray} \mathbf{AB} &=& \left(\begin{matrix}1&-2\\ 2&0\end{matrix}\right)\cdot\left(\begin{matrix}-3&-2\\ 2&-4\end{matrix}\right)\\ &=& \left(\begin{matrix}1\cdot(-3) + (-2)\cdot 2& 1\cdot(-2) + (-2)\cdot(-4)\\ 2\cdot(-3) + 0\cdot 2 & 2\cdot(-2) + 0\cdot(-4)\end{matrix}\right)\\ &=& \left(\begin{matrix}-7&6\\ -6&-4\end{matrix}\right) \end{eqnarray} \begin{eqnarray} \mathbf{BA} &=& \left(\begin{matrix}-3&-2\\ 2&-4\end{matrix}\right)\cdot \left(\begin{matrix}1&-2\\ 2&0\end{matrix}\right) \\ &=& \left(\begin{matrix}-3\cdot 1 +(-2)\cdot 2& -3\cdot(-2) + (-2)\cdot 0\\ 2\cdot 1+ (-4)\cdot 2& 2\cdot(-2) +(-4)\cdot 0\end{matrix}\right) &=& \left(\begin{matrix}-7& 6\\ -6& -4\end{matrix}\right) \end{eqnarray} From previous solution it can be concluded that square matrices can alway be calculated \(\mathbf{AB}\) and \(\mathbf{BA}\) but only in specific case are matrices \(\mathbf{A}\) and \(\mathbf{B}\) comutative, i.e. \(\mathbf{AB} = \mathbf{BA}\). - Example 6 Multiply matrix \(\mathbf{A} = \left(\begin{matrix}a_{11}&a_{12}&a_{13}\\ a_{21}&a_{22}&a_{23}\\ a_{31}&a_{32}&a_{33}\end{matrix}\right)\) with identity matrix.
Solution \begin{eqnarray} \mathbf{AI} &=& \left(\begin{matrix}a_{11}&a_{12}&a_{13}\\ a_{21}&a_{22}&a_{23}\\ a_{31}&a_{32}&a_{33}\end{matrix}\right)\cdot \left(\begin{matrix}1&0&0\\ 0&1&0\\ 0&0&1\end{matrix}\right)\\ &=& \left(\begin{matrix}a_{11}\cdot 1 + a_{12}\cdot 0 +a_{13}\cdot 0&a_{11}\cdot 0 + a_{12}\cdot 1 + a_{13}\cdot 0 &a_{11}\cdot 0 + a_{12}\cdot 0 + a_{13}\cdot 1\\ a_{21} \cdot 1 + a_{22}\cdot 0+ a_{23}\cdot 1&a_{21}\cdot 0+ a_{22}\cdot 1+ a_{23}\cdot 0&a_{21}\cdot 0 + a_{22}\cdot 0 +a_{23}\cdot 1\\ a_{31}\cdot 1+a_{32}\cdot 0+ a_{33}\cdot 0&a_{31}\cdot 0+ a_{32}\cdot 1 + a_{33}\cdot 0&a_{31}\cdot 0+ a_{32}\cdot 0+ a_{33}\cdot 1\end{matrix}\right)\\ &=& \left(\begin{matrix}a_{11}&a_{12}&a_{13}\\ a_{21}&a_{22}&a_{23}\\ a_{31}&a_{32}&a_{33}\end{matrix}\right) \end{eqnarray} The same result would be obtained if we multiplied \(\mathbf{IA}\) - Example 7 Solve the problem \((\mathbf{A}+\mathbf{B}) \mathbf{C} = \mathbf{AC} +\mathbf{BC}\). Where matrices \mathbf{A},\mathbf{B}, and \mathbf{C} are:
\begin{eqnarray}
\mathbf{A} &=& \left(\begin{matrix}2&0\\ 0&1\end{matrix}\right),\\
\mathbf{B} &=& \left(\begin{matrix}3&0\\ 2&1\end{matrix}\right),\\
\mathbf{C} &=& \left(\begin{matrix}2&2\\ 1&1\end{matrix}\right).
\end{eqnarray}
Solution Solve the left side of the identity \((\mathbf{A}+\mathbf{B})\cdot \mathbf{C}\). \begin{eqnarray} \mathbf{A}+\mathbf{B} &=& \left(\begin{matrix}5&0\\ 2&2\end{matrix}\right)\\ (\mathbf{A} + \mathbf{B})\cdot \mathbf{C} &=& \left(\begin{matrix}5\cdot 2 + 0\cdot 1 & 5\cdot 2 + 0 \cdot 1\\ 2\cdot 2 + 2\cdot 1 & 2\cdot 2 + 2\cdot 1 \end{matrix}\right)\\ &=& \left(\begin{matrix}10&10\\ 6&6\end{matrix}\right) \end{eqnarray} Solve the right side of the identity \(\mathbf{AC} +\mathbf{BC}\). \begin{eqnarray} \mathbf{AC} &=& \left(\begin{matrix}2\cdot 2 + 0\cdot 1& 2\cdot 2 + 0\cdot 1 \\ 0 \cdot 2 + 1\cdot 1 & 0\cdot 2 + 1\cdot 1\end{matrix}\right)\\ &=& \left(\begin{matrix}4&4\\ 1&1\end{matrix}\right)\\ \mathbf{BC} &=& \left(\begin{matrix}3\cdot 2+0\cdot 1& 3\cdot 2+0\cdot 1\\ 2\cdot 2 +1\cdot 1 & 2\cdot 2+1 \cdot 1\end{matrix}\right)\\ &=& \left(\begin{matrix}6&6\\5&5\end{matrix}\right)\\ \mathbf{AC}+\mathbf{BC} &=& \left(\begin{matrix}4&4\\ 1&1\end{matrix}\right)+\left(\begin{matrix}6&6\\5&5\end{matrix}\right) =\left(\begin{matrix}10&10\\6&6\end{matrix}\right) \end{eqnarray} From the obtained solutions it can be concluded that solution of left side of identity is equal to solution for right side of identity. - Example 8Solve the problem \(\mathbf{C}(\mathbf{A}+\mathbf{B}) = \mathbf{CA} +\mathbf{CB}\). Where matrices \mathbf{A},\mathbf{B}, and \mathbf{C} are:
\begin{eqnarray}
\mathbf{A} &=& \left(\begin{matrix}2&0\\ 0&1\end{matrix}\right),\\
\mathbf{B} &=& \left(\begin{matrix}3&0\\ 2&1\end{matrix}\right),\\
\mathbf{C} &=& \left(\begin{matrix}2&2\\ 1&1\end{matrix}\right).
\end{eqnarray}
Solution Solving right side of identity \(\mathbf{C}(\mathbf{A}+\mathbf{B})\). Form previous example we know that \(\mathbf{A}+\mathbf{B} = \left(\begin{matrix}5&0\\ 2&2\end{matrix}\right)\). \begin{eqnarray} \mathbf{C}(\mathbf{A}+\mathbf{B}) &=& \left(\begin{matrix}2&2\\ 1&1\end{matrix}\right)\cdot \left(\begin{matrix}5&0\\ 2&2\end{matrix}\right)\\ &=& \left(\begin{matrix}2\cdot 5+ 2\cdot 2 & 2\cdot 0 + 2\cdot 2\\ 1\cdot 5 + 1\cdot 2 & 1\cdot 0+1\cdot 2\end{matrix}\right) \\ &=& \left(\begin{matrix}14&4\\ 7&2\end{matrix}\right) \end{eqnarray} Solving the left side of identity \(\mathbf{CA} + \mathbf{CB}\). \begin{eqnarray} \mathbf{CA} &=& \left(\begin{matrix}2&2\\ 1&1\end{matrix}\right)\cdot \left(\begin{matrix}2&0\\ 0&1\end{matrix}\right)\\ &=& \left(\begin{matrix}2\cdot 2+2\cdot 0 & 2\cdot 0 + 2\cdot 1\\ 1\cdot 2 +1\cdot 0 & 1\cdot 0+1\cdot 1\end{matrix}\right)\\ &=& \left(\begin{matrix}4&2\\ 2&1\end{matrix}\right)\\ \mathbf{CB} &=& \left(\begin{matrix}2&2\\ 1&1\end{matrix}\right)\cdot \left(\begin{matrix}3&0\\ 2&1\end{matrix}\right)\\ &=& \left(\begin{matrix}2\cdot 3+2\cdot 2 & 2\cdot 0 +2\cdot 1 \\ 1\cdot 3 + 1\cdot 2 & 1\cdot 0+1\cdot 1\end{matrix}\right)\\ &=& \left(\begin{matrix}10&2\\5&1\end{matrix}\right)\\ \mathbf{CA} + \mathbf{CB} &=& \left(\begin{matrix}4&2\\ 2&1\end{matrix}\right) +\left(\begin{matrix}10&2\\5&1\end{matrix}\right)\\ &=& \left(\begin{matrix}14&4\\ 7&2\end{matrix}\right) \end{eqnarray} The obtained solution showed that solution of the left side of the identity is equal to the solution from right side of identity. - Example 9 Show that \(\mathbf{AB} = 0\) if matrices \(\mathbf{A}\) and \(\mathbf{B}\) are equal to:
\begin{eqnarray}
\mathbf{A} &=& \left(\begin{matrix}1&-2&4\\ -2&3&-5\end{matrix}\right),\\
\mathbf{B} &=& \left(\begin{matrix}2&4\\ 3&6\\ 1&2\end{matrix}\right)
\end{eqnarray}
Solution \begin{eqnarray} \mathbf{AB} &=& \left(\begin{matrix}1&-2&4\\ -2&3&-5\end{matrix}\right)\cdot\left(\begin{matrix}2&4\\ 3&6\\ 1&2\end{matrix}\right)\\ &=& \left(\begin{matrix}1\cdot 2 + (-2)\cdot 3 + 4\cdot 1 & 1\cdot 4 + (-2)\cdot 6 + 4\cdot 2 \\ (-2)\cdot 2 + 3\cdot 3 +(-5)\cdot 1 & (-2)\cdot 4 + 3\cdot 6 + (-5)\cdot 2\end{matrix}\right)\\ &=& \left(\begin{matrix}0&0\\ 0&0\end{matrix}\right) = 0 \end{eqnarray} - Example 10 Multiply two matrices\(\left(\begin{matrix}29&16&49\end{matrix}\right)\cdot\left(\begin{matrix}-2&-1&6\\ -13&4&32\\ 5&-1&-15\end{matrix}\right)\) .
Solution \begin{eqnarray} &=&\left(\begin{matrix}29&16&49\end{matrix}\right)\cdot\left(\begin{matrix}-2&-1&6\\ -13&4&32\\ 5&-1&-15\end{matrix}\right)\\ &=&\left(\begin{matrix}29\cdot(-2) + 16\cdot (-13) + 49\cdot 5 & 29\cdot (-1) + 16\cdot 4 + 49\cdot (-1) & 29\cdot 6 + 16 \cdot 32 + 49\cdot (-15)\end{matrix}\right)\\ &=& \left(\begin{matrix}-21&-14&-49\end{matrix}\right) \end{eqnarray} - Example 11 Multiply two matrices \(\left(\begin{matrix}1&2&3\\ 2&4&6\\ 3&6&9\end{matrix}\right)\cdot\left(\begin{matrix}-1&-2&-4\\ -1&-2&-4\\ 1&2&1\end{matrix}\right)\) .
Solution \begin{eqnarray} &=&\left(\begin{matrix}1&2&3\\ 2&4&6\\ 3&6&9\end{matrix}\right)\cdot\left(\begin{matrix}-1&-2&-4\\ -1&-2&-4\\ 1&2&4\end{matrix}\right) \\ &=&\left(\begin{matrix} 1\cdot(-1) + 2\cdot(-1) + 3\cdot 1 & 1\cdot(-2) + 2\cdot(-2)+ 3\cdot 2 & 1\cdot (-4) + 2\cdot(-4) + 3\cdot 4\\ 2\cdot(-1) + 4\cdot(-1) + 6\cdot 1 & 2\cdot (-2) + 4\cdot(-2) + 6\cdot 2 & 2\cdot(-4) + 4\cdot(-4) + 6\cdot 4\\ 3\cdot (-1) + 6\cdot (-1) + 9\cdot 1 & 3\cdot(-2) + 6\cdot(-2) + 9\cdot 2 & 3\cdot(-4) + 6\cdot(-4) + 9\cdot 4 \end{matrix}\right)\\ &=& \left(\begin{matrix}0&0&0\\ 0&\end{matrix}\right) \end{eqnarray} - Example 12 Multiply two matrices \(\left(\begin{matrix}1&0&4\\ -1&3&0\\ 1&0&-1\end{matrix}\right)\cdot\left(\begin{matrix}1\\ -2\\ 3\end{matrix}\right)\).
Solution \begin{eqnarray} &=& \left(\begin{matrix}1&0&4\\ -1&3&0\\ 1&0&-1\end{matrix}\right)\cdot\left(\begin{matrix}1\\ -2\\ 3\end{matrix}\right)\\ &=& \left(\begin{matrix}1\cdot 1 + 0\cdot (-2) + 4\cdot 3 \\ (-1)\cdot 1 + 3\cdot (-2) + 0\cdot 3 \\ 1\cdot 1+ 0\cdot (-2) + (-1)\cdot 3\end{matrix}\right)=\left(\begin{matrix}13\\ -7\\ -2\end{matrix}\right) \end{eqnarray} - Example 13 Calculate \(\mathbf{AB}\) and \(\mathbf{BA}\)if matrices \(\mathbf{A}\) and \(\mathbf{B}\) are:
\begin{eqnarray}
\mathbf{A} &=& \left(\begin{matrix}2&3&4\\ -1&2&1\end{matrix}\right)\\
\mathbf{B} &=& \left(\begin{matrix}1&-3\\ 2&-1\\ 3&4\end{matrix}\right)
\end{eqnarray}
Solution \begin{eqnarray} \mathbf{AB} &=& \left(\begin{matrix}2&3&4\\ -1&2&1\end{matrix}\right)\cdot\left(\begin{matrix}1&-3\\ 2&-1\\ 3&4\end{matrix}\right)\\ &=& \left(\begin{matrix}2\cdot 1 + 3\cdot 2 + 4\cdot 3 & 2\cdot(-3) + 3\cdot(-1) + 4\cdot 4\\ (-1)\cdot 1 + 2\cdot 2 + 1\cdot 3 & (-1) \cdot (-3) + 2\cdot(-1) + 1\cdot 4 \end{matrix}\right)\\ &=& \left(\begin{matrix}20&7\\ 6&5\end{matrix}\right)\\ \mathbf{BA} &=& \left(\begin{matrix}1&-3\\ 2&-1\\ 3&4\end{matrix}\right)\cdot\left(\begin{matrix}2&3&4\\ -1&2&1\end{matrix}\right)\\ &=& \left(\begin{matrix}1\cdot 2 + (-3)\cdot (-1) & 1\cdot 3 +(-3)\cdot 2 & 1\cdot 4 +(-3)\cdot 1 \\ 2\cdot 2 + (-1)\cdot (-1) & 2\cdot 3 +(-1) \cdot 2 & 2\cdot 4 + (-1) \cdot 3\\ 3\cdot 2 + 4\cdot (-1) & 3\cdot 3 +4\cdot 2 & 3\cdot 4 +4\cdot 1 \end{matrix}\right)\\ &=& \left(\begin{matrix}5&-3&1\\ 6&4& 5\\ 2&17&16\end{matrix}\right) \end{eqnarray} - Example 14 Calculate \(\mathbf{AB}\) and \(\mathbf{BA}\)if matrices \(\mathbf{A}\) and \(\mathbf{B}\) are:
\begin{eqnarray}
\mathbf{A} &=& \left(\begin{matrix}2&4\\ 3&7\end{matrix}\right),\\
\mathbf{B} &=& \left(\begin{matrix}5&1\\ 2&11\end{matrix}\right).
\end{eqnarray}.
Solution \begin{eqnarray} \mathbf{AB} &=&\left(\begin{matrix}2&4\\ 3&7\end{matrix}\right)\cdot \left(\begin{matrix}5&1\\ 2&11\end{matrix}\right)\\ &=& \left(\begin{matrix}2\cdot 5 + 4\cdot 2 & 2\cdot 1 +4\cdot 11\\ 3\cdot 5 + 7\cdot 2 & 3\cdot 1 + 7\cdot 11\end{matrix}\right)\\ &=& \left(\begin{matrix}18&46\\ 29&80\end{matrix}\right)\\ \mathbf{BA} &=& \left(\begin{matrix}5&1\\ 2&11\end{matrix}\right)\cdot \left(\begin{matrix}2&4\\ 3&7\end{matrix}\right)\\ &=& \left(\begin{matrix}5\cdot 2 + 1\cdot 3 & 5\cdot 4 + 1\cdot 7 \\ 2\cdot 2 + 11 \cdot 3 & 2\cdot 4+11\cdot 7\end{matrix}\right)\\ &=& \left(\begin{matrix}13&27\\ 37&85\end{matrix}\right) \end{eqnarray} - Example 15 Calculate \(\mathbf{AB}-\mathbf{BA}\) if matrices \(\mathbf{A}\) and \(\mathbf{B}\) are:
\begin{eqnarray}
\mathbf{A} &=& \left(\begin{matrix}1&2&1\\ 2&1&2\\ 1&2&3\end{matrix}\right),\\
\mathbf{B} &=& \left(\begin{matrix}4&1&1\\ -4&2&0\\ 1&2&1\end{matrix}\right).
\end{eqnarray}.
Solution \begin{eqnarray} \mathbf{AB} &=& \left(\begin{matrix}1&2&1\\ 2&1&2\\ 1&2&3\end{matrix}\right)\cdot\left(\begin{matrix}4&1&1\\ -4&2&0\\ 1&2&1\end{matrix}\right)\\ &=& \left(\begin{matrix}1\cdot 4 + 2\cdot(-4) + 1\cdot 1 & 1\cdot 1+ 2\cdot 2 + 1\cdot 2 & 1\cdot 1 +2\cdot 0 + 1\cdot 1\\ 2\cdot 4 + 1\cdot(-4) + 2\cdot 1 & 2\cdot 1 + 1\cdot 2 + 2\cdot 2 & 2\cdot 1 + 1\cdot 0 +2\cdot 1\\ 1\cdot 4 + 2\cdot(-4) + 3\cdot 1 & 1\cdot 1 + 2\cdot 2 + 3\cdot 2 & 1\cdot 1 + 2\cdot 0 + 3\cdot 1\end{matrix}\right)\\ &=& \left(\begin{matrix}-3&7&2\\ 6&8&4\\ -1&11&4\end{matrix}\right)\\ \mathbf{BA} &=& \left(\begin{matrix}4&1&1\\ -4&2&0\\ 1&2&1\end{matrix}\right)\cdot \left(\begin{matrix}1&2&1\\ 2&1&2\\ 1&2&3\end{matrix}\right)\\ &=& \left(\begin{matrix}4\cdot 1 + 1\cdot 2 + 1\cdot 1 & 4\cdot 2 + 1\cdot 1 + 1\cdot 2 & 4\cdot 1+1\cdot 2+1\cdot 3\\ (-4)\cdot 1 + 2\cdot 2+ 0\cdot 1 & (-4) \cdot 2 + 2\cdot 1 + 0 \cdot 2 & (-4)\cdot 1 + 2\cdot 2 + 0 \cdot 3 \\ 1\cdot 1 + 2\cdot 2 +1\cdot 1 & 1\cdot 2 + 2\cdot 1 + 1\cdot 2 & 1\cdot 1 +2\cdot 2 + 1\cdot 3\end{matrix}\right)\\ &=& \left(\begin{matrix}7&11&9\\ 0&-6&0\\6&6&8\end{matrix}\right)\\ \mathbf{AB}-\mathbf{BA} &=& \left(\begin{matrix}-3&7&2\\ 6&8&4\\ -1&11&4\end{matrix}\right) - \left(\begin{matrix}7&11&9\\ 0&-6&0\\6&6&8\end{matrix}\right)\\ &=& \left(\begin{matrix}-10&-4&-7\\ 6&14&4\\ -7&5&-4\end{matrix}\right) \end{eqnarray} - Example 16 Calculate \(\left(\begin{matrix}2&1\\ 1&3\end{matrix}\right)^3\).
Solution \begin{eqnarray} \left(\begin{matrix}2&1\\ 1&3\end{matrix}\right)^3 &=& \left(\begin{matrix}2&1\\ 1&3\end{matrix}\right)\cdot \left(\begin{matrix}2&1\\ 1&3\end{matrix}\right)\cdot \left(\begin{matrix}2&1\\ 1&3\end{matrix}\right)\\ \left(\begin{matrix}2&1\\ 1&3\end{matrix}\right)\cdot \left(\begin{matrix}2&1\\ 1&3\end{matrix}\right)&=&\left(\begin{matrix}2\cdot 2 +1\cdot 1 & 2\cdot 1 + 1\cdot 3 \\ 1\cdot 2 + 3\cdot 1 & 1\cdot 1 + 3\cdot 3\end{matrix}\right)\\ &=& \left(\begin{matrix}5&5\\ 5 & 10 \end{matrix}\right)\\ \left(\begin{matrix}5&5\\ 5 & 10 \end{matrix}\right)\cdot \left(\begin{matrix}2&1\\ 1&3\end{matrix}\right) &=& \left(\begin{matrix}5\cdot 2 + 5\cdot 1 & 5\cdot 1 + 5\cdot 3\\ 5 \cdot 2 +10\cdot 1 & 5\cdot 1 + 10 \cdot 3\end{matrix}\right)\\ &=& \left(\begin{matrix}15&20\\ 20&35\end{matrix}\right) \end{eqnarray}