Matrix Multiplication (Precalculus)
Matrix multiplication is one of the most powerful and surprising operations in linear algebra. Unlike ordinary multiplication of numbers, multiplying two matrices is not simply multiplying corresponding entries together — instead, it involves a systematic process of combining rows of the first matrix with columns of the second. This seemingly complex rule turns out to encode transformations of space, systems of equations, and countless real-world processes all at once. Two matrices can only be multiplied together when their dimensions are compatible: if matrix A has dimensions m×n (m rows and n columns) and matrix B has dimensions n×p (n rows and p columns), then the product AB exists and has dimensions m×p. Notice that the inner dimensions must match — both equal to n — while the outer dimensions m and p give the size of the result. If the inner dimensions do not match, the product is undefined. Matrix multiplication appears throughout science, engineering, computer graphics, economics, and data science. Rotating a 3D object in a video game, solving a network of electrical circuits, or performing a Google search all rely on matrix multiplication under the hood. Mastering this operation opens the door to understanding how mathematics describes transformation and structure in the world.
- Check Compatibility
- Understand the Dot Product Rule
- Compute Entry by Entry
- Remember Non-Commutativity
- Identity and Zero Matrices
Check Compatibility
Before multiplying, confirm the dimensions are compatible. For A (m×n) and B (n×p), the number of columns of A must equal the number of rows of B. If A is 2×3 and B is 3×4, then AB is defined and will be 2×4. If A is 2×3 and B is 2×3, then AB is undefined because 3 ≠ 2.
Understand the Dot Product Rule
Each entry (i, j) of the product matrix AB is computed as the dot product of row i of A with column j of B. Specifically, if A has entries a_{ik} and B has entries b_{kj}, then (AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + ... + a_{in}b_{nj} = Σ_{k=1}^{n} a_{ik} b_{kj}. You multiply corresponding entries across the row of A and down the column of B, then add all those products.
Compute Entry by Entry
Work systematically: to fill row 1 of AB, use row 1 of A with each column of B in turn. For entry (1,1): use row 1 of A and column 1 of B. For entry (1,2): use row 1 of A and column 2 of B. Then move to row 2 of A to fill row 2 of AB, and so on until all m×p entries are computed.
Remember Non-Commutativity
Unlike regular numbers, AB ≠ BA in general — matrix multiplication is NOT commutative. Even when both products are defined (e.g., both A and B are 2×2), the results are usually different matrices. This is one of the most important differences between matrix arithmetic and ordinary arithmetic. However, matrix multiplication IS associative: (AB)C = A(BC), which allows us to regroup multiplications freely.
Identity and Zero Matrices
The identity matrix I (with 1s on the diagonal and 0s elsewhere) acts like the number 1: for any compatible matrix A, we have AI = IA = A. The zero matrix O (all entries 0) acts like 0: AO = OA = O. These special matrices are useful benchmarks when checking computations and understanding matrix algebra.
The Key Equation
- (AB)_{ij} — Product entry (none): The scalar value in the i-th row and j-th column of the resulting product matrix AB.
- a_{ik} — Entry of A (none): The element in row i and column k of matrix A.
- b_{kj} — Entry of B (none): The element in row k and column j of matrix B.
- n — Inner dimension (none): The shared dimension — the number of columns in A and the number of rows in B — over which the summation runs.
- k — Summation index (none): The running index from 1 to n used to pair each column entry of row i in A with the corresponding row entry of column j in B.
Worked Example
Problem. Let A = [[2, 1, 0], [3, -1, 4]] (a 2×3 matrix) and B = [[1, 2], [0, -1], [3, 1]] (a 3×2 matrix). Compute the product AB.
Answer. AB is the 2×2 matrix with rows [2, 3] and [15, 11].
Origins · 1 minArthur Cayley and how this was discovered
Arthur Cayley was the first mathematician to formally define matrix multiplication and to develop the theory of matrices as a coherent algebraic system. In his landmark 1858 paper 'A Memoir on the Theory of Matrices,' he introduced the notation and rules for matrix operations — including the non-commutative multiplication rule — and proved the Cayley-Hamilton theorem, which states that every square matrix satisfies its own characteristic equation. His work transformed matrices from a notational convenience into a powerful mathematical object with its own rich structure. Cayley was a lawyer by profession for 14 years while simultaneously producing hundreds of mathematical research papers before finally becoming a mathematics professor at Cambridge at the age of 42. He published nearly 1000 mathematical papers over his lifetime.
Related Concepts
- Matrix Addition and Scalar Multiplication — Matrix addition and scalar multiplication are the simpler matrix operations that build the algebraic foundation needed before learning the more complex matrix multiplication rule.
- Matrix Dimensions and Types — Understanding rows, columns, and matrix dimensions is essential because matrix multiplication is only defined when inner dimensions match, making dimension analysis a critical first step.
- Determinant of a Matrix — The determinant is a key scalar quantity derived from a square matrix and is deeply connected to invertibility, which itself relies on the concept of the identity matrix and matrix products.
- Systems of Linear Equations — A system of linear equations can be written compactly as the matrix equation Ax = b, making matrix multiplication the bridge between matrix algebra and solving real equation systems.
- Linear Transformations — Matrix multiplication is precisely the tool that represents linear transformations: multiplying a matrix by a vector applies a rotation, reflection, or scaling, connecting abstract algebra to geometry.