Tutorials › Linear Algebra › Inverting a Symmetric Matrix from Its Spectrum

Symmetric Matrices and the Spectral Theorem · Tutorial 744 of 1000

Inverting a Symmetric Matrix from Its Spectrum

Learn how the eigenvalues and eigenspaces of a symmetric matrix determine whether its inverse exists and how to calculate it.

Advanced 11 min read

What You'll Learn

  • State the invertibility test for a real symmetric matrix in terms of its eigenvalues.
  • Derive the inverse from an orthogonal diagonalization.
  • Express the inverse using orthogonal projectors onto eigenspaces.
  • Handle repeated eigenvalues without treating each eigenspace direction differently.
  • Identify why a zero eigenvalue prevents an inverse.
  • Check a proposed inverse by multiplying it by the original matrix.

Why the Spectrum Determines the Inverse

A real symmetric matrix acts in particularly organized directions: the Spectral Theorem says it has an orthonormal basis of eigenvectors. Along each such direction, the matrix simply scales a vector by its eigenvalue. If that scale is nonzero, it can be undone by scaling by its reciprocal. If the scale is zero, a nonzero vector is sent to \(\mathbf{0}\), so the matrix cannot have an inverse. This gives both a test for invertibility and a way to construct the inverse when it exists.

Throughout, let \(\mathbf{A}\in\mathbb{R}^{n\times n}\) be symmetric. An eigenvalue \(\lambda\) of \(\mathbf{A}\) is a scalar for which there is a nonzero vector \(\mathbf{v}\) satisfying \(\mathbf{A}\mathbf{v}=\lambda\mathbf{v}\). The corresponding eigenspace is the set of all such eigenvectors together with \(\mathbf{0}\). By the Spectral Theorem, there is an orthogonal matrix \(\mathbf{Q}\) and a diagonal matrix \(\mathbf{\Lambda}\) such that \(\mathbf{A}=\mathbf{Q}\mathbf{\Lambda}\mathbf{Q}^{\top}\). Orthogonal means \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_n\); the columns of \(\mathbf{Q}\) form an orthonormal eigenbasis, and the diagonal entries of \(\mathbf{\Lambda}\) are the corresponding eigenvalues, listed with their multiplicities.

Theorem: A real symmetric matrix \(\mathbf{A}\in\mathbb{R}^{n\times n}\) is invertible if and only if all its eigenvalues are nonzero. If \(\mathbf{A}=\mathbf{Q}\mathbf{\Lambda}\mathbf{Q}^{\top}\) is an orthogonal diagonalization and all the diagonal entries \(\lambda_1,\dots,\lambda_n\) of \(\mathbf{\Lambda}\) are nonzero, then $$ \mathbf{A}^{-1} =\mathbf{Q}\mathbf{\Lambda}^{-1}\mathbf{Q}^{\top}, \qquad \mathbf{\Lambda}^{-1} =\operatorname{diag}\left(\frac{1}{\lambda_1},\dots,\frac{1}{\lambda_n}\right). $$

Proof. First suppose every eigenvalue is nonzero. Then each diagonal entry of \(\mathbf{\Lambda}\) is nonzero, so the diagonal matrix \(\mathbf{\Lambda}^{-1}\) formed from their reciprocals satisfies \(\mathbf{\Lambda}\mathbf{\Lambda}^{-1}=\mathbf{\Lambda}^{-1}\mathbf{\Lambda}=\mathbf{I}_n\). Since \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{Q}\mathbf{Q}^{\top}=\mathbf{I}_n\), multiplication gives $$ \mathbf{A}\bigl(\mathbf{Q}\mathbf{\Lambda}^{-1}\mathbf{Q}^{\top}\bigr) =\mathbf{Q}\mathbf{\Lambda}\mathbf{Q}^{\top}\mathbf{Q}\mathbf{\Lambda}^{-1}\mathbf{Q}^{\top} =\mathbf{Q}\mathbf{I}_n\mathbf{Q}^{\top} =\mathbf{I}_n. $$ Multiplying in the opposite order gives $$ \bigl(\mathbf{Q}\mathbf{\Lambda}^{-1}\mathbf{Q}^{\top}\bigr)\mathbf{A} =\mathbf{Q}\mathbf{\Lambda}^{-1}\mathbf{Q}^{\top}\mathbf{Q}\mathbf{\Lambda}\mathbf{Q}^{\top} =\mathbf{Q}\mathbf{I}_n\mathbf{Q}^{\top} =\mathbf{I}_n. $$ Thus the displayed matrix is an inverse. Conversely, if \(\mathbf{A}\) has a zero eigenvalue, there is a nonzero \(\mathbf{v}\) with \(\mathbf{A}\mathbf{v}=\mathbf{0}\). If an inverse existed, then \(\mathbf{v}=\mathbf{A}^{-1}\mathbf{A}\mathbf{v}=\mathbf{A}^{-1}\mathbf{0}=\mathbf{0}\), contradicting \(\mathbf{v}\ne\mathbf{0}\). Hence \(\mathbf{A}\) is not invertible. \(\square\)

