MML Discourse archived in May, 2026

Transpose of a product

mark

Let's suppose that A is an m\times n matrix and that B is an n\times p matrix.

  • What are the dimensions of (AB)^{\mathsf{T}}?
  • What are the dimensions of B^{\mathsf{T}}A^{\mathsf{T}}?
  • Show that these are, in fact, the same matrices. That is,
(AB)^{\mathsf{T}} = B^{\mathsf{T}}A^{\mathsf{T}}.

Hint: Show that the entry in row i and column j is the same in both matrices.

User 003

The product of an m \times n matrix A and an n \times p matrix B is the m \times p matrix AB. The transpose of this resulting matrix, (AB)^{\mathsf{T}}, would then have dimensions p \times m.

Since A^{\mathsf{T}} is n \times m and B^{\mathsf{T}} is p \times n, the product B^{\mathsf{T}}A^{\mathsf{T}} transpose of an matrix is a p \times m matrix.

So at least we know that the resulting matrices are the same size.

Now an example, which is probably not the most generic way to show that (AB)^{\mathsf{T}} = B^{\mathsf{T}}A^{\mathsf{T}}.

If A = \begin{bmatrix}a & b & c \\ d & e & f\end{bmatrix} and B= \begin{bmatrix}g & h \\ i & j \\ k & l\end{bmatrix} then AB = \begin{bmatrix}(ag+bi+ck) & (ah+bj+cl) \\ (dg+ei+fk) & (dh+ei+fl) \end{bmatrix}

(AB)^{\mathsf{T}} = \begin{bmatrix}(ag+bi+ck) & (dg+ei+fk) \\ (ah+bj+cl) & (dh+ei+fl) \end{bmatrix}

A^{\mathsf{T}} = \begin{bmatrix}a & d \\ b & e \\ c & f \end{bmatrix} and B^{\mathsf{T}} = \begin{bmatrix}g & i & k \\ h & j & l \end{bmatrix} so B^{\mathsf{T}}A^{\mathsf{T}} = \begin{bmatrix}(ag+bi+ck) & (dg+ei+fk) \\ (ah+bj+cl) & (dh+ei+fl) \end{bmatrix}

We can see that (AB)^{\mathsf{T}} and B^{\mathsf{T}}A^{\mathsf{T}} result in the same 2 \times 2 matrix.

User 003

Ok, maybe more generally:
An entry in AB is the dot product of a row of A, \vec{a}_{i} and a column of B, \vec{b}_{j}, so:
(AB)_{ij}=\vec{a}_i \cdot \vec{b}_j
In the transpose of AB, rows and columns swap, so
(AB)^{\mathsf{T}}_{ij}=(AB)_{ji} = \vec{b}_j \cdot \vec{a}_i '''I don't like this line. I'll come back to it.
An entry in the matrix resulting from B^{\mathsf{T}}A^{\mathsf{T}} is the dot product of row j of B^{\mathsf{T}} and column i of A^{\mathsf{T}}, so:
(B^{\mathsf{T}}A^{\mathsf{T}})_{ij}=\vec{b}_j \cdot \vec{a}_i

User 009

Pretty sure this is it:

(AB)^{T} = (Bi)(Aj) \\

if
A = m x n
and
B = n x p
then
(AB)^{T} = p x m
also
B^{T} = p x n
and
A^{T} = n x m
thus
(B^{T}A^{T}) = p x m
finally
(AB)^{T} = (B^{T}A^{T})
as shown by prior math