Diagonal Matrices

Page Content

Definition of a Diagonal Matrix

A diagonal matrix is a square matrix in which all entries off the main diagonal are zero .

Below are examples of diagonal matrices of various dimensions :

$$ A = \begin{bmatrix} -6 & 0 \\ 0 & 9 \end{bmatrix} \qquad B = \begin{bmatrix} 9 & 0 & 0 \\ 0 & 7 & 0 \\ 0 & 0 & -1 \end{bmatrix} $$ $$ C = \begin{bmatrix} -1 & 0 & 0 & 0 \\ 0 & 7 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & -5 \end{bmatrix} \qquad D = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} $$

Properties of Diagonal Matrices

Some of the most important properties of diagonal matrices include :

  1. The determinant of a diagonal matrix is equal to the product of all entries in the main diagonal .
  2. A diagonal matrix is always a symmetric matrix .
  3. A diagonal matrix is invertible (has an inverse) if and only if none of its entries on the main diagonal is zero .

Addition and Multiplication of Diagonal Matrices

Let \( A \) and \( B \) be two diagonal matrices of the same size \( n \times n \) :

$$ A = \begin{bmatrix} a_{11} & 0 & 0 & \cdots \\ 0 & a_{22} & 0 & \cdots \\ \vdots & \vdots & \vdots & \ddots \\ 0 & 0 & \cdots & a_{nn} \end{bmatrix}, \quad B = \begin{bmatrix} b_{11} & 0 & 0 & \cdots \\ 0 & b_{22} & 0 & \cdots \\ \vdots & \vdots & \vdots & \ddots \\ 0 & 0 & \cdots & b_{nn} \end{bmatrix} $$

Matrix Addition:

$$ A + B = \begin{bmatrix} a_{11} + b_{11} & 0 & 0 & \cdots \\ 0 & a_{22} + b_{22} & 0 & \cdots \\ \vdots & \vdots & \vdots & \ddots \\ 0 & 0 & \cdots & a_{nn} + b_{nn} \end{bmatrix} $$

Matrix Multiplication:

$$ AB = \begin{bmatrix} a_{11} b_{11} & 0 & 0 & \cdots \\ 0 & a_{22} b_{22} & 0 & \cdots \\ \vdots & \vdots & \vdots & \ddots \\ 0 & 0 & \cdots & a_{nn} b_{nn} \end{bmatrix} $$

Inverse of Diagonal Matrices

Let \( A \) be a diagonal matrix given by :

$$ A = \begin{bmatrix} a_{11} & 0 & 0 & \cdots \\ 0 & a_{22} & 0 & \cdots \\ \vdots & \vdots & \vdots & \ddots \\ 0 & 0 & \cdots & a_{nn} \end{bmatrix} $$

If none of the entries \( a_{ii} \) on the main diagonal equal zero, then \( A \) is invertible, and its inverse is :

$$ A^{-1} = \begin{bmatrix} \dfrac{1}{a_{11}} & 0 & 0 & \cdots \\ 0 & \dfrac{1}{a_{22}} & 0 & \cdots \\ \vdots & \vdots & \vdots & \ddots \\ 0 & 0 & \cdots & \dfrac{1}{a_{nn}} \end{bmatrix} $$

Power of Diagonal Matrices

For any positive integer \( p \), the power of a diagonal matrix \( A \) is computed by raising each diagonal entry to the power \( p \) :

$$ A^p = \begin{bmatrix} a_{11}^p & 0 & 0 & \cdots \\ 0 & a_{22}^p & 0 & \cdots \\ \vdots & \vdots & \vdots & \ddots \\ 0 & 0 & \cdots & a_{nn}^p \end{bmatrix} $$

Eigenvalues and Eigenvectors of Diagonal Matrices

For a diagonal matrix \( A \), the eigenvalues \( \lambda_i \) are simply the entries on the main diagonal, and their corresponding standard unit vectors form the eigenvectors \( e_i \) :

$$ \lambda_1 = a_{11}, \quad e_1 = \begin{bmatrix} 1 \\ 0 \\ 0 \\ \vdots \\ 0 \end{bmatrix} \qquad \lambda_2 = a_{22}, \quad e_2 = \begin{bmatrix} 0 \\ 1 \\ 0 \\ \vdots \\ 0 \end{bmatrix} \qquad \dots \qquad \lambda_n = a_{nn}, \quad e_n = \begin{bmatrix} 0 \\ 0 \\ \vdots \\ 0 \\ 1 \end{bmatrix} $$

Examples with Solutions

Example 1

Which of the following matrices are diagonal matrices ?

a) \( A = \begin{bmatrix} 0 & 0 \\ 1 & 2 \end{bmatrix} \)      b) \( B = \begin{bmatrix} -2 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 1 \end{bmatrix} \)
c) \( C = \begin{bmatrix} 5 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 3 & 0 \\ 5 & 0 & 0 & 4 \end{bmatrix} \)      d) \( D = \begin{bmatrix} 5 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \\ 0 & 0 & 9 & 0 \\ 0 & 0 & 0 & -1 \end{bmatrix} \)