Calculating the Inverse from an Eigenbasis

Worked Example: Two Distinct Eigenvalues

Let $$ \mathbf{Q}=\frac{1}{\sqrt{2}}\begin{bmatrix}1&1\\1&-1\end{bmatrix}, \qquad \mathbf{\Lambda}=\begin{bmatrix}2&0\\0&5\end{bmatrix}, \qquad \mathbf{A}=\mathbf{Q}\mathbf{\Lambda}\mathbf{Q}^{\top}. $$ The columns of \(\mathbf{Q}\) are orthonormal, so \(\mathbf{Q}^{\top}=\mathbf{Q}^{-1}\). Multiplying out the diagonalization gives $$ \mathbf{A} =\begin{bmatrix}7/2&-3/2\\-3/2&7/2\end{bmatrix}. $$ Both eigenvalues are nonzero. Replace \(2\) and \(5\) by \(1/2\) and \(1/5\), respectively: $$ \mathbf{A}^{-1} =\mathbf{Q}\begin{bmatrix}1/2&0\\0&1/5\end{bmatrix}\mathbf{Q}^{\top} =\begin{bmatrix}7/20&3/20\\3/20&7/20\end{bmatrix}. $$

Check: Multiplying the proposed inverse by \(\mathbf{A}\), the diagonal entries of the product are \(49/40-9/40=1\), and the off-diagonal entries are \(21/40-21/40=0\). Therefore $$ \mathbf{A}\mathbf{A}^{-1} =\begin{bmatrix}1&0\\0&1\end{bmatrix}. $$ The reciprocal-eigenvalue calculation gives an actual inverse.

The same calculation can be written in terms of eigenspaces, which is useful when an eigenvalue is repeated. For each distinct eigenvalue \(\lambda\), let \(\mathbf{P}_{\lambda}\) be the orthogonal projector onto its eigenspace. In the spectral decomposition, these projectors satisfy \(\mathbf{P}_{\lambda}^{\top}=\mathbf{P}_{\lambda}\), \(\mathbf{P}_{\lambda}^2=\mathbf{P}_{\lambda}\), \(\mathbf{P}_{\lambda}\mathbf{P}_{\mu}=\mathbf{O}\) for \(\lambda\ne\mu\), and their sum is \(\mathbf{I}_n\). The matrix can then be written \(\mathbf{A}=\sum_{\lambda}\lambda\mathbf{P}_{\lambda}\), where the sum runs over its distinct eigenvalues.

Corollary: If every eigenvalue of a real symmetric matrix \(\mathbf{A}\) is nonzero, then $$ \mathbf{A}^{-1}=\sum_{\lambda}\frac{1}{\lambda}\mathbf{P}_{\lambda}. $$ Here the sum is over distinct eigenvalues, and \(\mathbf{P}_{\lambda}\) projects onto the entire eigenspace \(E_{\lambda}\).

Proof. Multiply \(\mathbf{A}=\sum_{\lambda}\lambda\mathbf{P}_{\lambda}\) by the proposed expression. Distributing the product gives terms \(\lambda\mu^{-1}\mathbf{P}_{\lambda}\mathbf{P}_{\mu}\). If \(\lambda\ne\mu\), the projector product is \(\mathbf{O}\); if \(\lambda=\mu\), the term is \(\mathbf{P}_{\lambda}\). Thus $$ \mathbf{A}\left(\sum_{\mu}\frac{1}{\mu}\mathbf{P}_{\mu}\right) =\sum_{\lambda}\mathbf{P}_{\lambda} =\mathbf{I}_n. $$ Reversing the order of the factors gives the same result, because the projectors are pairwise orthogonal and the scalar coefficients commute. The proposed matrix is therefore \(\mathbf{A}^{-1}\). \(\square\)

