Diagonal Matrix - Definition, Properties, Inverse, Examples

Diagonal Matrix - Definition, Properties, Inverse, Examples

TL;DR

A diagonal matrix is a square matrix with zeros off the main diagonal. Learn its properties, determinant, inverse, special cases, and worked examples.

What Is a Diagonal Matrix?

A diagonal matrix is a square matrix whose entries are all zero except possibly on the main diagonal, the line of positions running from the top-left corner to the bottom-right. In symbols, ( a_{ij} = 0 ) whenever ( i \neq j ). The diagonal entries themselves can be any value, including zero.

A 3x3 example:

[ D = \begin{bmatrix} 4 & 0 & 0 \\ 0 & 7 & 0 \\ 0 & 0 & 2 \end{bmatrix} ]

Everything off the diagonal is zero; the diagonal holds 4, 7, and 2.

Variable glossary. ( a_{ij} ) is the entry in row ( i ), column ( j ). The main diagonal is the set of entries where ( i = j ) (positions ( a_{11}, a_{22}, a_{33}, \ldots )). "Off-diagonal" means any position where ( i \neq j ).

The matrix must be square first: the order has to be ( n \times n ) for a main diagonal to be defined at all.

What Are the Properties of a Diagonal Matrix?

Diagonal matrices behave so cleanly because the zeros do most of the work. The properties worth memorizing:

That last property is why diagonal matrices are the goal of diagonalization: turning an ugly matrix into a diagonal one so its powers become easy.

How Do You Find the Determinant and Inverse of a Diagonal Matrix?

Both reduce to one-line operations on the diagonal.

Determinant. The determinant of a diagonal matrix is simply the product of its diagonal entries. For ( D ):

[ |D| = 4 \times 7 \times 2 = 56 ]

No cofactor expansion is needed, since the zeros kill every other term.

Inverse. A diagonal matrix is invertible exactly when no diagonal entry is zero. The inverse is found by replacing each diagonal entry with its reciprocal:

[ D^{-1} = \begin{bmatrix} \tfrac{1}{4} & 0 & 0 \\ 0 & \tfrac{1}{7} & 0 \\ 0 & 0 & \tfrac{1}{2} \end{bmatrix} ]

If even one diagonal entry is zero, the determinant is zero, and no inverse exists.

What Is Diagonalization of a Matrix?

Diagonalization is the process of rewriting a square matrix ( A ) as ( A = PDP^{-1} ), where ( D ) is a diagonal matrix and ( P ) is an invertible matrix whose columns are the eigenvectors of ( A ). The diagonal entries of ( D ) are the eigenvalues of ( A ). Not every matrix can be diagonalized, but when one can, the payoff is large.

The reason this matters connects straight back to the properties above: powers of a diagonal matrix are trivial. Once ( A = PDP^{-1} ), raising ( A ) to a power telescopes,

[ A^k = PD^kP^{-1} ]

The machinery rests on eigenvalues, which decide whether a matrix is diagonalizable in the first place.

Special Cases: Scalar, Identity, and Null Matrices

Three named matrices are all diagonal matrices wearing a more specific label.

The chain is one-directional: every identity is scalar, every scalar is diagonal, but a diagonal matrix is usually neither. This is exactly the relationship readers ask about most: "is an identity matrix a diagonal matrix?" Yes, and so is a scalar matrix.

Examples of a Diagonal Matrix

Example 1

Is [ \begin{bmatrix} 5 & 0 \\ 0 & 9 \end{bmatrix} ] a diagonal matrix?
Check every off-diagonal entry. Position (1,2)=0 and position (2,1)=0.

All off-diagonal entries are zero, and the matrix is square.

Final answer: Yes, it is a 2×2 diagonal matrix.

Example 2

Find the determinant of [ \begin{bmatrix} 3 & 0 & 0 \\ 0 & 6 & 0 \\ 0 & 0 & 0 \end{bmatrix} ].

This is the wrong-path-first example.

Wrong attempt. A student sees a diagonal matrix and writes "diagonal matrices are always invertible, so the determinant is nonzero," then guesses a value.

Why it is wrong. The shortcut "diagonal means invertible" is false. Invertibility needs every diagonal entry to be nonzero. Here the third entry is 0.

Correct. Multiply the diagonal entries:

[ |D| = 3 \times 6 \times 0 ]

