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.The dot product takes two vectors of equal length and returns a single number: multiply corresponding entries and add. Matrix multiplication generalizes this by arranging many dot products into a grid. Given of size and of size , their product exists only when the inner dimensions match (), and the result has size . This operation matters because it encodes the composition of linear transformations — applying one transformation after another corresponds to multiplying their matrices. The surprising fact: matrix multiplication is not commutative; and are usually different, and one may not even exist while the other does.
The Core Insight
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
Dot Product
Given two vectors of the same length ,
their dot product (or scalar product) is the single number
A second, geometric formula relates the dot product to lengths and the angle between the vectors:
where is the length (magnitude) of .
Matrix Multiplication
Let be an matrix with entries and an matrix with entries . The product is the matrix whose entries are
- = 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 .
Compatibility and Size Rule
The product is defined if and only if the number of columns of equals the number of rows of . In that case:
Computing one entry of a matrix product as a row–column dot product
Why It Holds / Derivation
Why Matrix Multiplication Composes Transformations
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:Arthur Cayley | 1821–1895
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 .
The Dot Product in Physics
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
Dot Product with a Geometric Check
Given: and . Step 1 — Algebraic formula (eq. [2]):A 2×2 Matrix Product
Given: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. TakeConnections
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
- Computer graphics & games. Rotating, scaling, and translating 3D models is done by multiplying transformation matrices; the GPU performs millions of such products per frame.
- Google's PageRank. The web's link structure is a giant matrix, and repeatedly multiplying it by a vector ranks pages by importance.
- Machine learning / neural networks. Each layer of a network multiplies the input vector by a weight matrix; training adjusts those matrices.
- Economics — Leontief input–output models. A matrix describes how industries consume each other's output; solving predicts production needs.
- Cryptography (Hill cipher). Messages are encoded as vectors and encrypted by multiplying with a key matrix; decryption uses its inverse.
- Robotics. Chaining joint rotations (forward kinematics) multiplies a sequence of transformation matrices to locate a robot's hand.
- Statistics. The normal equations for least-squares regression are built entirely from matrix products and dot products.
Historical Development
- 1748 — Gabriel Cramer publishes Cramer's Rule using determinant-like arrays to solve linear systems.
- 1812 — Jacques Binet and Augustin-Louis Cauchy independently study products of rectangular arrays (the Binet–Cauchy identity).
- 1844 — Hermann Grassmann develops a general theory of "extensive quantities," anticipating vectors and bilinear products.
- 1850 — James Joseph Sylvester coins the word "matrix" (Latin for womb) for a rectangular array from which determinants are born.
- 1858 — Arthur Cayley's Memoir on the Theory of Matrices gives the first systematic algebra of matrices, defining multiplication and noting non-commutativity.
- 1881 — J. Willard Gibbs and Oliver Heaviside formalize vector notation, popularizing the dot product in physics and engineering.
- 1888 — Giuseppe Peano gives an axiomatic definition of a vector space, setting the abstract stage for these operations.
- 1969 — Volker Strassen shocks the field by showing matrix multiplication can be done faster than the obvious operations, opening the study of its true complexity.