Comprehensive Guide on Transpose of Matrices
Start your free 7-days trial now!
Transpose of a matrix
The transpose of a matrix $\boldsymbol{A}$, denoted as $\boldsymbol{A}^T$, is a matrix obtained by swapping the rows and the columns of $\boldsymbol{A}$. This means that:
the first row of $\boldsymbol{A}$ becomes the first column of $\boldsymbol{A}^T$.
the second row of $\boldsymbol{A}$ becomes the second column of $\boldsymbol{A}^T$.
and so on.
Mathematically, if $\boldsymbol{A}$ is an $m\times{n}$ matrix with entries $a_{ij}$, then the transpose of $\boldsymbol{A}^T$ is an $n\times{m}$ matrix with entries $a_{ji}$. In other words, the entry located at the $i$-th row $j$-th column in $\boldsymbol{A}$ will be located at the $j$-th row $i$-th column in $\boldsymbol{A}^T$.
Finding the transpose of matrices
Find the transpose of the following matrices:
Solution. The transpose of these matrices is:
Notice how taking the transpose affects the shape of the matrices:
a $2\times2$ matrix remains a $2\times2$ matrix.
a $3\times2$ matrix becomes a $2\times3$ matrix.
a $3\times3$ matrix remains a $3\times3$ matrix.
In general, if $\boldsymbol{A}$ is an $m\times{n}$ matrix, then $\boldsymbol{A}^T$ will be an $n\times{m}$ matrix. Let's also understand the mathematical definition of the matrix transpose. Observe what happens to the entry $a_{21}=3$ in $\boldsymbol{A}$ after taking the transpose. Since the rows and columns are swapped, this entry is located at $a_{12}$ in $\boldsymbol{A}^T$.
Shape of a matrix after taking its transpose
Suppose we take the transpose of a matrix $\boldsymbol{A}$ with $2$ rows and $3$ columns. What would the shape of $\boldsymbol{A}^T$ be?
Solution. Since we are swapping the rows and columns, the transpose of $\boldsymbol{A}$ would have $3$ rows and $2$ columns, that is, $\boldsymbol{A}^T\in\mathbb{R}^{3\times2}$.
Properties of matrix transpose
Transpose of a matrix transpose
Taking the transpose of a matrix transpose results in the matrix itself:
Proof. By definition, $\boldsymbol{A}^T$ is obtained by swapping the rows and columns of $\boldsymbol{A}$. Taking the transpose of $\boldsymbol{A}^T$ will swap back the rows and columns and so we end up with the original matrix $\boldsymbol{A}$.
To be more mathematically precise, suppose $\boldsymbol{A}$ is as follows:
The transpose of $\boldsymbol{A}$ is:
The transpose of $\boldsymbol{A}^T$ is:
This completes the proof.
Transpose of A+B
If $\boldsymbol{A}$ and $\boldsymbol{B}$ are matrices, then:
Proof. Consider the following matrices:
The transpose of $\boldsymbol{A}$ and $\boldsymbol{B}$ is:
The sum $\boldsymbol{A}^T+\boldsymbol{B}^T$ is:
Now, the sum $\boldsymbol{A}+\boldsymbol{B}$ is:
Taking the transpose gives:
Notice that this matrix is equal to \eqref{eq:yJ6VsJMu5sStPhtgG31}. Therefore, we have that:
This completes the proof.
Diagonal entries of a square matrix do not change after taking its transpose
Let $\boldsymbol{A}$ be a square matrix. The diagonal entries of $\boldsymbol{A}$ and $\boldsymbol{A}^T$ are the same.
Proof. Suppose $\boldsymbol{A}$ is an $n\times{n}$ matrix. The diagonals of $\boldsymbol{A}$ is $a_{ii}$ for $i=1,2,\cdots,n$. Taking the transpose involves switching the two subscripts, but since they are identical, we also end up with $a_{ii}$ as the diagonal entries of $\boldsymbol{A}^T$. This completes the proof.
Transpose of kA where k is a scalar
If $\boldsymbol{A}$ is a matrix and $k$ is any scalar, then:
Proof. Consider the following matrix:
If $k$ is any scalar, then the product $k\boldsymbol{A}$ is:
The transpose of $k\boldsymbol{A}$ is:
The transpose of $\boldsymbol{A}$ is:
The scalar-matrix product $k\boldsymbol{A}^T$ is:
This is equal to the matrix in \eqref{eq:VMQuvGftyd4iwd5MPJ0}. Therefore, we conclude that:
This completes the proof.
Expressing dot product using matrix notation
If $\boldsymbol{v}$ and $\boldsymbol{w}$ are vectors, then:
Proof. We will prove the case for $\mathbb{R}^3$ but this easily generalizes to $\mathbb{R}^n$. Let vectors $\boldsymbol{v}$ and $\boldsymbol{w}$ be defined as follows:
Their dot product is:
Similarly, we have that:
Similarly, we have that:
This completes the proof.
Matrix product of a vector and its transpose is equal to the vector's squared magnitude
If $\boldsymbol{v}$ is a vector in $\mathbb{R}^n$, then:
Where $\Vert\boldsymbol{v}\Vert$ is the magnitudelink of $\boldsymbol{v}$.
Proof. By the previous propertylink and propertylink of dot product, we have that:
This completes the proof.
Transpose of a product of two matrices
If $\boldsymbol{A}$ is an $ m\times{n}$ matrix and $\boldsymbol{B}$ is an $n\times{p}$ matrix, then:
Proof. From the rules of matrix multiplication, we know that:
Here, the subscript $ij$ represents the value in the $i$-th row $j$-th column. \eqref{eq:hZKaAMSlx63jVMkEVY8} is true for all $i=1,2,\cdots,m$ and $j=1,2,\cdots,p$. For instance, $(\boldsymbol{AB})_{13}$ represents the entry at the $1$st row $3$rd column of matrix $\boldsymbol{AB}$.
We know from the definition of transpose that:
Equating \eqref{eq:aZZgDF30ZHVz6WidSNK} and \eqref{eq:hZKaAMSlx63jVMkEVY8} gives:
Now, consider the following:
Here, we used the fact that the entry $b_{jk}$ in $\boldsymbol{B}^T$ is equal to the entry $b_{kj}$ in $\boldsymbol{B}$.
Equating \eqref{eq:LMNSG63uKXgNU6nkuDe} and \eqref{eq:ZgdDoK2zrOpYmDYO8yN} gives:
Equation \eqref{eq:Bd1Iy1tDn1Ilz2TpbMa} holds true for all $j=1,2,\cdots,p$, and $i=1,2,\cdots,m$. Since the values of two matrices $\boldsymbol{AB}^T$ and $\boldsymbol{B}^T\boldsymbol{A}^T$ are equivalent, these matrices are equivalent, that is:
This completes the proof.
Transpose of a product of three matrices
If $\boldsymbol{A}$, $\boldsymbol{B}$ and $\boldsymbol{C}$ are matrices, then:
Proof. The proof makes use of our previous theorem $(\boldsymbol{AB})^T=\boldsymbol{B}^T\boldsymbol{A}^T$. We start from the left-hand side of our proposition:
This completes the proof.
We will now generalize this theorem for any number of matrices. The proof uses induction and follows a similar logic.
Transpose of a product of n matrices
If $\boldsymbol{A}_i$ for $i=1,2,\cdots,n$ are matrices, then:
Proof. We will prove the theorem by induction. Consider the base case when we have $2$ matrices. We have already shown in theoremlink that:
Therefore, the base case holds. We now assume that the theorem holds for $n-1$ matrices:
Our goal is to show that the theorem holds for $n$ matrices:
We now use the inductive assumption \eqref{eq:IHQoYjMe8rq0BGQ1T2f} to get:
By the principle of mathematical induction, the theorem holds for the general case of $n$ matrices. This completes the proof.
The next theorem is useful for certain proofs.
Another expression for the dot product of Av and w
If $\boldsymbol{A}$ is an $m\times{n}$ matrix and $\boldsymbol{v}\in\mathbb{R}^n$ and $\boldsymbol{w}\in\mathbb{R}^{m}$ are vectors, then:
Proof. The matrix-vector product $\boldsymbol{A}\boldsymbol{v}$ results in a vector. We can use theoremlink to convert the dot product of $\boldsymbol{Av}$ and $\boldsymbol{w}$ into a matrix product:
Note the following:
the third step uses theoremlink, that is, $(\boldsymbol{A}\boldsymbol{B})^T= \boldsymbol{B}^T\boldsymbol{A}^T$.
the final step uses theoremlink to convert the matrix product into a dot product.
This completes the proof.
Practice problems
Consider a $3\times4$ matrix $\boldsymbol{A}$. What would the shape of $\boldsymbol{A}^T$ be?
Since $\boldsymbol{A}^T$ has the columns of $\boldsymbol{A}$ as its rows while the rows of $\boldsymbol{A}$ as its columns, we have that $\boldsymbol{A}^T$ has shape $4\times3$.
Consider the following matrix:
Find $\boldsymbol{A}^T$.
We flip the rows and columns to get: