Matrix multiplication involves computing the dot product of rows and columns. It is not element-wise and requires that the number of columns in the first matrix equals the number of rows in the second.
\[ xA = x \cdot \begin{bmatrix} a & b \\ c & d \end{bmatrix} = \begin{bmatrix} xa & xb \\ xc & xd \end{bmatrix} \]
This shows scalar multiplication — each element of the matrix is multiplied by the scalar \( x \).
\[ \begin{bmatrix} a & b \end{bmatrix}_{1 \times 2} \cdot \begin{bmatrix} x & y \\ z & u \end{bmatrix}_{2 \times 2} = \begin{bmatrix} ax + bz & ay + bu \end{bmatrix}_{1 \times 2} \]
A 1×2 matrix multiplied by a 2×2 matrix, resulting in another 1×2 matrix.
\[ \begin{bmatrix} a & b \\ c & d \end{bmatrix} \cdot \begin{bmatrix} x & y \\ z & u \end{bmatrix} = \begin{bmatrix} ax + bz & ay + bu \\ cx + dz & cy + du \end{bmatrix} \]
Standard 2×2 matrix multiplication using dot product of rows and columns.
\[ AB = \begin{bmatrix} a & b & c \end{bmatrix}_{1 \times 3} \cdot \begin{bmatrix} x \\ y \\ z \end{bmatrix}_{3 \times 1} = \begin{bmatrix} ax + by + cz \end{bmatrix}_{1 \times 1} \]
This is the dot product of a row vector and a column vector.
\[ BA = \begin{bmatrix} x \\ y \\ z \end{bmatrix}_{3 \times 1} \cdot \begin{bmatrix} a & b & c \end{bmatrix}_{1 \times 3} = \begin{bmatrix} xa & xb & xc \\ ya & yb & yc \\ za & zb & zc \end{bmatrix}_{3 \times 3} \]
Here, the column vector multiplies the row vector to form a 3×3 matrix.
\[ CB = \begin{bmatrix} a & b & c \\ p & q & r \\ u & v & w \end{bmatrix}_{3 \times 3} \cdot \begin{bmatrix} x \\ y \\ z \end{bmatrix}_{3 \times 1} = \begin{bmatrix} ax + by + cz \\ px + qy + rz \\ ux + vy + wz \end{bmatrix}_{3 \times 1} \]
Multiplying a 3×3 matrix with a 3×1 column vector, resulting in a 3×1 matrix.
\[ CD = \begin{bmatrix} a & b & c \\ p & q & r \\ u & v & w \end{bmatrix}_{3 \times 3} \cdot \begin{bmatrix} \alpha & \beta & \gamma \\ \lambda & \mu & \xi \\ \rho & \sigma & \tau \end{bmatrix}_{3 \times 3} = \begin{bmatrix} a\alpha + b\lambda + c\rho & a\beta + b\mu + c\sigma & a\gamma + b\xi + c\tau \\ p\alpha + q\lambda + r\rho & p\beta + q\mu + r\sigma & p\gamma + q\xi + r\tau \\ u\alpha + v\lambda + w\rho & u\beta + v\mu + w\sigma & u\gamma + v\xi + w\tau \end{bmatrix} \]
This is a full 3×3 matrix multiplication where each element is computed by the dot product of corresponding rows and columns.
\[ DC = \begin{bmatrix} \alpha & \beta & \gamma \\ \lambda & \mu & \xi \\ \rho & \sigma & \tau \end{bmatrix} \cdot \begin{bmatrix} a & b & c \\ p & q & r \\ u & v & w \end{bmatrix} = \begin{bmatrix} \alpha a + \beta p + \gamma u & \alpha b + \beta q + \gamma v & \alpha c + \beta r + \gamma w \\ \lambda a + \mu p + \xi u & \lambda b + \mu q + \xi v & \lambda c + \mu r + \xi w \\ \rho a + \sigma p + \tau u & \rho b + \sigma q + \tau v & \rho c + \sigma r + \tau w \end{bmatrix} \]
This shows the reverse of matrix CD multiplication. The result is another 3×3 matrix, but not necessarily equal to CD.
\[ CD + DC \]
This expression represents the matrix addition of the two previously calculated products, CD and DC, provided they are of the same order.