Diagonal Matrices

Diagonal Matrices

Definition: A square $n \times n$ matrix $D$ is a Diagonal Matrix if all entries off the main diagonal are zero, that is for all $i \neq j$, $a_{ij} = 0$.

The following three matrices $A$, $B$, and $C$ are all diagonal matrices. Note that the entries of the main diagonal are not pertinent in the definition of a diagonal matrix, and so entries in the main diagonal can be zero.

(1)
\begin{align} \quad A = \begin{bmatrix} 2 & 0 & 0\\ 0 & -1 & 0\\ 0 & 0 & 3 \end{bmatrix} \quad , \quad B = \begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 2 & 0 & 0\\ 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 \end{bmatrix} \quad , \quad C = \begin{bmatrix} 1 & 0\\ 0 & 3 \end{bmatrix} \end{align}

If we have two matrices $A$ and $D$ with $D$ being a diagonal matrix (assuming multiplication is defined), then calculating the product of these matrices is relatively easy. If we want to find the product $AD$, then we multiply the first column of $A$ by $d_1$, the second column of $A$ by $d_2$, …, and the $n^{\mathrm{th}}$ column of $A$ by $d_n$:

(2)
\begin{align} AD =\begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots\\ a_{m1} & a_{m2} & \cdots& a_{mn} \end{bmatrix} \begin{bmatrix} d_1 & 0 & \cdots & 0\\ 0 & d_2 & & \vdots \\ \vdots & & \ddots & \\ 0 & \cdots & & d_n \end{bmatrix} = \begin{bmatrix} d_1a_{11} & d_2a_{12} & \cdots & d_na_{1n} \\ d_1a_{21} & d_2a_{22} & \cdots & d_na_{2n}\\ \vdots & \vdots& \ddots & \vdots \\ d_{1}a_{m1} & d_2a_{m2}& \cdots & d_na_{mn} \end{bmatrix} \end{align}

If we want to find the product $DA$, we multiply the first row of $A$ by $d_1$, the second row of $A$ by $d_2$, …, and the $n^{\mathrm{th}}$ row of $A$ by $d_n$:

(3)
\begin{align} DA = \begin{bmatrix} d_1 & 0 & \cdots & 0\\ 0 & d_2 & & \vdots \\ \vdots & & \ddots & \\ 0 & \cdots & & d_n \end{bmatrix} \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots\\ a_{m1} & a_{m2} & \cdots& a_{mn} \end{bmatrix} = \begin{bmatrix} d_1a_{11} & d_1a_{12} & \cdots & d_{1}a_{1n}\\ d_2a_{21} & d_2a_{22} & \cdots & d_2a_{2n}\\ \vdots & \vdots & \ddots & \vdots \\ d_ma_{m1} & d_ma_{m2} & \cdots & d_ma_{mn} \end{bmatrix} \end{align}

We will now look at some examples of calculating matrix products involving diagonal matrices.

Example 1

Given the following matrices, determine the product $AB$.

(4)
\begin{align} A = \begin{bmatrix} 2 & 1 & 0\\ 3 & 2 & 0 \\ -1 & 2 & 2 \end{bmatrix} \quad , \quad B = \begin{bmatrix} -2 & 0 & 0\\ 0 & 4 & 0\\ 0 & 0 & 5 \end{bmatrix} \end{align}

We note that $B$ is a diagonal matrix and to determine the product $AB$, we can multiply column $1$ of $A$ by $b_{11}$, column $2$ of $A$ by $b_{22}$, and column $3$ of $A$ by $b_{33}$:

(5)
\begin{align} AB = \begin{bmatrix} 2 \cdot (-2) & 1 \cdot (4) & 0 \cdot (5)\\ 3 \cdot (-2) & 2 \cdot (4) & 0 \cdot (5)\\ -1 \cdot (-2) & 2 \cdot (4) & 2 \cdot (5) \end{bmatrix} = \begin{bmatrix} -4 & 4 & 0\\ -6 & 8 & 0\\ 2 & 8 & 10 \end{bmatrix} \end{align}

Example 2

Prove that if $A$ is a diagonal matrix, then $A = A^T$.

  • Proof: The transpose of a matrix only interchanges entries that are not on the main diagonal. If $A$ is a diagonal matrix, then the only entries that are interchanged are zeroes and the main diagonal is untouched. Additionally, a diagonal matrix is square so $A^T$ is also square. Recall two matrices are equal if they are both the same size and all corresponding entries are diagonal, both of which were proved. $\blacksquare$
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License