Matrix Multiplication and Dot Products
Matrix multiplication combines two matrices by taking dot products of rows with columns. For matrices (size ) and (size ), the product is an matrix whose entry is the dot product of row of with column of . Where it applies: linear systems, geometric transformations, computer graphics, statistics, machine learning. Who/when: formalized by Arthur Cayley (1858), building on work by Jacques Binet and Gotthold Eisenstein.
A matrix is a machine that transforms vectors. Multiplying matrices means chaining machines together. Each entry of the product is a dot product — a measure of how much one row "agrees" with one column. The dot product is the atom; matrix multiplication is the molecule built from many such atoms arranged in rows and columns.
Formal Statement
Given two vectors of the same length ,
Derivation hint: A vector is just an ordered list of numbers; both must have the same number of components for the dot product to be defined. their dot product (or scalar product) is the single number
Derivation hint: Multiply each pair of matching entries, then add all the products together — the result is a scalar, not a vector. A second, geometric formula relates the dot product to lengths and the angle between the vectors:
Derivation hint: Apply the Law of Cosines to the triangle formed by , , and , then expand using equation [2]. where is the length (magnitude) of .
Let be an matrix with entries and an matrix with entries . The product is the matrix whose entries are
Derivation hint: The entry in row , column of the product is the dot product of row of with column of — sum over the shared index .
Symbols:
- = number of rows of (and of ).
- = number of columns of = number of rows of (the inner dimension, which must match).
- = number of columns of (and of ).
- = entry of in row , column .
- = entry of in row , column .
- = entry of the product in row , column .
The product is defined if and only if the number of columns of equals the number of rows of . In that case:
Derivation hint: The inner dimensions ( and ) must cancel; the outer dimensions ( and ) survive as the result's size.
Why It Holds / Derivation
Matrix multiplication is defined the way it is so that applying transformation , then transformation , equals applying the single matrix .
Step 1. Treat a matrix () as a function that sends a vector (length ) to a new vector (length ), where each component is a dot product:
Derivation hint: This is just equation [4] specialized to the case where the second factor is a single column ().
Step 2. Now apply matrix () to , producing :
Derivation hint: Same dot-product rule, now applied to the intermediate vector .
Step 3. Substitute equation [6] into equation [7]:
Derivation hint: Swap the order of summation (a finite sum lets you do this freely), then group the inner sum.
Step 4. The bracketed quantity is exactly from equation [4]. Therefore , proving that the matrix product encodes the composition of the two transformations.
∎A British mathematician and trained lawyer, Cayley published A Memoir on the Theory of Matrices (1858), giving the first abstract treatment of matrices as objects in their own right. He defined matrix addition, multiplication, and the identity, and noted that matrix multiplication is non-commutative — a radical departure from ordinary arithmetic. Cayley also stated (and verified in small cases) what is now the Cayley–Hamilton theorem. Remarkably prolific, he produced nearly 1,000 papers, many while practicing law for 14 years before becoming Sadleirian Professor at Cambridge.
Building Intuition
Think of the dot product as a similarity score: when two vectors point in the same direction, and the dot product is large and positive; when perpendicular, and the dot product is exactly zero; when opposite, it is negative. This is why orthogonality (perpendicularity) and "zero dot product" mean the same thing. For matrix multiplication, picture as a stack of row-detectors and as a set of column-inputs. Entry measures how strongly row responds to column . Another lens: each column of is a combination of the columns of , weighted by a column of . The matrix tells you how to mix the columns of .
Physicists meet the dot product as work: , the force times the distance in the direction of motion. Only the component of force aligned with displacement does work, which is exactly what captures. Push perpendicular to motion and you do zero work — the dot product is zero. This single idea reappears as power (), magnetic flux, and the projection of one quantity onto another throughout mechanics and electromagnetism.
Worked Examples
Given: and .
Step 1 — Algebraic formula (eq. [2]):
Step 2 — Interpret. A zero dot product means the vectors are perpendicular.
Step 3 — Verify with the geometric formula (eq. [3]). Both lengths are , so
Given:
Step 1 — Check sizes. is , is ; inner dimensions match, so is .
Step 2 — Compute each entry as a dot product (eq. [4]):
Step 3 — Confirm non-commutativity. Computing instead gives . The order genuinely matters.
Common Misconceptions
Matrix multiplication is NOT element-wise. Beginners often try to multiply matching entries: . That element-wise operation (the Hadamard product) is a different, less common thing. The real product uses rows times columns and a sum, per equation [4].
Order matters. In general . Sometimes only one of the two products even exists, because dimensions must line up. Never silently swap factors.
The identity is not "all ones." The multiplicative identity is the matrix with 1's on the diagonal and 0's elsewhere, satisfying . A matrix of all ones does something entirely different.
Claim (false): "If (the zero matrix), then or ." With ordinary numbers this is true, but matrices break it. Take
Then
yet neither nor is the zero matrix. Matrices can have zero divisors, so you cannot "cancel" factors the way you do with real numbers.
Connections
The dot product is the seed of Vector Spaces: lengths, angles, and orthogonality are all defined through it, generalizing to the abstract inner product. Matrix multiplication realizes Linear Transformations concretely — every linear map between finite spaces is "a matrix," and composing maps is multiplying matrices. Solving Systems of Linear Equations is written compactly as , and the search for leads to the Matrix Inverse and the Determinant. The geometric side connects to Trigonometry through the formula in equation [3].
Real-World Applications
Historical Development
Subtleties & Limits
How fast can two matrices be multiplied? The schoolbook method for matrices costs about multiplications. Strassen (1969) lowered the exponent to , and successive breakthroughs have pushed it down — the current record exponent sits around (as of the early 2020s). The deep open question is whether , meaning matrices could be multiplied in essentially the time it takes just to read them. No one knows; the best lower bound is only slightly above , leaving a wide, famous gap that drives ongoing research in theoretical computer science.
See Also
Vectors and Scalars · Linear Transformations · Determinant · Matrix Inverse · Systems of Linear Equations · Eigenvalues and Eigenvectors · Cross Product