Tutorials › Linear Algebra › Inverses of Scalar and Diagonal Matrices

Elementary Matrices and Inverses · Tutorial 106 of 1000

Inverses of Scalar and Diagonal Matrices

Use reciprocal diagonal entries to construct inverses, and recognize exactly when a diagonal matrix has no inverse.

Beginner 9 min read

What You'll Learn

  • Identify when a scalar multiple of the identity matrix is invertible.
  • Compute the inverse of a nonzero scalar multiple of the identity.
  • Determine invertibility from the diagonal entries of a square diagonal matrix.
  • Construct and verify the inverse of an invertible diagonal matrix.
  • Recognize why a zero diagonal entry makes a diagonal matrix singular.

Diagonal Matrices and Coordinate Scaling

For a diagonal matrix, each coordinate is scaled independently: multiplying a vector by the matrix changes each coordinate by the corresponding diagonal entry, without mixing it with the other coordinates. If every scaling factor is nonzero, it can be undone by scaling by its reciprocal. If one factor is zero, that coordinate is erased, so the original input cannot in general be recovered. This observation gives both a simple inverse formula and an exact test for singularity.

Throughout, matrices are square \(n\times n\) matrices over \(\mathbb{R}\), with \(n\ge 1\). The identity matrix is \(\mathbf{I}_n\). A matrix \(\mathbf{A}\) is invertible if there is a matrix \(\mathbf{B}\) of the same size such that \(\mathbf{A}\mathbf{B}=\mathbf{B}\mathbf{A}=\mathbf{I}_n\); then \(\mathbf{B}\) is its inverse, written \(\mathbf{A}^{-1}\). A matrix that is not invertible is called singular.

Definition: A diagonal matrix is a square matrix whose entries outside its main diagonal are all zero. We write \(\operatorname{diag}(d_1,\dots,d_n)\) for the matrix with diagonal entries \(d_1,\dots,d_n\) and all other entries zero. A scalar multiple of the identity has the form \(c\mathbf{I}_n=\operatorname{diag}(c,\dots,c)\), where \(c\in\mathbb{R}\).

The scalar-multiple case is a useful starting point. When \(c\ne0\), multiplication by \(c\mathbf{I}_n\) scales every coordinate by the same factor \(c\), so multiplication by \(\frac{1}{c}\mathbf{I}_n\) reverses that scaling. When \(c=0\), the matrix sends every vector to the zero vector, and therefore cannot have an inverse.

Theorem (Inverse of a scalar multiple of the identity): For \(c\in\mathbb{R}\), the matrix \(c\mathbf{I}_n\) is invertible if and only if \(c\ne0\). In that case, $$ (c\mathbf{I}_n)^{-1}=\frac{1}{c}\mathbf{I}_n. $$

Proof. Suppose first that \(c\ne0\). Using \(\mathbf{I}_n\mathbf{I}_n=\mathbf{I}_n\), we calculate in both orders: \((c\mathbf{I}_n)(\frac{1}{c}\mathbf{I}_n)=\frac{c}{c}\mathbf{I}_n=\mathbf{I}_n\) and \((\frac{1}{c}\mathbf{I}_n)(c\mathbf{I}_n)=\frac{c}{c}\mathbf{I}_n=\mathbf{I}_n\). Thus \(\frac{1}{c}\mathbf{I}_n\) is an inverse. If \(c=0\), then \(c\mathbf{I}_n=\mathbf{O}\). For any \(n\times n\) matrix \(\mathbf{B}\), \(\mathbf{O}\mathbf{B}=\mathbf{O}\ne\mathbf{I}_n\), since \(n\ge1\). Hence \(\mathbf{O}\) has no inverse. These two cases prove the equivalence and the formula. \(\square\)

Worked Example: Inverting a Negative Scalar Multiple

Find the inverse of \(\mathbf{A}=-3\mathbf{I}_2\), and verify it in both multiplication orders.

Since \(-3\ne0\), the theorem gives \(\mathbf{A}^{-1}=-\frac{1}{3}\mathbf{I}_2\). Written as matrices,

$$ \mathbf{A}=\begin{bmatrix}-3&0\\0&-3\end{bmatrix}, \qquad \mathbf{A}^{-1}=\begin{bmatrix}-\frac13&0\\0&-\frac13\end{bmatrix}. $$

Multiplying in the stated order gives \(\mathbf{A}\mathbf{A}^{-1}=\begin{bmatrix}(-3)(-\frac13)+0&(-3)(0)+0\\0(-\frac13)+(-3)(0)&0+(-3)(-\frac13)\end{bmatrix}=\begin{bmatrix}1&0\\0&1\end{bmatrix}=\mathbf{I}_2\). In the reverse order, the diagonal products are also \((-\frac13)(-3)=1\), and both off-diagonal entries are zero, so \(\mathbf{A}^{-1}\mathbf{A}=\mathbf{I}_2\). The proposed matrix is indeed an inverse.

