Inverse of Diagonal Matrix — Formula & Examples
Inverse of Diagonal Matrix — Formula & Examples
What the Inverse of a Diagonal Matrix Is
The inverse of a diagonal matrix is another diagonal matrix in which each main-diagonal entry is the reciprocal of the matching entry in the original, provided none of those entries is zero. A diagonal matrix is a square matrix whose only non-zero entries lie on the main diagonal — every off-diagonal entry is 0.
If you stopped reading here, you would have the answer: flip each diagonal number to 1 over itself, leave the zeros alone, and that is the inverse. The rest of the article proves why it works and shows exactly when it does not.
The Formula For a Diagonal Matrix
D=[d_1 & 0 & \cdots & 0 \
0 & d_2 & \cdots & 0 \
\vdots & \vdots & \ddots & \vdots \
0 & 0 & \cdots & d_n \end{bmatrix}
with every d_i ≠ 0, the inverse is
D^{-1}=[\frac{1}{d_1} & 0 & \cdots & 0 \
0 & \frac{1}{d_2} & \cdots & 0 \
\vdots & \vdots & \ddots & \vdots \
0 & 0 & \cdots & \frac{1}{d_n} \end{bmatrix}
Here d_1, d_2, …, d_n are the diagonal entries, and each becomes \frac{1}{d_i} in the inverse. No [determinant] and no adjugate are needed — a genuine shortcut compared with the general [inverse of a matrix].
A Short Proof
To confirm D^{-1} is the inverse, multiply it by D and check that the product is the [identity matrix]. The product of two diagonal matrices is diagonal, with each entry the product of the matching entries:
D⋅D^{-1}=[d_1 \cdot \frac{1}{d_1} & 0 \ 0 & d_2 \cdot \frac{1}{d_2} \end{bmatrix} = \begin{bmatrix} 1 & 0 \ 0 & 1 \end{bmatrix} = I
Each diagonal product is d_i \cdot \frac{1}{d_i} = 1, and every off-diagonal entry stays 0. The same check works the other way (D^{-1}⋅D = I), so D^{-1} is the inverse. This is exactly why the reciprocal rule holds.
Properties of the Inverse of a Diagonal Matrix
A few properties follow directly from the reciprocal rule and are worth stating on their own.
- Invertibility condition. A diagonal matrix is invertible if and only if every diagonal entry is non-zero. A single zero on the diagonal makes the determinant zero, so the matrix is singular and no inverse exists.
- The inverse is diagonal. Reciprocating only the diagonal entries leaves every off-diagonal entry at 0, so D^{-1} keeps the same diagonal shape as D.
- The determinant is the product of the entries. For D=diag(d_1, d_2, …, d_n), det(D)=d_1 d_2 \cdots d_n, and so det(D^{-1}) = \frac{1}{d_1 d_2 \cdots d_n}.
- Powers stay diagonal. Raising D to a power raises each diagonal entry to that power, and D^{-1} is just D with each entry taken to the power -1.
- A diagonal matrix is symmetric, and so is its inverse. Because the only non-zero entries lie on the diagonal, D=D^{T} and D^{-1}=(D^{-1})^{T}.
The first bullet is the one that decides everything: check the diagonal for a zero before you reach for reciprocals.
Examples of the Inverse of a Diagonal Matrix
Each example states the matrix in bold, then works the inverse.
Example 1
Find the inverse of B=[2 & 0 \ 0 & 7 \end{bmatrix}.
Replace each diagonal entry with its reciprocal:
B^{-1}=[\frac{1}{2} & 0 \ 0 & \frac{1}{7} \end{bmatrix}
Example 2
Find the inverse of D=[2 & 0 \ 0 & 0 \end{bmatrix}. (Watch the tempting move first.)
The instinct is to flip both entries: \frac{1}{2} and \frac{1}{0}.
But \frac{1}{0} is undefined. Check the reason: the second row is all zeros, so the determinant is 2×0=0. A zero determinant means the matrix is singular.
Conclusion: D has no inverse. A diagonal matrix with any zero on its diagonal cannot be inverted.
Example 3
Find the inverse of A=[2 & 0 & 0 \ 0 & -3 & 0 \ 0 & 0 & 5 \end{bmatrix}.
Take the reciprocal of each diagonal entry, carrying the sign:
A^{-1}=[\frac{1}{2} & 0 & 0 \ 0 & -\frac{1}{3} & 0 \ 0 & 0 & \frac{1}{5} \end{bmatrix}
Example 4
Find the inverse of C=[\frac{1}{4} & 0 \ 0 & \frac{2}{3} \end{bmatrix}.
The reciprocal of a fraction flips it:
C^{-1}=[4 & 0 \ 0 & \frac{3}{2} \end{bmatrix}
Example 5
Verify that the inverse of the identity matrix is itself.
The 2×2 identity is diagonal with entries 1 and 1. The reciprocal of 1 is 1:
I^{-1}=[1 & 0 \ 0 & 1 \end{bmatrix} = I
So the identity matrix is its own inverse.
Example 6
A scaling problem: matrix S=[3 & 0 \ 0 & 3 \end{bmatrix}.
Find the matrix that undoes the stretch:
S^{-1}=[\frac{1}{3} & 0 \ 0 & \frac{1}{3} \end{bmatrix}
Multiplying by S^{-1} shrinks each vector back by a factor of 3 — the geometric meaning of the reciprocal.
Why the Reciprocal Rule Works
The rule is not a lucky pattern — it comes straight from what a diagonal matrix does. Reading a diagonal matrix geometrically, it scales the first axis by d_1, the second by d_2, and so on. Its inverse must undo each scaling, and the undo of "multiply by d_i" is "multiply by \frac{1}{d_i}." Nothing gets mixed between axes, which is why the off-diagonal zeros stay zero.
This is where diagonal matrices earn their keep:
- They make computation cheap. Inverting a general n×n matrix is expensive; inverting a diagonal one is n reciprocals. This is a large part of why diagonalisation — rewriting a matrix in a diagonal-friendly basis — matters across linear algebra.
- They model independent scalings. In graphics and data work, a diagonal matrix scales each coordinate on its own, and its inverse rescales them back.
- The zero-on-the-diagonal case flags a collapse. A zero diagonal entry means one direction has been flattened to nothing — information is lost, and no inverse can bring it back.
Where Students Trip Up on the Inverse of a Diagonal Matrix
Mistake 1: Inverting when a diagonal entry is zero
Where it slips in: applying the reciprocal rule on autopilot.
Don't do this: write \frac{1}{0} for a zero diagonal entry and keep going.
The correct way: first check that every diagonal entry is non-zero. If any is zero, the matrix is singular and has no inverse.
Mistake 2: Reciprocating the whole matrix, off-diagonal included
Where it slips in: confusing "reciprocal of the matrix" with "reciprocal of each diagonal entry."
Don't do this: try to take \frac{1}{0} on the off-diagonal zeros too.
The correct way: only the diagonal entries flip; the off-diagonal zeros stay 0. The inverse of a diagonal matrix is still diagonal.
Mistake 3: Dropping the sign
Where it slips in: entries like -3, where the reader takes \frac{1}{3} and forgets the minus.
Don't do this: write the inverse of -3 as \frac{1}{3}.
The correct way: the reciprocal of -3 is -\frac{1}{3} — the sign carries through. This is the same care needed when [solving matrices] with negative entries.
Key Takeaways
- The inverse of a diagonal matrix replaces each diagonal entry d_i with \frac{1}{d_i} and keeps the zeros.
- It exists only if every diagonal entry is non-zero; a single zero makes the matrix singular.
- The inverse of a diagonal matrix is itself diagonal.
- The rule needs no determinant or adjugate — a major computational shortcut.
- Signs carry through, so the reciprocal of -3 is -\frac{1}{3}.
Practice Questions
Find each inverse, or state why it does not exist.
- Invert [4 & 0 \ 0 & 9 \end{bmatrix}.
- Invert [-2 & 0 \ 0 & 5 \end{bmatrix}.
- Invert [3 & 0 \ 0 & 0 \end{bmatrix}.
- Invert [1 & 0 & 0 \ 0 & -6 & 0 \ 0 & 0 & 2 \end{bmatrix}.
- Invert [\frac{2}{5} & 0 \ 0 & 10 \end{bmatrix}.
Answers
- [\frac{1}{4} & 0 \ 0 & \frac{1}{9} \end{bmatrix}
- [-\frac{1}{2} & 0 \ 0 & \frac{1}{5} \end{bmatrix}
- No inverse — the zero on the diagonal makes the matrix singular.
- [1 & 0 & 0 \ 0 & -\frac{1}{6} & 0 \ 0 & 0 & \frac{1}{2} \end{bmatrix}
- [\frac{5}{2} & 0 \ 0 & \frac{1}{10} \end{bmatrix}.