The operations of matrix addition and matrix multiplication are especially simple for diagonal matrices. Write diag(a1,...,an) for a diagonal matrix whose diagonal entries starting in the upper left corner are a1,...,an. Then, for addition, we have
and for matrix multiplication,
The diagonal matrix diag(a1,...,an) is invertible if and only if the entries a1,...,an are all non-zero. In this case, we have
In particular, the diagonal matrices form a subring of the ring of all n-by-n matrices.
Multiplying the matrix A from the left with diag(a1,...,an) amounts to multiplying the i-th row of A by ai for all i; multiplying the matrix A from the right with diag(a1,...,an) amounts to multiplying the i-th column of A by ai for all i.
Diagonal matrices occur in many areas of linear algebra. Because of the simple description of the matrix operation and eigenvalues/eigenvectors given above, it is always desirable to represent a given matrix or linear map by a diagonal matrix.
Over the field of real or complex numbers, more is true: every normal matrix is unitarily similar to a diagonal matrix (the spectral theorem), and every matrix is unitarily equivalent[?] to a diagonal matrix with nonnegative entries (the singular value decomposition).