Worked Example: A Repeated Eigenvalue

Consider $$ \mathbf{A}=\begin{bmatrix}1&-1&-1\\-1&1&-1\\-1&-1&1\end{bmatrix}. $$ Let \(\mathbf{w}=(1,1,1)^{\top}/\sqrt{3}\). Since \(\mathbf{w}^{\top}\mathbf{w}=1\), the projector onto its span is \(\mathbf{P}_{-1}=\mathbf{w}\mathbf{w}^{\top}\). Direct multiplication gives \(\mathbf{A}\mathbf{w}=-\mathbf{w}\), so the eigenvalue on this one-dimensional space is \(-1\). For any vector \(\mathbf{x}=(x_1,x_2,x_3)^{\top}\) with \(x_1+x_2+x_3=0\), multiplication gives \(\mathbf{A}\mathbf{x}=2\mathbf{x}\). That plane is the orthogonal complement of \(\mathbf{w}\), so its projector is \(\mathbf{P}_2=\mathbf{I}_3-\mathbf{P}_{-1}\). The eigenvalue \(2\) is repeated, but its full eigenspace is handled by one projector.

Both eigenvalues are nonzero. The projector formula gives $$ \begin{aligned} \mathbf{A}^{-1} &=-\mathbf{P}_{-1}+\frac{1}{2}\mathbf{P}_2\\ &=\frac{1}{2}\mathbf{I}_3-\frac{3}{2}\mathbf{w}\mathbf{w}^{\top}\\ &=\begin{bmatrix}0&-1/2&-1/2\\-1/2&0&-1/2\\-1/2&-1/2&0\end{bmatrix}. \end{aligned} $$

Check: The first row of \(\mathbf{A}\) times the first, second, and third columns of the proposed inverse gives \(1\), \(0\), and \(0\), respectively: the three calculations are \(1/2+1/2=1\), \(-1/2+1/2=0\), and \(-1/2+1/2=0\). The matrix and its proposed inverse are both symmetric, and their product has all diagonal entries \(1\) and all off-diagonal entries \(0\). Hence \(\mathbf{A}\mathbf{A}^{-1}=\mathbf{I}_3\).

What Zero Eigenvalues Change

If zero is among the eigenvalues, reciprocating every eigenvalue is impossible. The failure is not just a missing arithmetic value: a zero eigenvalue means there is a nonzero direction that the matrix collapses to \(\mathbf{0}\). An inverse would have to recover that direction from \(\mathbf{0}\), which cannot be done by a function that undoes the matrix on every vector.

Worked Example: A Matrix with a Zero Eigenvalue

Consider the symmetric matrix $$ \mathbf{A}=\begin{bmatrix}1&1&0\\1&1&0\\0&0&3\end{bmatrix}. $$ For \(\mathbf{v}_0=(1,-1,0)^{\top}\), \(\mathbf{v}_2=(1,1,0)^{\top}\), and \(\mathbf{v}_3=(0,0,1)^{\top}\), direct multiplication gives $$ \mathbf{A}\mathbf{v}_0=\mathbf{0},\qquad \mathbf{A}\mathbf{v}_2=2\mathbf{v}_2,\qquad \mathbf{A}\mathbf{v}_3=3\mathbf{v}_3. $$ Thus the eigenvalues are \(0,2,3\), and \(\mathbf{v}_0\ne\mathbf{0}\) is sent to \(\mathbf{0}\). The theorem shows that \(\mathbf{A}\) has no inverse.

Check: The first calculation is \((1-1,1-1,0)^{\top}=(0,0,0)^{\top}\), so the nonzero vector \(\mathbf{v}_0\) really is in the null space. This directly rules out an inverse.

There is a useful related way to see the obstruction. In an orthonormal eigenbasis, the equation \(\mathbf{A}\mathbf{x}=\mathbf{b}\) asks for each eigenvector component of \(\mathbf{b}\) to be produced by scaling the corresponding component of \(\mathbf{x}\). On a zero-eigenvalue direction, the matrix always produces component zero. Therefore \(\mathbf{b}\) must have zero component in every such direction for a solution to exist.

Proposition: Let \(\mathbf{A}\in\mathbb{R}^{n\times n}\) be symmetric, and let \(\mathbf{P}_0\) denote the orthogonal projector onto its zero eigenspace (take \(\mathbf{P}_0=\mathbf{O}\) if zero is not an eigenvalue). The equation \(\mathbf{A}\mathbf{x}=\mathbf{b}\) has a solution if and only if \(\mathbf{P}_0\mathbf{b}=\mathbf{0}\).

