The formula
(A × B)ᵢⱼ = Σ Aᵢₖ × Bₖⱼ
What it means
Each element of the product is a row of A paired with a column of B: multiply term by term and add. That is why the number of columns in A has to equal the number of rows in B — otherwise the pairing runs out.
How to do it by hand
- Check the columns of A match the rows of B
- The result is as tall as A and as wide as B
- For each position, take that row of A and that column of B
- Multiply term by term and add the products
What is worth knowing
Matrix multiplication is not commutative, and that is not a quirk — it is the whole point. A matrix represents a transformation, and rotating then stretching is genuinely different from stretching then rotating. Sometimes B × A is not even defined: a 2×3 times a 3×4 works, and the reverse does not. The definition looks arbitrary until you see that it is exactly what makes the product represent 'apply B, then apply A', which is what makes matrices useful for graphics, physics and everything downstream.