Tutorials › Linear Algebra › Distributive Laws For Matrix Products

Matrix Operations and Algebra · Tutorial 68 of 1000

Distributive Laws For Matrix Products

Use the matrix-entry formula to prove and verify distribution over addition on either side of a product.

Beginner 8 min read

What You'll Learn

  • State the size conditions for both distributive laws.
  • Expand product entries using summation notation.
  • Prove each law by matching corresponding entries.
  • Compute examples with square and rectangular matrices.
  • Identify a plausible but invalid distribution calculation.

What Distribution Means for Matrix Products

For real numbers, multiplication distributes over addition. Matrix multiplication has a corresponding rule, but the sizes of the matrices must allow every expression to be formed. There are two versions: addition can occur in the right factor, or in the left factor. The formulas look similar, but their dimensions and the entries being compared are different. We will prove each version by expanding the entry formula for a product.

For \(\mathbf{A}\in\mathbb{R}^{m\times n}\) and \(\mathbf{B}\in\mathbb{R}^{n\times p}\), the product \(\mathbf{A}\mathbf{B}\) is an \(m\times p\) matrix. Its entry in row \(i\), column \(j\) is \(\sum_{k=1}^{n}a_{ik}b_{kj}\). Matrix addition is defined for matrices of the same size, entry by entry. Thus any distributive law must respect both the product size requirements and the requirement that the matrices being added have the same size.

Theorem (Distributive laws for matrix products): Let \(\mathbf{A}\in\mathbb{R}^{m\times n}\), \(\mathbf{B},\mathbf{C}\in\mathbb{R}^{n\times p}\), and \(\mathbf{D}\in\mathbb{R}^{m\times n}\). Then \(\mathbf{A}(\mathbf{B}+\mathbf{C})=\mathbf{A}\mathbf{B}+\mathbf{A}\mathbf{C}\), and \((\mathbf{A}+\mathbf{D})\mathbf{C}=\mathbf{A}\mathbf{C}+\mathbf{D}\mathbf{C}\). The first law distributes a common left factor across a sum in the right factor; the second distributes a sum in the left factor across a common right factor.

Proof by Comparing Entries

The proof relies on equality of matrices being equality of all corresponding entries. We first check that the expressions in each law are defined and have matching sizes. In the first law, \(\mathbf{B}+\mathbf{C}\) is \(n\times p\), so \(\mathbf{A}(\mathbf{B}+\mathbf{C})\) is \(m\times p\). Both \(\mathbf{A}\mathbf{B}\) and \(\mathbf{A}\mathbf{C}\) are also \(m\times p\), and they can be added. For the second law, \(\mathbf{A}+\mathbf{D}\) is \(m\times n\), so \((\mathbf{A}+\mathbf{D})\mathbf{C}\) is \(m\times p\); each product on the right is \(m\times p\) as well.

Proof. For the first law, fix any row index \(i\) with \(1\le i\le m\) and column index \(j\) with \(1\le j\le p\). By the product-entry formula and the definition of matrix addition, the \((i,j)\) entry on the left is

$$ \bigl(\mathbf{A}(\mathbf{B}+\mathbf{C})\bigr)_{ij} =\sum_{k=1}^{n}a_{ik}(b_{kj}+c_{kj}) =\sum_{k=1}^{n}(a_{ik}b_{kj}+a_{ik}c_{kj}). $$

Distributing multiplication over addition for real numbers, then separating the finite sums, gives

$$ \bigl(\mathbf{A}(\mathbf{B}+\mathbf{C})\bigr)_{ij} =\sum_{k=1}^{n}a_{ik}b_{kj} +\sum_{k=1}^{n}a_{ik}c_{kj} =(\mathbf{A}\mathbf{B})_{ij}+(\mathbf{A}\mathbf{C})_{ij}. $$

The last expression is the \((i,j)\) entry of \(\mathbf{A}\mathbf{B}+\mathbf{A}\mathbf{C}\). This equality holds for every permitted \(i\) and \(j\), so the matrices are equal.

For the second law, fix the same kinds of indices \(i\) and \(j\). This time, the entries being added are those of \(\mathbf{A}\) and \(\mathbf{D}\). The product-entry formula gives