Final answer: ( |D| = 0 ). The matrix is singular and has no inverse, because a zero sits on the diagonal.

Example 3

Find the inverse of [ \begin{bmatrix} 2 & 0 \\ 0 & 8 \end{bmatrix} ].

Reciprocate each diagonal entry:

[ D^{-1} = \begin{bmatrix} \tfrac{1}{2} & 0 \\ 0 & \tfrac{1}{8} \end{bmatrix} ]

Final answer: [ D^{-1} = \begin{bmatrix} \tfrac{1}{2} & 0 \\ 0 & \tfrac{1}{8} \end{bmatrix} ].

Example 4

Compute ( D^3 ) for [ D = \begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix} ].

Cube each diagonal entry, leave the zeros:

[ D^3 = \begin{bmatrix} 8 & 0 \\ 0 & 27 \end{bmatrix} ]

Final answer: [ D^3 = \begin{bmatrix} 8 & 0 \\ 0 & 27 \end{bmatrix} ]. Compare the effort to cubing a full matrix — this is the diagonal payoff.

Example 5

Multiply [ \begin{bmatrix} 4 & 0 \\ 0 & 5 \end{bmatrix} ] by [ \begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix} ].

Multiply the diagonal entries position by position:

[ \begin{bmatrix} 8 & 0 \\ 0 & 15 \end{bmatrix} ]

Final answer: [ \begin{bmatrix} 8 & 0 \\ 0 & 15 \end{bmatrix} ], still diagonal, and the order would not change if you reversed the two matrices.

Example 6

A diagonal matrix has order 3×3 with diagonal entries 1, 1, 1. Name it.
Every diagonal entry equals 1, off-diagonal entries are zero, and it is square.

Final answer: This is the 3×3 identity matrix, ( I_3 ), the most famous diagonal matrix of all.

Why Diagonal Matrices Matter: "Simplicity that scales"

Diagonal matrices exist as the simplest non-trivial matrices, and the entire effort of diagonalization is aimed at turning hard problems into this easy shape. When a system decouples — when each variable evolves on its own without dragging the others along — the matrix describing it is diagonal, and the math becomes one independent equation per variable.

The destination shows up across applied fields:

A diagonal matrix is what every messier matrix wishes it were. That is why "diagonalize it" is one of the most common instructions in linear algebra.

Diagonal Matrix - Common Confusions Cleared Up

Mistake 1: Thinking every diagonal matrix is invertible

The correct way: Reciprocate only when every diagonal entry is nonzero. A single zero on the diagonal makes the determinant zero and kills the inverse.

Mistake 2: Confusing the diagonal matrix with the scalar or identity matrix

The correct way: Diagonal allows different values on the diagonal; scalar needs them all equal; identity needs them all equal to 1.

Mistake 3: Including off-diagonal nonzeros and still calling it diagonal

The correct way: Every off-diagonal entry must be zero. That stray nonzero entry makes the matrix upper-triangular, not diagonal.

Diagonal Matrix - In Five Bullets

Practice Questions on Diagonal Matrices

Solve these, then check your work below.

  1. Is [ \begin{bmatrix} 6 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 4 \end{bmatrix} ] a diagonal matrix? Is it invertible?

  2. Find the determinant of [ \begin{bmatrix} 5 & 0 \\ 0 & 9 \end{bmatrix} ].

  3. Find the inverse of [ \begin{bmatrix} 3 & 0 \\ 0 & 6 \end{bmatrix} ].

  4. Compute ( D^4 ) for [ D = \begin{bmatrix} 2 & 0 \\ 0 & 1 \end{bmatrix} ].

  5. Name the diagonal matrix whose order is 2×2 with both diagonal entries equal to 5.

Answer to Question 1: Yes, it is diagonal (every off-diagonal entry is zero and it is square), but it is not invertible because a zero sits on the diagonal, so ( |D| = 0 ).

Answer to Question 2: ( |D| = 5 \times 9 = 45 ).

Answer to Question 3: [ D^{-1} = \begin{bmatrix} \tfrac{1}{3} & 0 \\ 0 & \tfrac{1}{6} \end{bmatrix} ].

Answer to Question 4: [ D^4 = \begin{bmatrix} 16 & 0 \\ 0 & 1 \end{bmatrix} ].

Answer to Question 5: A scalar matrix (a diagonal matrix with all equal diagonal entries), ( 5I_2 ).