6.2 Basics

Matrix algebra often proves useful. We assume you recall how to add, multiply and do basic matrix operations.

Example 6.1 Consider the matrices: \[ A = \left[ \begin{array}{rrr} 1 & 11 & 21\\ 2 & 12 & 22\\ \end{array} \right] \quad\text{and}\quad {B} = \left[ \begin{array}{rrr} -1 & 4 & -5\\ 0 & 3 & 2\\ \end{array} \right]. \] Then \(A + B\) is \[ A + B = \left[ \begin{array}{rrr} 1 + (-1)& 11 + 4 & 21 + (-5)\\ 2 + 0 & 12 + 3 & 22 + 2\\ \end{array} \right] = \left[ \begin{array}{ccc} 0 & 15 & 16\\ 2 & 15 & 24\\ \end{array} \right]. \] We cannot find \(A \times B\) as the sizes do not comform. However, \[ \begin{aligned} A^T \times B &= \left[ \begin{array}{rr} 1 & 2\\ 11 & 12\\ 21 & 22 \end{array} \right] \times \left[ \begin{array}{rrr} -1 & 4 & -5\\ 0 & 3 & 2 \end{array} \right]\\ &= \left[ \begin{array}{rrr} (\phantom{0}1\times -1) + (\phantom{0}2\times 0) & (\phantom{0}1\times 4) + (\phantom{0}2\times 3) & (\phantom{0}1\times -5) + (\phantom{0}2\times 2)\\ (11\times -1) + (12\times 0) & (11\times 4) + (12\times 3) & (11\times -5) + (12\times 2)\\ (21\times -1) + (22\times 0) & (21\times 4) + (22\times 3) & (21\times -5) + (22\times 2)\\ \end{array} \right]\\ &= \left[ \begin{array}{rrr} -1 & 10 & -1 \\ -11 & 80 & -31\\ -21 & 150 & -61 \\ \end{array} \right]. \end{aligned} \]

It is worth remembering that matrix multiplication can only occur between two conformable matrices. That is, consider matrix \(A\) of size \(n\times m\) and matrix \(B\) of size \(m\times p\). Then we can multiply \(A\times B\), producing a \((n\times m) \times (m\times p) = n\times p\) matrix, but we cannot multiply \(B\) by \(A\).