$$ \bigl((\mathbf{A}+\mathbf{D})\mathbf{C}\bigr)_{ij} =\sum_{k=1}^{n}(a_{ik}+d_{ik})c_{kj} =\sum_{k=1}^{n}(a_{ik}c_{kj}+d_{ik}c_{kj}). $$

Again using real-number distributivity and separating the sums, we obtain

$$ \bigl((\mathbf{A}+\mathbf{D})\mathbf{C}\bigr)_{ij} =\sum_{k=1}^{n}a_{ik}c_{kj} +\sum_{k=1}^{n}d_{ik}c_{kj} =(\mathbf{A}\mathbf{C})_{ij}+(\mathbf{D}\mathbf{C})_{ij}. $$

This is the \((i,j)\) entry of \(\mathbf{A}\mathbf{C}+\mathbf{D}\mathbf{C}\), and it holds for every row and column index. Therefore the matrices are equal. \(\square\)

These proofs show why the laws hold: the same summation index runs through the matching row and column entries, and scalar multiplication distributes inside each term. The order of the factors is preserved throughout. The first proof has \(a_{ik}\) multiplying each of \(b_{kj}\) and \(c_{kj}\); the second has \(c_{kj}\) multiplying each of \(a_{ik}\) and \(d_{ik}\). Neither proof switches the order of two matrix factors.

Computing Both Sides

Worked Example: Distributing a Left Factor

Verify \(\mathbf{A}(\mathbf{B}+\mathbf{C})=\mathbf{A}\mathbf{B}+\mathbf{A}\mathbf{C}\) for \(\mathbf{A}=\begin{bmatrix}1&2\\0&1\end{bmatrix}\), \(\mathbf{B}=\begin{bmatrix}1&0\\2&1\end{bmatrix}\), and \(\mathbf{C}=\begin{bmatrix}0&1\\1&0\end{bmatrix}\).

All three matrices are \(2\times2\), so the sum and products in the law are defined. First add the right-hand factors:

$$ \mathbf{B}+\mathbf{C} =\begin{bmatrix}1+0&0+1\\2+1&1+0\end{bmatrix} =\begin{bmatrix}1&1\\3&1\end{bmatrix}. $$

Now multiply by \(\mathbf{A}\), showing the row-by-column calculations for all four entries:

$$ \mathbf{A}(\mathbf{B}+\mathbf{C}) =\begin{bmatrix} 1\cdot1+2\cdot3&1\cdot1+2\cdot1\\ 0\cdot1+1\cdot3&0\cdot1+1\cdot1 \end{bmatrix} =\begin{bmatrix}7&3\\3&1\end{bmatrix}. $$

Compute the two products on the other side separately:

$$ \mathbf{A}\mathbf{B} =\begin{bmatrix} 1\cdot1+2\cdot2&1\cdot0+2\cdot1\\ 0\cdot1+1\cdot2&0\cdot0+1\cdot1 \end{bmatrix} =\begin{bmatrix}5&2\\2&1\end{bmatrix}, \qquad \mathbf{A}\mathbf{C} =\begin{bmatrix} 1\cdot0+2\cdot1&1\cdot1+2\cdot0\\ 0\cdot0+1\cdot1&0\cdot1+1\cdot0 \end{bmatrix} =\begin{bmatrix}2&1\\1&0\end{bmatrix}. $$

Adding these results gives \(\mathbf{A}\mathbf{B}+\mathbf{A}\mathbf{C} =\begin{bmatrix}5+2&2+1\\2+1&1+0\end{bmatrix} =\begin{bmatrix}7&3\\3&1\end{bmatrix}\). Check: this equals the directly computed \(\mathbf{A}(\mathbf{B}+\mathbf{C})\), entry by entry.

Worked Example: Distributing a Right Factor

Verify \((\mathbf{A}+\mathbf{D})\mathbf{C}=\mathbf{A}\mathbf{C}+\mathbf{D}\mathbf{C}\) for \(\mathbf{A}=\begin{bmatrix}1&2\\0&1\end{bmatrix}\), \(\mathbf{D}=\begin{bmatrix}2&0\\1&1\end{bmatrix}\), and \(\mathbf{C}=\begin{bmatrix}1&1\\2&0\end{bmatrix}\).

Add the left-hand factors, then multiply the result by \(\mathbf{C}\):