View Solution to Example 1

Matrices \( B \) and \( D \) are diagonal matrices because all entries off their main diagonals are strictly zero .

Example 2

Given matrices \( A = \begin{bmatrix} -1 & 0 & 0 \\ 0 & -\dfrac{2}{3} & 0 \\ 0 & 0 & \dfrac{1}{4} \end{bmatrix} \) and \( B = \begin{bmatrix} -1 & 0 & 0 \\ 0 & -6 & 0 \\ 0 & 0 & 8 \end{bmatrix} \), calculate the product \( AB \) .

View Solution to Example 2
$$ AB = \begin{bmatrix} -1 & 0 & 0 \\ 0 & -\dfrac{2}{3} & 0 \\ 0 & 0 & \dfrac{1}{4} \end{bmatrix} \begin{bmatrix} -1 & 0 & 0 \\ 0 & -6 & 0 \\ 0 & 0 & 8 \end{bmatrix} $$ $$ = \begin{bmatrix} (-1)(-1) & 0 & 0 \\ 0 & \left(-\dfrac{2}{3}\right)(-6) & 0 \\ 0 & 0 & \left(\dfrac{1}{4}\right)(8) \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 2 \end{bmatrix} $$

Example 3

Let matrix \( A = \begin{bmatrix} -1 & 0 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & -2 \end{bmatrix} \). Calculate \( A^5 \) .

View Solution to Example 3
$$ A^5 = \begin{bmatrix} (-1)^5 & 0 & 0 & 0 \\ 0 & (2)^5 & 0 & 0 \\ 0 & 0 & (-1)^5 & 0 \\ 0 & 0 & 0 & (-2)^5 \end{bmatrix} = \begin{bmatrix} -1 & 0 & 0 & 0 \\ 0 & 32 & 0 & 0 \\ 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & -32 \end{bmatrix} $$

Example 4

Find the eigenvalues and eigenvectors of matrix \( A = \begin{bmatrix} 1 & 0 \\ 0 & -3 \end{bmatrix} \) .

View Solution to Example 4

First Eigenpair: \( \lambda_1 = 1 \),   \( e_1 = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \)

Second Eigenpair: \( \lambda_2 = -3 \),   \( e_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix} \)

Example 5

Find the eigenvalues and eigenvectors of matrix \( A = \begin{bmatrix} -6 & 0 & 0 \\ 0 & \dfrac{1}{5} & 0 \\ 0 & 0 & -\dfrac{2}{3} \end{bmatrix} \) .

View Solution to Example 5

\( \lambda_1 = -6 \),   \( e_1 = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} \)

\( \lambda_2 = \dfrac{1}{5} \),   \( e_2 = \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} \)

\( \lambda_3 = -\dfrac{2}{3} \),   \( e_3 = \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} \)

Example 6

Find the eigenvalues and eigenvectors of matrix \( A = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \\ 0 & 0 & 9 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \) .

View Solution to Example 6

\( \lambda_1 = 1 \),   \( e_1 = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} \)

\( \lambda_2 = -1 \),   \( e_2 = \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix} \)

\( \lambda_3 = 9 \),   \( e_3 = \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} \)

\( \lambda_4 = 1 \),   \( e_4 = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix} \)

Questions (with Solutions)

  1. Part 1: Find the real constants \( a \) and \( b \) such that \( A^{-1} = A \) where \( A = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & \dfrac{1}{a} & 0 & 0 \\ 0 & 0 & b+1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \) .

  2. Part 2: Find the eigenvalues and eigenvectors of matrix \( A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{bmatrix} \) .

  3. Part 3: Find the eigenvalues and eigenvectors of matrix \( A = \begin{bmatrix} 2 & 0 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & -2 & 0 \\ 0 & 0 & 0 & -2 \end{bmatrix} \) .

View Solutions to Practice Questions

Solution to Part 1:

First, find the inverse matrix :

$$ A^{-1} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & a & 0 & 0 \\ 0 & 0 & \dfrac{1}{b+1} & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} $$

Setting \( A^{-1} = A \) gives equations for diagonal entries :

\( a = \dfrac{1}{a} \implies a^2 = 1 \implies a = 1 \) or \( a = -1 \)

\( \dfrac{1}{b+1} = b+1 \implies (b+1)^2 = 1 \implies b = 0 \) or \( b = -2 \)

Thus, valid pairs are :

\( (a=1, b=0), \quad (a=1, b=-2), \quad (a=-1, b=0), \quad (a=-1, b=-2) \)


Solution to Part 2:

\( \lambda_1 = 1 \),   \( e_1 = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} \)

\( \lambda_2 = 1 \),   \( e_2 = \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} \)

\( \lambda_3 = 0 \),   \( e_3 = \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} \)


Solution to Part 3:

\( \lambda_1 = 2 \),   \( e_1 = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} \)

\( \lambda_2 = 2 \),   \( e_2 = \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix} \)

\( \lambda_3 = -2 \),   \( e_3 = \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} \)

\( \lambda_4 = -2 \),   \( e_4 = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix} \)

More References and Links