Tutorials › Linear Algebra › The Transpose Of A Matrix Product

Matrix Operations and Algebra · Tutorial 73 of 1000

The Transpose Of A Matrix Product

Learn why transposing a product reverses its factors, and verify the identity by comparing entries and computing rectangular examples.

Beginner 9 min read

What You'll Learn

  • State the order-reversal identity for a matrix product.
  • Check when the product and its reversed transpose product are defined.
  • Prove the identity by comparing individual entries.
  • Compute and check the identity for rectangular and square matrices.
  • Identify and correct the error of reversing factors without transposing them.

Why the Order Reverses

Transposing a matrix exchanges its rows and columns. For a product, that exchange does not leave the factors in their original order: the transpose of a product \( \mathbf{A}\mathbf{B} \) is \( \mathbf{B}^{\top}\mathbf{A}^{\top} \). The reversal matters because matrix multiplication is not commutative in general. The identity is useful whenever a calculation involves a product and its transpose, and it applies to rectangular matrices as well as square ones.

Let \(\mathbf{A}\in\mathbb{R}^{m\times n}\) and \(\mathbf{B}\in\mathbb{R}^{n\times p}\), so that the product \(\mathbf{A}\mathbf{B}\) is defined and has size \(m\times p\). The transpose \(\mathbf{M}^{\top}\) of a matrix \(\mathbf{M}\) is formed by exchanging rows and columns: its entry in row \(i\), column \(j\) is the entry of \(\mathbf{M}\) in row \(j\), column \(i\). In particular, \(\mathbf{A}^{\top}\) has size \(n\times m\), and \(\mathbf{B}^{\top}\) has size \(p\times n\).

Theorem (Transpose of a product): If \(\mathbf{A}\in\mathbb{R}^{m\times n}\) and \(\mathbf{B}\in\mathbb{R}^{n\times p}\), then \((\mathbf{A}\mathbf{B})^{\top}=\mathbf{B}^{\top}\mathbf{A}^{\top}\). Both sides are \(p\times m\) matrices.

The dimensions allow the reversed product: \(\mathbf{B}^{\top}\) is \(p\times n\), and \(\mathbf{A}^{\top}\) is \(n\times m\), so \(\mathbf{B}^{\top}\mathbf{A}^{\top}\) is \(p\times m\). This matches the size of \((\mathbf{A}\mathbf{B})^{\top}\). The dimension check is important: reversing the factors works because transposing also changes each factor’s dimensions.

Proof by Comparing Entries

The entry formula for matrix multiplication gives each entry of \(\mathbf{A}\mathbf{B}\) as a sum of products. To prove that two matrices are equal, it is enough to show that their entries agree in every row and column. Here the sums match term by term, with the scalar factors in each term exchanged.

Proof. Assume \(\mathbf{A}\in\mathbb{R}^{m\times n}\) and \(\mathbf{B}\in\mathbb{R}^{n\times p}\). We show that the \((i,j)\)-entries of the two \(p\times m\) matrices agree for every \(1\le i\le p\) and \(1\le j\le m\). By the definition of transpose and the entry formula for a product, \(((\mathbf{A}\mathbf{B})^{\top})_{ij}=(\mathbf{A}\mathbf{B})_{ji}=\sum_{k=1}^{n}a_{jk}b_{ki}\). For the product in the reversed order, \((\mathbf{B}^{\top}\mathbf{A}^{\top})_{ij}=\sum_{k=1}^{n}(\mathbf{B}^{\top})_{ik}(\mathbf{A}^{\top})_{kj}=\sum_{k=1}^{n}b_{ki}a_{jk}\). The scalars are real, so \(a_{jk}b_{ki}=b_{ki}a_{jk}\) for each \(k\). The two sums are therefore equal for every \(i,j\). The matrices have the same dimensions and all their corresponding entries agree, so they are equal. \(\square\)

The index positions explain the reversal. An entry of the product uses an entry from a row of \(\mathbf{A}\) and an entry from a column of \(\mathbf{B}\). Transposing the result exchanges the output row and column indices. In the reversed product, those same entries appear in the opposite factor order, while their scalar values can be interchanged inside each term. This entry-by-entry reasoning also shows why the statement is not restricted to square matrices.

Worked Example: A Rectangular Product

Take a \(2\times3\) matrix and a \(3\times2\) matrix. Their product is \(2\times2\), and its transpose should agree with the product of the transposes in reversed order.

$$ \mathbf{A}=\begin{bmatrix}1&2&-1\\0&3&2\end{bmatrix}, \qquad \mathbf{B}=\begin{bmatrix}2&1\\-1&0\\4&2\end{bmatrix}. $$

Compute all four entries of \(\mathbf{A}\mathbf{B}\) by taking row-column products:

$$ \mathbf{A}\mathbf{B} = \begin{bmatrix} 1(2)+2(-1)+(-1)(4)&1(1)+2(0)+(-1)(2)\\ 0(2)+3(-1)+2(4)&0(1)+3(0)+2(2) \end{bmatrix} = \begin{bmatrix}-4&-1\\5&4\end{bmatrix}. $$

Thus \((\mathbf{A}\mathbf{B})^{\top}=\begin{bmatrix}-4&5\\-1&4\end{bmatrix}\). Now transpose each factor and multiply in reversed order. The dimensions are \(2\times3\) times \(3\times2\), so this product is defined and is also \(2\times2\).

$$ \mathbf{B}^{\top}\mathbf{A}^{\top} = \begin{bmatrix}2&-1&4\\1&0&2\end{bmatrix} \begin{bmatrix}1&0\\2&3\\-1&2\end{bmatrix} = \begin{bmatrix} 2(1)+(-1)(2)+4(-1)&2(0)+(-1)(3)+4(2)\\ 1(1)+0(2)+2(-1)&1(0)+0(3)+2(2) \end{bmatrix} = \begin{bmatrix}-4&5\\-1&4\end{bmatrix}. $$

Check: The computed \(\mathbf{A}\mathbf{B}\) is \(\begin{bmatrix}-4&-1\\5&4\end{bmatrix}\), whose transpose is \(\begin{bmatrix}-4&5\\-1&4\end{bmatrix}\). The independently computed \(\mathbf{B}^{\top}\mathbf{A}^{\top}\) has exactly those entries.

Checking Dimensions and the Identity Together

A rectangular example makes the size changes visible. If \(\mathbf{A}\) is \(m\times n\) and \(\mathbf{B}\) is \(n\times p\), then the original product requires the number of columns of \(\mathbf{A}\) to equal the number of rows of \(\mathbf{B}\). After transposing, \(\mathbf{B}^{\top}\) is \(p\times n\) and \(\mathbf{A}^{\top}\) is \(n\times m\). Their inner dimensions still match, and the output dimensions are \(p\times m\). These are exactly the dimensions obtained by transposing the original \(m\times p\) product.

Corollary: Under the hypotheses of the theorem, \(\mathbf{B}^{\top}\mathbf{A}^{\top}\) is defined and has the same dimensions as \((\mathbf{A}\mathbf{B})^{\top}\).

Proof. Since \(\mathbf{B}\) is \(n\times p\), \(\mathbf{B}^{\top}\) is \(p\times n\). Since \(\mathbf{A}\) is \(m\times n\), \(\mathbf{A}^{\top}\) is \(n\times m\). The shared inner dimension \(n\) makes \(\mathbf{B}^{\top}\mathbf{A}^{\top}\) defined, with \(p\) rows and \(m\) columns. The product \(\mathbf{A}\mathbf{B}\) has \(m\) rows and \(p\) columns, so its transpose has \(p\) rows and \(m\) columns as well. \(\square\)

Worked Example: A Product with Three Rows

Let \(\mathbf{A}\) be \(3\times1\) and \(\mathbf{B}\) be \(1\times2\). The original product has size \(3\times2\), while \(\mathbf{B}^{\top}\mathbf{A}^{\top}\) has size \(2\times3\).

$$ \mathbf{A}=\begin{bmatrix}1\\-2\\3\end{bmatrix}, \qquad \mathbf{B}=\begin{bmatrix}4&-1\end{bmatrix}. $$

Because \(\mathbf{B}\) has one row, each row of the product is the corresponding entry of \(\mathbf{A}\) multiplied by that row of \(\mathbf{B}\):

$$ \mathbf{A}\mathbf{B} = \begin{bmatrix} 1(4)&1(-1)\\ (-2)(4)&(-2)(-1)\\ 3(4)&3(-1) \end{bmatrix} = \begin{bmatrix}4&-1\\-8&2\\12&-3\end{bmatrix}, \qquad (\mathbf{A}\mathbf{B})^{\top} = \begin{bmatrix}4&-8&12\\-1&2&-3\end{bmatrix}. $$

Now \(\mathbf{B}^{\top}\) is \(2\times1\) and \(\mathbf{A}^{\top}\) is \(1\times3\). Multiplying gives:

$$ \mathbf{B}^{\top}\mathbf{A}^{\top} = \begin{bmatrix}4\\-1\end{bmatrix} \begin{bmatrix}1&-2&3\end{bmatrix} = \begin{bmatrix} 4(1)&4(-2)&4(3)\\ (-1)(1)&(-1)(-2)&(-1)(3) \end{bmatrix} = \begin{bmatrix}4&-8&12\\-1&2&-3\end{bmatrix}. $$

Check: Transposing the displayed \(3\times2\) product exchanges its rows and columns, giving the same \(2\times3\) matrix as the reversed product. This also confirms the dimension prediction.

Square Matrices and a Common Mistake

When both factors are square matrices of the same size, all the products in the identity are dimensionally defined. That can make it tempting to think the order reversal is optional. It is not: the transpose of \(\mathbf{A}\mathbf{B}\) is \(\mathbf{B}^{\top}\mathbf{A}^{\top}\), not generally \(\mathbf{A}^{\top}\mathbf{B}^{\top}\). The factors must be reversed as well as transposed.

Worked Example: A Square Product

Use the matrices below to check the identity and see why the order of the factors matters.

$$ \mathbf{A}=\begin{bmatrix}1&2\\0&1\end{bmatrix}, \qquad \mathbf{B}=\begin{bmatrix}1&0\\3&1\end{bmatrix}. $$

First compute the original product and transpose it:

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

The transposes, multiplied in reversed order, give:

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

Check: The result agrees entry by entry with \((\mathbf{A}\mathbf{B})^{\top}\). For contrast, keeping the transposed factors in the original order gives \(\mathbf{A}^{\top}\mathbf{B}^{\top}=\begin{bmatrix}1&3\\2&7\end{bmatrix}\), which does not equal \(\begin{bmatrix}7&3\\2&1\end{bmatrix}\).

Common mistake: reversing without transposing. A wrong calculation might claim \((\mathbf{A}\mathbf{B})^{\top}=\mathbf{B}\mathbf{A}\). For the square example, \(\mathbf{B}\mathbf{A}=\begin{bmatrix}1&2\\3&7\end{bmatrix}\), whereas \((\mathbf{A}\mathbf{B})^{\top}=\begin{bmatrix}7&3\\2&1\end{bmatrix}\). The entries disagree. The correction is to transpose each factor as well as reverse their order: \((\mathbf{A}\mathbf{B})^{\top}=\mathbf{B}^{\top}\mathbf{A}^{\top}\).

How to Apply the Identity Reliably

For a product with two factors, a reliable check has three parts. First, confirm that the original product is defined. Second, transpose each factor and reverse the order, then check that the new product is defined. Third, keep track of the output dimensions before comparing entries. If the original factors have sizes \(m\times n\) and \(n\times p\), both resulting matrices must have size \(p\times m\). A dimension mismatch usually signals that the factors were not reversed correctly.

The identity is about the transpose of the entire product. It does not assert that the product equals its own transpose, or that \(\mathbf{A}\mathbf{B}=\mathbf{B}\mathbf{A}\). Those are different claims and do not follow from this rule. The examples show the useful distinction: transposing changes the entries’ positions, and the matrix product formula makes reversing the factors exactly the order that produces those positions.

Check Your Understanding

For each question, use the dimensions and the entry formula to justify your conclusion.

  1. If \(\mathbf{A}\) is \(4\times2\) and \(\mathbf{B}\) is \(2\times3\), what are the dimensions of \(\mathbf{A}\mathbf{B}\), \((\mathbf{A}\mathbf{B})^{\top}\), and \(\mathbf{B}^{\top}\mathbf{A}^{\top}\)?
  2. For \(\mathbf{A}=\begin{bmatrix}1&-1\\2&0\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}3&2\\1&-1\end{bmatrix}\), compute both sides of the transpose-of-a-product identity.
  3. Write the \((i,j)\)-entry of \((\mathbf{A}\mathbf{B})^{\top}\) as a sum involving \(a_{jk}\) and \(b_{ki}\).
  4. Why is \(\mathbf{B}^{\top}\mathbf{A}^{\top}\) defined whenever \(\mathbf{A}\mathbf{B}\) is defined?
  5. Give a reason that \((\mathbf{A}\mathbf{B})^{\top}\) is not generally equal to \(\mathbf{A}^{\top}\mathbf{B}^{\top}\).

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