Skip to content

Applied Mathematics · Ch 2 — Algebra

Multiplication of Matrices

2.4.4

Multiplication of Matrices

Multiplying two matrices is less straightforward than adding or subtracting them, because it isn't simply a matter of multiplying corresponding elements. Two matrices AA and BB can be multiplied, in that order, only when the number of columns in AA equals the number of rows in BB — if AA is of order m×nm \times n and BB is of order n×pn \times p, the product ABAB exists and has order m×pm \times p. Each element of the product is found by pairing a row of AA with a column of BB and combining them:

(AB)ij=∑k=1naik bkj(AB)_{ij} = \sum_{k=1}^{n} a_{ik}\,b_{kj}

In words: to get the entry in row ii, column jj of ABAB, multiply each element of row ii of AA with the corresponding element of column jj of BB, and add up the results.

Watch out

Matrix multiplication is generally not commutative — ABAB and BABA can be different matrices, or one might not even be defined while the other is. Always check compatibility of order before multiplying, and never assume AB=BAAB = BA unless you've proved it for the specific matrices at hand. …