$$ \mathbf{A}+\mathbf{D} =\begin{bmatrix}3&2\\1&2\end{bmatrix}, \qquad (\mathbf{A}+\mathbf{D})\mathbf{C} =\begin{bmatrix} 3\cdot1+2\cdot2&3\cdot1+2\cdot0\\ 1\cdot1+2\cdot2&1\cdot1+2\cdot0 \end{bmatrix} =\begin{bmatrix}7&3\\5&1\end{bmatrix}. $$

For the right side, calculate each product. The entries are

$$ \mathbf{A}\mathbf{C} =\begin{bmatrix} 1\cdot1+2\cdot2&1\cdot1+2\cdot0\\ 0\cdot1+1\cdot2&0\cdot1+1\cdot0 \end{bmatrix} =\begin{bmatrix}5&1\\2&0\end{bmatrix}, $$
$$ \mathbf{D}\mathbf{C} =\begin{bmatrix} 2\cdot1+0\cdot2&2\cdot1+0\cdot0\\ 1\cdot1+1\cdot2&1\cdot1+1\cdot0 \end{bmatrix} =\begin{bmatrix}2&2\\3&1\end{bmatrix}. $$

Therefore \(\mathbf{A}\mathbf{C}+\mathbf{D}\mathbf{C} =\begin{bmatrix}5+2&1+2\\2+3&0+1\end{bmatrix} =\begin{bmatrix}7&3\\5&1\end{bmatrix}\). Check: this matches the entries of \((\mathbf{A}+\mathbf{D})\mathbf{C}\).

The Laws Also Hold for Rectangular Matrices

The dimension conditions do not require square matrices. In particular, a matrix with \(m\) rows and \(n\) columns can multiply a matrix with \(n\) rows and \(p\) columns, producing an \(m\times p\) result. Each of the two distributive laws compares matrices of precisely that output size. The indices in the proof also explain why: \(i\) chooses one of the \(m\) rows, \(j\) one of the \(p\) columns, and \(k\) ranges through the \(n\) matched entries used in the product.

Worked Example: A Rectangular Product

Use the first distributive law with \(\mathbf{A}=\begin{bmatrix}1&0&2\\-1&1&1\end{bmatrix}\), \(\mathbf{B}=\begin{bmatrix}1&2\\0&1\\2&-1\end{bmatrix}\), and \(\mathbf{C}=\begin{bmatrix}0&1\\3&0\\1&2\end{bmatrix}\). Here \(\mathbf{A}\) is \(2\times3\), while \(\mathbf{B}\) and \(\mathbf{C}\) are \(3\times2\), so both sides are \(2\times2\).

First, add the two right-hand factors and multiply:

$$ \mathbf{B}+\mathbf{C} =\begin{bmatrix}1&3\\3&1\\3&1\end{bmatrix}, \qquad \mathbf{A}(\mathbf{B}+\mathbf{C}) =\begin{bmatrix} 1\cdot1+0\cdot3+2\cdot3&1\cdot3+0\cdot1+2\cdot1\\ (-1)\cdot1+1\cdot3+1\cdot3&(-1)\cdot3+1\cdot1+1\cdot1 \end{bmatrix} =\begin{bmatrix}7&5\\5&-1\end{bmatrix}. $$

Next, compute each product separately:

$$ \mathbf{A}\mathbf{B} =\begin{bmatrix} 1\cdot1+0\cdot0+2\cdot2&1\cdot2+0\cdot1+2\cdot(-1)\\ (-1)\cdot1+1\cdot0+1\cdot2&(-1)\cdot2+1\cdot1+1\cdot(-1) \end{bmatrix} =\begin{bmatrix}5&0\\1&-2\end{bmatrix}, $$
$$ \mathbf{A}\mathbf{C} =\begin{bmatrix} 1\cdot0+0\cdot3+2\cdot1&1\cdot1+0\cdot0+2\cdot2\\ (-1)\cdot0+1\cdot3+1\cdot1&(-1)\cdot1+1\cdot0+1\cdot2 \end{bmatrix} =\begin{bmatrix}2&5\\4&1\end{bmatrix}. $$

Adding gives \(\mathbf{A}\mathbf{B}+\mathbf{A}\mathbf{C} =\begin{bmatrix}5+2&0+5\\1+4&-2+1\end{bmatrix} =\begin{bmatrix}7&5\\5&-1\end{bmatrix}\). Check: the result agrees with the direct product \(\mathbf{A}(\mathbf{B}+\mathbf{C})\), including the negative entry in row 2, column 2.

