\(\newcommand{L}[1]{\| #1 \|}\newcommand{VL}[1]{\L{ \vec{#1} }}\newcommand{R}[1]{\operatorname{Re}\,(#1)}\newcommand{I}[1]{\operatorname{Im}\, (#1)}\)

Inverse of a diagonal matrix

Let’s say we have a shape (2, 2) diagonal matrix:

\[\begin{split}\newcommand{A}{\boldsymbol A} \newcommand{AI}{\boldsymbol A^{-1}} \newcommand{L}{\boldsymbol L} \newcommand{I}{\boldsymbol I} \A = \begin{bmatrix} p & 0 \\ 0 & q \end{bmatrix}\end{split}\]

We want to find \(\AI\), the left inverse of \(\A\), such that:

\[\I = \AI \A\]

where \(\I\) is a shape (2, 2) identity matrix:

\[\begin{split}\I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\end{split}\]

As always when trying to find the inverse, we are solving a system of simultaneous equations. In the case of a diagonal matrix, the equations are easier to solve because of the zeros off the diagonal.

Write \(\AI\) as:

\[\begin{split}\AI = \begin{bmatrix} a & b \\ c & d \end{bmatrix}\end{split}\]

From the definition of matrix multiplication, we now have:

\[\begin{split}\I = \AI \A = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} p & 0 \\ 0 & q \end{bmatrix} = \begin{bmatrix} a p + b 0 & a 0 + b q \\ c p + d 0 & c 0 + d q \end{bmatrix}\end{split}\]

Comparing \(\I\) with this result, we have:

\[\begin{split}1 = a p + b 0 \\ 0 = a 0 + b q \\ 0 = c p + d 0 \\ 1 = c 0 + d q\end{split}\]

From the central two equations, \(b = c = 0\). Substituting, we have:

\[\begin{split}1 = a p \implies a = \frac{1}{p} \\ 1 = d q \implies d = \frac{1}{q} \\\end{split}\]
\[\begin{split}\AI = \begin{bmatrix} \frac{1}{p} & 0 \\ 0 & \frac{1}{q} \end{bmatrix}\end{split}\]

This result generalizes for any shape (\(n, n\)) diagonal matrix. To see this, consider a shape (3, 3) or larger diagonal matrix, its inverse and the identity. Each zero in the identity matrix requires a zero in the corresponding position in the inverse, otherwise the corresponding row / column dot product will pick up a non-zero value from the diagonal.

\[\begin{split}\boldsymbol D = \begin{bmatrix} d_1 & 0 & 0 & ... & 0 \\ 0 & d_2 & 0 & ... & 0 \\ 0 & 0 & d_3 & ... & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & ... & d_n \end{bmatrix}\end{split}\]
\[\begin{split}\boldsymbol D^{-1} = \begin{bmatrix} \frac{1}{d_1} & 0 & 0 & ... & 0 \\ 0 & \frac{1}{d_2} & 0 & ... & 0 \\ 0 & 0 & \frac{1}{d_3} & ... & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & ... & \frac{1}{d_n} \end{bmatrix}\end{split}\]