Inverting a Diagonal Matrix

For a general diagonal matrix, each diagonal entry can be treated separately, but the condition matters: no entry may be zero. If the entries are all nonzero, reciprocating them gives a candidate inverse. To establish that this always works, and that a zero entry rules out every possible inverse, we prove both directions of the criterion.

Theorem (Diagonal matrix inverse criterion): Let \(\mathbf{D}=\operatorname{diag}(d_1,\dots,d_n)\in\mathbb{R}^{n\times n}\). The matrix \(\mathbf{D}\) is invertible if and only if \(d_i\ne0\) for every \(i=1,\dots,n\). When all entries are nonzero, $$ \mathbf{D}^{-1}=\operatorname{diag}\left(\frac{1}{d_1},\dots,\frac{1}{d_n}\right). $$

Proof. First suppose every \(d_i\ne0\), and set \(\mathbf{E}=\operatorname{diag}(1/d_1,\dots,1/d_n)\). For two diagonal matrices, the product is diagonal: its \(i\)th diagonal entry is the product of their \(i\)th diagonal entries, since the only possibly nonzero term in the \(i\)th row of the first matrix is in column \(i\). Thus \(\mathbf{D}\mathbf{E}\) has diagonal entries \(d_i(1/d_i)=1\), and zero entries outside the diagonal, so \(\mathbf{D}\mathbf{E}=\mathbf{I}_n\). The same calculation gives \(\mathbf{E}\mathbf{D}=\mathbf{I}_n\). Therefore \(\mathbf{D}\) is invertible with inverse \(\mathbf{E}\).

Conversely, suppose \(d_k=0\) for some \(k\in\{1,\dots,n\}\). The standard basis vector \(\mathbf{e}_k\), whose \(k\)th coordinate is \(1\) and whose other coordinates are \(0\), is nonzero. Direct multiplication gives \(\mathbf{D}\mathbf{e}_k=\mathbf{0}\), because its only potentially nonzero coordinate is \(d_k=0\). If an inverse \(\mathbf{B}\) existed, then \(\mathbf{e}_k=\mathbf{I}_n\mathbf{e}_k=(\mathbf{B}\mathbf{D})\mathbf{e}_k=\mathbf{B}(\mathbf{D}\mathbf{e}_k)=\mathbf{B}\mathbf{0}=\mathbf{0}\), contradicting \(\mathbf{e}_k\ne\mathbf{0}\). Hence \(\mathbf{D}\) is singular whenever any diagonal entry is zero. This proves both directions. \(\square\)

The proof gives a concrete reason for the criterion. With no zero entries, each coordinate can be recovered by dividing by its scaling factor. If \(d_k=0\), the input’s \(k\)th coordinate has no effect on the output; in particular, the nonzero vector \(\mathbf{e}_k\) is sent to \(\mathbf{0}\). No matrix can undo that loss and multiply back to the identity.

Worked Example: Reciprocal Diagonal Entries

Find the inverse of \(\mathbf{D}=\operatorname{diag}(2,-3,\frac14)\), then check the product.

All three diagonal entries are nonzero. Their reciprocals are \(\frac12\), \(-\frac13\), and \(4\), respectively. Therefore the formula gives

$$ \mathbf{D}^{-1}= \begin{bmatrix} \frac12&0&0\\ 0&-\frac13&0\\ 0&0&4 \end{bmatrix}. $$

The diagonal entries of \(\mathbf{D}\mathbf{D}^{-1}\) are \(2(\frac12)=1\), \((-3)(-\frac13)=1\), and \((\frac14)(4)=1\). Every off-diagonal entry is zero because both factors are diagonal. Hence \(\mathbf{D}\mathbf{D}^{-1}=\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}=\mathbf{I}_3\). In the reverse order, the diagonal entries are \((\frac12)2=1\), \((-\frac13)(-3)=1\), and \(4(\frac14)=1\), and all off-diagonal entries remain zero. Thus \(\mathbf{D}^{-1}\mathbf{D}=\mathbf{I}_3\) as well.

Reading Singularity from the Diagonal

The theorem is also a complete test for singularity: a diagonal matrix is singular exactly when at least one of its diagonal entries is zero. With parameters, this becomes a short case analysis. Find the parameter values that make an entry zero; for every other value, take the reciprocal of each entry to form the inverse. The reciprocal formula is not defined at a zero entry, and the theorem shows this is not merely a failure of that particular formula: no inverse exists then.