Common Mistake: Changing the Factor That Is Shared

Distribution allows a factor to be shared across the two terms, but the shared factor must stay in its original position. A tempting incorrect statement is \(\mathbf{A}(\mathbf{B}+\mathbf{C})=\mathbf{A}\mathbf{B}+\mathbf{B}\mathbf{C}\). The second term on the right has changed the left factor from \(\mathbf{A}\) to \(\mathbf{B}\); the proved law instead gives \(\mathbf{A}\mathbf{B}+\mathbf{A}\mathbf{C}\).

Here is a concrete calculation showing the error. Let \(\mathbf{A}=\begin{bmatrix}1&2\\0&1\end{bmatrix}\), \(\mathbf{B}=\begin{bmatrix}1&0\\1&1\end{bmatrix}\), and \(\mathbf{C}=\begin{bmatrix}0&1\\2&0\end{bmatrix}\). The left side of the incorrect claim is

$$ \mathbf{B}+\mathbf{C} =\begin{bmatrix}1&1\\3&1\end{bmatrix}, \qquad \mathbf{A}(\mathbf{B}+\mathbf{C}) =\begin{bmatrix}7&3\\3&1\end{bmatrix}. $$

But the proposed right side is \(\mathbf{A}\mathbf{B}+\mathbf{B}\mathbf{C}\). Direct multiplication gives \(\mathbf{A}\mathbf{B}=\begin{bmatrix}3&2\\1&1\end{bmatrix}\) and \(\mathbf{B}\mathbf{C}=\begin{bmatrix}0&1\\2&1\end{bmatrix}\), so

$$ \mathbf{A}\mathbf{B}+\mathbf{B}\mathbf{C} =\begin{bmatrix}3&3\\3&2\end{bmatrix} \ne \begin{bmatrix}7&3\\3&1\end{bmatrix}. $$

The correction is to keep \(\mathbf{A}\) as the common left factor in both terms: \(\mathbf{A}(\mathbf{B}+\mathbf{C})=\mathbf{A}\mathbf{B}+\mathbf{A}\mathbf{C}\). A reliable check is to write down the factor that appears in both summands before multiplying: it must be the same matrix on the same side.

Why the Entry Proof Is Useful

The laws make expressions with sums easier to compute and simplify. If two matrices are added before multiplying, distribution lets us compute two products and then add them; conversely, if the same factor occurs in two products, it can be factored out. The entry proof also supplies a dependable way to check proposed matrix identities: verify that the expressions have compatible sizes, then compare their entries using the product formula.

Do not infer more than the laws state. They justify distributing a single product over a sum in either factor. They do not say that matrix multiplication is commutative, and they do not permit rearranging the order of factors. The formulas preserve order: \(\mathbf{A}\mathbf{B}\) remains \(\mathbf{A}\mathbf{B}\), not \(\mathbf{B}\mathbf{A}\). Always check dimensions before applying a law; an expression that is not defined cannot be made valid by a symbolic rearrangement.

Check Your Understanding

For each question, keep track of the matrix sizes and the order of the factors.

  1. State the size conditions on \(\mathbf{A},\mathbf{B},\mathbf{C}\) that make \(\mathbf{A}(\mathbf{B}+\mathbf{C})=\mathbf{A}\mathbf{B}+\mathbf{A}\mathbf{C}\) valid.
  2. In the proof of the first law, write the \((i,j)\) entry of \(\mathbf{A}(\mathbf{B}+\mathbf{C})\) as a sum, then separate it into two sums.
  3. For \(\mathbf{A}=\begin{bmatrix}1&1\\2&0\end{bmatrix}\), \(\mathbf{B}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\), and \(\mathbf{C}=\begin{bmatrix}0&2\\1&0\end{bmatrix}\), verify the first distributive law by computing both sides.
  4. Explain why \((\mathbf{A}+\mathbf{D})\mathbf{C}\) and \(\mathbf{A}\mathbf{C}+\mathbf{D}\mathbf{C}\) have the same size under the hypotheses of the theorem.
  5. Identify the factor that changes incorrectly in the claim \((\mathbf{A}+\mathbf{D})\mathbf{C}=\mathbf{A}\mathbf{C}+\mathbf{A}\mathbf{D}\).

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon