The Columns of a Product
Matrix multiplication can be read one column at a time. When \(\mathbf{A}\mathbf{B}\) is defined, each column of the product is built from the columns of \(\mathbf{A}\). The coefficients for that combination are not chosen from a row of \(\mathbf{B}\): they come, in order, from the corresponding column of \(\mathbf{B}\). This gives a direct way to interpret a product and to check its columns.
Suppose \(\mathbf{A}\) has \(m\) rows and \(n\) columns, and \(\mathbf{B}\) has \(n\) rows and \(p\) columns. The shared dimension \(n\) means the product \(\mathbf{A}\mathbf{B}\) is defined, and the product has size \(m\times p\). Write the columns of \(\mathbf{A}\) as \(\mathbf{a}_1,\dots,\mathbf{a}_n\), and write the \(j\)th column of \(\mathbf{B}\) as \(\mathbf{b}_j\). The entries of \(\mathbf{b}_j\) are \(b_{1j},\dots,b_{nj}\), so it is the column vector \((b_{1j},\dots,b_{nj})^{\top}\).
Proof. Fix a column index \(j\) with \(1\le j\le p\). For each row index \(i\) with \(1\le i\le m\), the entry in row \(i\), column \(j\) of the product is \(\sum_{k=1}^{n}a_{ik}b_{kj}\), by the entry formula for matrix multiplication. The \(i\)th entry of \(b_{1j}\mathbf{a}_1+\cdots+b_{nj}\mathbf{a}_n\) is also \(\sum_{k=1}^{n}b_{kj}a_{ik}\), because the \(i\)th entry of \(\mathbf{a}_k\) is \(a_{ik}\). These sums are equal term by term. Thus every entry of column \(j\) of \(\mathbf{A}\mathbf{B}\) equals the corresponding entry of that linear combination, so the columns are equal. Also, by the definition of the matrix-vector product, \(\mathbf{A}\mathbf{b}_j=b_{1j}\mathbf{a}_1+\cdots+b_{nj}\mathbf{a}_n\). This proves both displayed equalities for every \(j\). \(\square\)
The formula specifies a simple matching rule: use column \(j\) of \(\mathbf{B}\) to form column \(j\) of the product. Its first entry weights \(\mathbf{a}_1\), its second entry weights \(\mathbf{a}_2\), and so on. The order is important: coefficient \(b_{kj}\) always multiplies column \(k\) of \(\mathbf{A}\). Since there are \(p\) columns in \(\mathbf{B}\), the formula produces \(p\) columns in the product.
Reading the Formula in a Worked Product
Worked Example: Two Matrices with Three Product Columns
Let \(\mathbf{A}\in\mathbb{R}^{3\times2}\) and \(\mathbf{B}\in\mathbb{R}^{2\times3}\) be
The columns of \(\mathbf{A}\) are \(\mathbf{a}_1=(1,0,3)^{\top}\) and \(\mathbf{a}_2=(2,-1,1)^{\top}\). The columns of \(\mathbf{B}\) are \((2,1)^{\top}\), \((0,4)^{\top}\), and \((-1,2)^{\top}\). Apply the formula separately to each one:
Putting these columns next to one another gives
Check: Directly using the entry formula, the first row of the product is \((1\cdot2+2\cdot1,\;1\cdot0+2\cdot4,\;1\cdot(-1)+2\cdot2)=(4,8,3)\). The second row is \((0\cdot2+(-1)\cdot1,\;0\cdot0+(-1)\cdot4,\;0\cdot(-1)+(-1)\cdot2)=(-1,-4,-2)\). The third row is \((3\cdot2+1\cdot1,\;3\cdot0+1\cdot4,\;3\cdot(-1)+1\cdot2)=(7,4,-1)\). These rows give the same product matrix.
The check also illustrates why each linear combination has two terms in this example: \(\mathbf{A}\) has two columns, so each coefficient column from \(\mathbf{B}\) has two entries. In general, the number of terms in the combination is the number of columns of \(\mathbf{A}\), which must equal the number of entries in each column of \(\mathbf{B}\) for the product to be defined.
Worked Example: A Product with Three Columns in the Left Factor
Let
Write the columns of \(\mathbf{A}\) as \(\mathbf{a}_1=(1,0)^{\top}\), \(\mathbf{a}_2=(2,1)^{\top}\), and \(\mathbf{a}_3=(-1,2)^{\top}\). Column 1 of \(\mathbf{B}\) is \((1,0,2)^{\top}\), so it gives the combination
Column 2 of \(\mathbf{B}\) is \((2,-1,1)^{\top}\), so
Therefore, \(\mathbf{A}\mathbf{B}=\begin{bmatrix}-1&-1\\4&1\end{bmatrix}\). Check: multiplying the first row of \(\mathbf{A}\) by the columns of \(\mathbf{B}\) gives \((1\cdot1+2\cdot0+(-1)\cdot2,\;1\cdot2+2\cdot(-1)+(-1)\cdot1)=(-1,-1)\). The second row gives \((0\cdot1+1\cdot0+2\cdot2,\;0\cdot2+1\cdot(-1)+2\cdot1)=(4,1)\), confirming both columns.
What the Product’s Column Space Can Contain
The span of a list of vectors is the set of all their linear combinations. The column space of a matrix is the span of its columns. Thus \(\operatorname{Col}\mathbf{A}=\operatorname{span}\{\mathbf{a}_1,\dots,\mathbf{a}_n\}\), and \(\operatorname{Col}(\mathbf{A}\mathbf{B})\) is the span of the columns of the product. The column formula gives an immediate relationship between these two spaces.
Proof. Let \(\mathbf{y}\) be any vector in \(\operatorname{Col}(\mathbf{A}\mathbf{B})\). By the definition of column space, \(\mathbf{y}\) is a linear combination of the columns of \(\mathbf{A}\mathbf{B}\). Each such column, by the columns-of-a-product formula, is itself a linear combination of the columns of \(\mathbf{A}\). Substituting those combinations into the expression for \(\mathbf{y}\) expresses \(\mathbf{y}\) as a linear combination of the columns of \(\mathbf{A}\). Therefore \(\mathbf{y}\in\operatorname{Col}\mathbf{A}\). Since this holds for every \(\mathbf{y}\in\operatorname{Col}(\mathbf{A}\mathbf{B})\), the stated inclusion follows. \(\square\)
This inclusion says that multiplying on the right can produce columns only from within the column space already available from \(\mathbf{A}\). It does not say that the two column spaces must be equal. For equality, the combinations selected by the columns of \(\mathbf{B}\) would need to generate all of \(\operatorname{Col}\mathbf{A}\); the product formula by itself guarantees only that the product columns stay within that space.
Worked Example: Nonzero Coefficients Can Give a Zero Column
Consider the matrices
The columns of \(\mathbf{A}\) are \(\mathbf{a}_1=(1,0)^{\top}\) and \(\mathbf{a}_2=(2,0)^{\top}\). The first column of \(\mathbf{B}\) gives \(-2\mathbf{a}_1+\mathbf{a}_2=(-2,0)^{\top}+(2,0)^{\top}=\mathbf{0}\). The second gives \(2\mathbf{a}_1-\mathbf{a}_2=(2,0)^{\top}-(2,0)^{\top}=\mathbf{0}\). Hence
Check: direct multiplication gives first row \((1\cdot(-2)+2\cdot1,\;1\cdot2+2\cdot(-1))=(0,0)\), and second row \((0,0)\). Although both coefficient columns of \(\mathbf{B}\) are nonzero, their combinations of the columns of \(\mathbf{A}\) cancel. Here \(\operatorname{Col}(\mathbf{A}\mathbf{B})=\{\mathbf{0}\}\), while \(\operatorname{Col}\mathbf{A}=\operatorname{span}\{(1,0)^{\top}\}\), so the inclusion can be strict.
A Useful Zero-Column Test
The same formula gives a precise way to decide whether a particular product column is zero. For this statement, the null space of \(\mathbf{A}\), written \(\operatorname{Nul}\mathbf{A}\), means the set of vectors \(\mathbf{x}\) satisfying \(\mathbf{A}\mathbf{x}=\mathbf{0}\). It records coefficient vectors whose combinations of the columns of \(\mathbf{A}\) cancel completely.
Proof. Denote column \(j\) of \(\mathbf{B}\) by \(\mathbf{b}_j\). The columns-of-a-product formula states that column \(j\) of \(\mathbf{A}\mathbf{B}\) is \(\mathbf{A}\mathbf{b}_j\). If that product column is \(\mathbf{0}\), then \(\mathbf{A}\mathbf{b}_j=\mathbf{0}\), which is exactly the definition of \(\mathbf{b}_j\in\operatorname{Nul}\mathbf{A}\). Conversely, if \(\mathbf{b}_j\in\operatorname{Nul}\mathbf{A}\), then the definition gives \(\mathbf{A}\mathbf{b}_j=\mathbf{0}\), so column \(j\) of \(\mathbf{A}\mathbf{B}\) is zero. Both implications hold, proving the equivalence. \(\square\)
In the preceding example, the two coefficient columns \((-2,1)^{\top}\) and \((2,-1)^{\top}\) lie in \(\operatorname{Nul}\mathbf{A}\): multiplying either by \(\mathbf{A}\) gives \(\mathbf{0}\). The test is not a claim that the coefficient column itself must be zero. It is the result of applying \(\mathbf{A}\) to that column that determines whether the product column vanishes.
Common Pitfall: Using a Row for the Coefficients
A frequent indexing error is to take the coefficients from a row of \(\mathbf{B}\) rather than from its corresponding column. Return to the first worked example. The correct coefficients for product column 1 are the entries \(2\) and \(1\) in column 1 of \(\mathbf{B}\), so the answer is \(2\mathbf{a}_1+\mathbf{a}_2=(4,-1,7)^{\top}\). A wrong calculation might take the first row of \(\mathbf{B}\), whose entries are \(2,0,-1\), and use the first two of them as coefficients. That would give \(2\mathbf{a}_1+0\mathbf{a}_2=(2,0,6)^{\top}\), which is not column 1 of the product. The correction is to identify the desired product column first, then read the coefficient entries down the matching column of \(\mathbf{B}\).
Before computing, check the sizes: if \(\mathbf{A}\) has \(n\) columns, then \(\mathbf{B}\) must have \(n\) rows. Then keep the column labels visible and use this sequence:
- Choose product column \(j\).
- Read column \(j\) of \(\mathbf{B}\) as the coefficient vector.
- Use those entries, in order, to weight the columns of \(\mathbf{A}\).
- Check the resulting vector against column \(j\) from direct matrix multiplication.
Each step follows from the product’s dimensions and the column formula. Together, they make it possible to interpret a product column without losing track of where its coefficients come from.
Check Your Understanding
For each question, identify the relevant coefficient column before carrying out any matrix multiplication.
- If \(\mathbf{A}\) has \(4\) columns and \(\mathbf{B}\) has \(3\) columns, how many entries are in each column of \(\mathbf{B}\), and how many columns does \(\mathbf{A}\mathbf{B}\) have?
- Suppose the columns of \(\mathbf{A}\) are \(\mathbf{a}_1,\mathbf{a}_2,\mathbf{a}_3\), and column 2 of \(\mathbf{B}\) is \((1,-2,0)^{\top}\). Write column 2 of \(\mathbf{A}\mathbf{B}\) as a linear combination.
- Let \(\mathbf{a}_1=(1,2)^{\top}\), \(\mathbf{a}_2=(3,0)^{\top}\), and let column 1 of \(\mathbf{B}\) be \((2,-1)^{\top}\). Find column 1 of \(\mathbf{A}\mathbf{B}\).
- Why must \(\operatorname{Col}(\mathbf{A}\mathbf{B})\subseteq\operatorname{Col}\mathbf{A}\)? State the fact about individual product columns that justifies your answer.
- What condition on column \(j\) of \(\mathbf{B}\) is equivalent to column \(j\) of \(\mathbf{A}\mathbf{B}\) being zero?