Proof. Write \(\mathbf{A}=\sum_{\lambda}\lambda\mathbf{P}_{\lambda}\) using its distinct eigenvalues, including zero if it is an eigenvalue. If \(\mathbf{A}\mathbf{x}=\mathbf{b}\), then applying \(\mathbf{P}_0\) to both sides gives \(\mathbf{P}_0\mathbf{b}=\mathbf{P}_0\mathbf{A}\mathbf{x}\). The projector identities imply \(\mathbf{P}_0\mathbf{A}=\mathbf{0}\), so \(\mathbf{P}_0\mathbf{b}=\mathbf{0}\). Conversely, suppose \(\mathbf{P}_0\mathbf{b}=\mathbf{0}\). Define $$ \mathbf{x}=\sum_{\lambda\ne0}\frac{1}{\lambda}\mathbf{P}_{\lambda}\mathbf{b}. $$ Then $$ \mathbf{A}\mathbf{x} =\sum_{\lambda\ne0}\mathbf{P}_{\lambda}\mathbf{b} =\left(\mathbf{I}_n-\mathbf{P}_0\right)\mathbf{b} =\mathbf{b}. $$ The second equality uses that the projectors sum to \(\mathbf{I}_n\); the last uses the assumption \(\mathbf{P}_0\mathbf{b}=\mathbf{0}\). Hence a solution exists. \(\square\)

Common Pitfall: Omitting the Zero Direction

A tempting but incorrect procedure is to discard a zero eigenvalue, reciprocate the remaining eigenvalues, and call the result an inverse. For the matrix in the previous example, let \(\mathbf{u}_0=\mathbf{v}_0/\sqrt{2}\), \(\mathbf{u}_2=\mathbf{v}_2/\sqrt{2}\), and \(\mathbf{u}_3=\mathbf{v}_3\). If we use only the nonzero eigenspaces, the resulting matrix is $$ \mathbf{B}=\frac{1}{2}\mathbf{u}_2\mathbf{u}_2^{\top}+\frac{1}{3}\mathbf{u}_3\mathbf{u}_3^{\top} =\begin{bmatrix}1/4&1/4&0\\1/4&1/4&0\\0&0&1/3\end{bmatrix}. $$ But multiplication gives $$ \mathbf{A}\mathbf{B} =\begin{bmatrix}1/2&1/2&0\\1/2&1/2&0\\0&0&1\end{bmatrix} \ne\mathbf{I}_3. $$ The product is zero on the missing eigenvector direction rather than acting as the identity there. So \(\mathbf{B}\) is not an inverse. The rule is strict: reciprocating the eigenvalues gives an inverse only when none of them is zero.

Using the Spectral Test Reliably

To apply the method, first obtain an orthogonal diagonalization or enough spectral information to identify the eigenvalues and their eigenspaces. If any eigenvalue is zero, stop: the matrix has no inverse. If all are nonzero, replace each eigenvalue by its reciprocal while keeping the same orthonormal eigenvectors. With projectors, use one term per distinct eigenvalue and project onto its entire eigenspace; do not omit a repeated direction. Finally, multiply the proposed matrix by the original matrix to check that the product is \(\mathbf{I}_n\).

The eigenbasis description also explains why the formula is independent of the choice of orthonormal basis within a repeated eigenspace. Every vector in that eigenspace receives the same scale \(\lambda\), and the inverse gives every such vector the same scale \(1/\lambda\). The projector onto the whole eigenspace records that action without privileging any particular orthonormal basis inside it.

Check Your Understanding

Use the eigenvalues and eigenspaces, and verify any proposed inverse by multiplication.

  1. A symmetric matrix has eigenvalues \(2\), \(2\), and \(-4\). Is it invertible, and what eigenvalues does its inverse have on the same eigenspaces?
  2. For a symmetric matrix with eigenvalues \(0\) and \(5\), explain why no inverse can exist.
  3. State the projector formula for the inverse when the distinct eigenvalues are all nonzero.
  4. For a symmetric matrix with a zero eigenspace, what condition must \(\mathbf{b}\) satisfy for \(\mathbf{A}\mathbf{x}=\mathbf{b}\) to have a solution?
  5. Explain why reciprocating only the nonzero eigenvalues does not produce an inverse when zero is also an eigenvalue.

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