1 Definition and basic properties
A diagonal matrix is a square matrix in which every entry outside the main diagonal is zero. The only values that may differ from zero are the diagonal entries running from the upper left to the lower right. Because of this highly restricted pattern, diagonal matrices are among the simplest objects studied in linear algebra.
Diagonal matrices are useful because many matrix operations become easy to describe and compute. Their structure also makes them a natural model for transformations that act independently on each coordinate axis.
1.1 Formal definition
An \(n \times n\) matrix \(A = (a_{ij})\) is diagonal if
\[ a_{ij} = 0 \quad \text{whenever } i \ne j. \]
Equivalently, only entries with matching row and column indices may be nonzero. A diagonal matrix is often written by listing only its diagonal entries, for example
\[ \begin{pmatrix} d_1 & 0 & 0 \\ 0 & d_2 & 0 \\ 0 & 0 & d_3 \end{pmatrix}. \]
1.2 Main diagonal and off-diagonal entries
The main diagonal consists of the entries \(a_{11}, a_{22}, \dots, a_{նն}\). These are the possible nonzero entries in a diagonal matrix. All other positions are off-diagonal entries and must be zero.
This distinction is important in matrix theory because many properties of a diagonal matrix depend entirely on its main diagonal. In calculations, the off-diagonal positions contribute nothing.
1.3 Square matrix requirement
Diagonal matrices are necessarily square. The condition of having a single main diagonal requires the number of rows and columns to be equal. Rectangular matrices do not fit the standard definition, since there is no full diagonal structure extending across the matrix in the same way.
1.4 Identity matrix as a special case
The identity matrix is a diagonal matrix whose diagonal entries are all equal to 1. It is the multiplicative identity for square matrices of the same size, meaning that multiplying any compatible matrix by the identity leaves it unchanged.
Because it has ones on the diagonal and zeros elsewhere, the identity matrix is often used as the simplest example of a diagonal matrix.
2 Algebraic operations
Diagonal matrices behave especially simply under the basic operations of matrix algebra. In many cases, the result can be found by applying the operation directly to the diagonal entries.
2.1 Addition and subtraction
The sum or difference of two diagonal matrices of the same size is again diagonal. The diagonal entries are added or subtracted entrywise, while all off-diagonal entries remain zero.
For example, if
\[ A = \operatorname{diag}(a_1,\dots,a_n), \quad B = \operatorname{diag}(b_1,\dots,b_n), \]
then
\[ A \pm B = \operatorname{diag}(a_1 \pm b_1,\dots,a_n \pm b_n). \]
2.2 Scalar multiplication
Multiplying a diagonal matrix by a scalar multiplies each diagonal entry by that scalar. The diagonal form is preserved, since zero entries remain zero.
If \(c\) is a scalar and \(A = \operatorname{diag}(a_1,\dots,a_n)\), then
\[ cA = \operatorname{diag}(ca_1,\dots,ca_n). \]
2.3 Multiplication of diagonal matrices
The product of two diagonal matrices of the same size is diagonal. The diagonal entries of the product are the products of the corresponding diagonal entries.
If
\[ A = \operatorname{diag}(a_1,\dots,a_n), \quad B = \operatorname{diag}(b_1,\dots,b_n), \]
then
\[ AB = \operatorname{diag}(a_1b_1,\dots,a_nb_n). \]
This makes diagonal matrix multiplication much simpler than general matrix multiplication.
2.3.1 Commutativity under multiplication
Diagonal matrices commute under multiplication. For two diagonal matrices \(A\) and \(B\),
\[ AB = BA. \]
This is a notable exception to the usual noncommutative behavior of matrix multiplication. The reason is that multiplication occurs entrywise along the diagonal.
2.4 Powers of diagonal matrices
Raising a diagonal matrix to a positive integer power is straightforward: each diagonal entry is raised to that power.
If \(A = \operatorname{diag}(a_1,\dots,a_n)\), then
\[ A^k = \operatorname{diag}(a_1^k,\dots,a_n^k) \]
for any positive integer \(k\).
This rule also makes polynomial expressions in diagonal matrices easy to evaluate.
2.5 Inverse of a diagonal matrix
A diagonal matrix is invertible if and only if none of its diagonal entries is zero. When the inverse exists, it is also diagonal, with reciprocal entries along the diagonal.
If
\[ A = \operatorname{diag}(a_1,\dots,a_n) \]
and each \(a_i \ne 0\), then
\[ A^{-1} = \operatorname{diag}(a_1^{-1},\dots,a_n^{-1}). \]
2.5.1 Conditions for invertibility
The invertibility of a diagonal matrix depends entirely on the diagonal entries. If even one diagonal entry is zero, the matrix cannot have an inverse. This reflects the fact that the corresponding coordinate direction is collapsed to zero.
A diagonal matrix is invertible precisely when its determinant is nonzero, which in this case means that the product of its diagonal entries is nonzero.
3 Linear algebraic interpretation
Diagonal matrices have a clear geometric meaning. They describe linear transformations that act independently on each coordinate axis by stretching, shrinking, or reversing direction.
3.1 Action on vectors
When a diagonal matrix multiplies a vector, each coordinate is scaled by the corresponding diagonal entry. For a vector
\[ x = (x_1,\dots,x_n)^T \]
and a diagonal matrix \(A = \operatorname{diag}(a_1,\dots,a_n)\),
\[ Ax = (a_1x_1,\dots,a_nx_n)^T. \]
Thus, the transformation does not mix coordinates.
3.2 Scaling along coordinate axes
Geometrically, a diagonal matrix rescales the coordinate axes separately. A diagonal entry greater than 1 stretches along that axis, a value between 0 and 1 compresses it, a negative value reverses orientation along that axis, and zero collapses it entirely.
This axis-by-axis behavior makes diagonal matrices easy to visualize in two or three dimensions.
3.3 Linear transformations represented by diagonal matrices
A linear transformation can be represented by a diagonal matrix when the chosen basis aligns with the directions in which the transformation acts independently. In such a case, the matrix gives a concise description of how each basis vector is scaled.
Diagonal matrices are especially useful when the transformation has no interaction between coordinate directions.
4 Eigenvalues and eigenvectors
Diagonal matrices provide one of the simplest settings for eigenvalue theory. Their spectral behavior is transparent and can often be read directly from the matrix entries.
4.1 Eigenvalues from diagonal entries
The eigenvalues of a diagonal matrix are exactly its diagonal entries, counted with multiplicity. This follows from the fact that the characteristic polynomial factors into linear terms determined by those entries.
For a diagonal matrix
\[ A = \operatorname{diag}(a_1,\dots,a_n), \]
the eigenvalues are \(a_1,\dots,a_n\).
4.2 Standard basis as eigenvectors
The standard basis vectors are eigenvectors of every diagonal matrix. If \(e_i\) is the vector with a 1 in the \(i\)-th position and zeros elsewhere, then
\[ Ae_i = a_i e_i. \]
So each standard basis vector is scaled by the corresponding diagonal entry. This is one reason diagonal matrices are particularly convenient in coordinate-based computations.
4.3 Characteristic polynomial
The characteristic polynomial of a diagonal matrix is the product of the factors \((\lambda - a_i)\), where \(a_i\) are the diagonal entries.
If
\[ A = \operatorname{diag}(a_1,\dots,a_n), \]
then
\[ \chi_A(\lambda) = (\lambda - a_1)\cdots(\lambda - a_n). \]
This factorization makes it immediate to identify the eigenvalues and their multiplicities.
5 Diagonalization and similarity
Diagonal matrices play a central role in the broader theory of diagonalization, where more complicated matrices are transformed into diagonal form by a change of basis.
5.1 Relationship to diagonalizable matrices
A matrix is diagonalizable if it is similar to a diagonal matrix. This means there exists an invertible matrix \(P\) such that
\[ P^{-1}AP = D, \]
where \(D\) is diagonal. In this case, \(A\) and \(D\) represent the same linear transformation in different bases.
Diagonalizable matrices are easier to analyze because the diagonal form reveals their eigenvalues directly.
5.2 Similarity transformations
Similarity transformations preserve many important properties, including eigenvalues and trace. When a matrix is similar to a diagonal matrix, calculations involving powers, exponentials, and other functions can often be reduced to simple operations on the diagonal form.
This approach is widely used in theoretical and computational linear algebra.
5.3 Spectral decomposition
For suitable matrices, especially those with enough eigenvectors, a spectral decomposition expresses the matrix in terms of its eigenvalues and eigenvectors. In such a decomposition, the diagonal matrix contains the eigenvalues, while the surrounding matrices encode the change of basis.
This viewpoint connects diagonal matrices to the spectral structure of linear operators.
6 Special classes of diagonal matrices
Several familiar matrices are particular cases of diagonal matrices. These examples illustrate how broad the concept is, despite its simple definition.
6.1 Identity matrix
The identity matrix is the diagonal matrix with all diagonal entries equal to 1. It leaves vectors and matrices unchanged under multiplication, which makes it fundamental in algebra and computation.
6.2 Scalar matrices
A scalar matrix is a diagonal matrix whose diagonal entries are all the same scalar value. It has the form
\[ cI, \]
where \(I\) is the identity matrix. Scalar matrices act like uniform scaling in every coordinate direction.
6.3 Zero matrix
The zero matrix is also diagonal, with all diagonal entries equal to 0. It sends every vector to the zero vector and is the additive identity for matrix addition.
6.4 Positive diagonal matrices
A positive diagonal matrix is a diagonal matrix whose diagonal entries are all positive. Such matrices are invertible and often appear in contexts where scaling factors must preserve positivity, such as weighted norms and certain numerical methods.
7 Applications
Diagonal matrices appear throughout mathematics, science, and computation because they provide efficient and transparent representations of simple transformations.
7.1 Solving linear systems
Linear systems with diagonal coefficient matrices are easy to solve. Each equation involves only one variable, so the system separates into independent one-variable equations.
This decoupling greatly simplifies both exact solution methods and theoretical analysis.
7.2 Simplifying matrix computations
Many formulas become much easier when a matrix is diagonal. Powers, inverses, determinants, and polynomials in the matrix can often be computed by applying the corresponding operation to each diagonal entry separately.
This efficiency is one reason diagonal forms are sought in symbolic and numerical work.
7.3 Numerical analysis
Diagonal matrices often serve as idealized models in numerical analysis, where they help test algorithms and clarify stability issues. They also arise as approximations or intermediate forms in methods that transform complicated matrices into simpler ones.
Because their behavior is predictable, diagonal matrices are useful for benchmarking computations.
7.4 Differential equations
In systems of linear differential equations, a diagonal coefficient matrix produces independent scalar equations. Each variable evolves separately, which makes the system much easier to solve.
This separation is especially valuable when studying the qualitative behavior of solutions.
8 Related concepts
Diagonal matrices are closely connected to several other matrix classes that generalize or contrast with their structure.
8.1 Upper and lower triangular matrices
Upper and lower triangular matrices allow nonzero entries not only on the diagonal but also above or below it. Diagonal matrices are special cases of both, since all entries off the diagonal are zero.
8.2 Block diagonal matrices
A block diagonal matrix has square blocks along its main diagonal, with zeros elsewhere. It generalizes the diagonal matrix by allowing each diagonal position to contain a smaller matrix rather than a single scalar.
8.3 Sparse matrices
Sparse matrices have relatively few nonzero entries compared with their size. Diagonal matrices are among the sparsest possible square matrices, since they contain nonzero values only along one line of entries.