Worked Example: A Parameter Determines Singularity

For which real values of \(t\) is \(\mathbf{D}(t)=\operatorname{diag}(2,t-1,-5)\) singular? Find the inverse when it exists.

The first and third diagonal entries, \(2\) and \(-5\), are nonzero for every \(t\in\mathbb{R}\). The middle entry is zero exactly when \(t-1=0\), or \(t=1\). By the diagonal matrix criterion, \(\mathbf{D}(t)\) is singular at \(t=1\), and is invertible for every \(t\ne1\). For \(t\ne1\), its inverse is

$$ \mathbf{D}(t)^{-1} =\operatorname{diag}\left(\frac12,\frac{1}{t-1},-\frac15\right). $$

To check a particular invertible case, take \(t=3\). Then \(\mathbf{D}(3)=\begin{bmatrix}2&0&0\\0&2&0\\0&0&-5\end{bmatrix}\) and the proposed inverse is \(\begin{bmatrix}\frac12&0&0\\0&\frac12&0\\0&0&-\frac15\end{bmatrix}\). Their product has diagonal entries \(2(\frac12)=1\), \(2(\frac12)=1\), and \((-5)(-\frac15)=1\); the off-diagonal entries are zero. The reverse product has the same diagonal entries and zero off-diagonal entries, so both products equal \(\mathbf{I}_3\).

At \(t=1\), the matrix is \(\operatorname{diag}(2,0,-5)\). It sends \(\mathbf{e}_2\ne\mathbf{0}\) to \(\mathbf{0}\), so the proof of the criterion confirms directly that it has no inverse.

Common Mistake: Reciprocals Do Not Fix a Zero

A tempting but invalid step is to apply the reciprocal formula to every diagonal entry even if one is zero. For example, the proposed “inverse” \(\operatorname{diag}(\frac12,\frac{1}{0},-\frac15)\) for \(\operatorname{diag}(2,0,-5)\) is not a matrix: \(1/0\) is undefined. Replacing that entry by \(0\) does not work either. The resulting matrix \(\operatorname{diag}(\frac12,0,-\frac15)\) multiplied by \(\operatorname{diag}(2,0,-5)\) gives \(\operatorname{diag}(1,0,1)\), not \(\mathbf{I}_3\). The correction is to check every diagonal entry before writing reciprocals. If any entry is zero, declare the matrix singular; if none is zero, take all reciprocals and verify the product.

Keep the two related formulas distinct. For \(c\mathbf{I}_n\), every diagonal entry is the same, so the inverse, when \(c\ne0\), is \(\frac1c\mathbf{I}_n\). For a general diagonal matrix, each entry may differ, so each must be reciprocated separately. In either case, the condition that the entries being inverted are nonzero is essential.

MatrixInvertibility conditionInverse when it exists
\(c\mathbf{I}_n\)\(c\ne0\)\(\frac1c\mathbf{I}_n\)
\(\operatorname{diag}(d_1,\dots,d_n)\)\(d_i\ne0\) for every \(i\)\(\operatorname{diag}(1/d_1,\dots,1/d_n)\)
A diagonal matrix with at least one zero entryNever invertibleNo inverse exists

Why These Formulas Are Useful

These special cases let you invert certain matrices without row reduction, but their usefulness is not only computational. They make the meaning of an inverse tangible: it reverses the action of the original matrix. A scalar multiple of the identity stretches or reverses every coordinate uniformly; a diagonal matrix scales coordinates independently. The inverse reverses each nonzero scaling. A zero scaling destroys information, which explains exactly why invertibility fails.

For any proposed inverse, the definition still supplies the final check: multiplication in both orders must give the identity. In the examples, the products were easy to verify because diagonal matrices multiply by multiplying corresponding diagonal entries. That convenience does not change the requirement that the candidate be a two-sided inverse. Check that all diagonal entries are nonzero first, write their reciprocals in the same positions, and then confirm the identity product.

Check Your Understanding

For each question, state the invertibility condition explicitly and verify any proposed inverse by multiplication.

  1. Find and check the inverse of \(5\mathbf{I}_3\).
  2. Determine whether \(\operatorname{diag}(-2,\frac13,7)\) is invertible, and find its inverse if it is.
  3. For which real values of \(t\) is \(\operatorname{diag}(t,4,t+2)\) singular?
  4. Explain why a diagonal matrix with \(d_k=0\) cannot have an inverse, using \(\mathbf{e}_k\).
  5. What is wrong with proposing \(\operatorname{diag}(1,0,\frac12)\) as the inverse of \(\operatorname{diag}(1,0,2)\)? Compute the product.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon