Tutorials › Linear Algebra › Constructing Symmetric Matrices from Eigenvalue Data

Symmetric Matrices and the Spectral Theorem · Tutorial 748 of 1000

Constructing Symmetric Matrices from Eigenvalue Data

Build and verify symmetric matrices from orthonormal eigenvectors and real eigenvalues, while keeping eigenvector–eigenvalue pairings consistent.

Advanced 9 min read

What You'll Learn

  • Form \(Q\) from orthonormal eigenvectors and \(D\) from their paired eigenvalues.
  • Compute \(QDQ^{\top}\) with exact arithmetic.
  • Prove that the constructed matrix is symmetric and has the specified eigenpairs.
  • Recognize when a full orthonormal eigenbasis determines a matrix uniquely.
  • Track how signs and simultaneous permutations affect the construction.
  • Understand why changing basis within a repeated-eigenvalue eigenspace leaves the matrix unchanged.

From Eigenvalue Data to a Matrix

Eigenvalue problems are often presented in the forward direction: given a matrix, find its eigenvalues and eigenvectors. The reverse direction is also useful. If we choose real eigenvalues and an orthonormal basis of eigenvectors, we can construct a matrix that has exactly those eigenpairs. The construction also makes symmetry visible and provides a direct way to check how the matrix changes—or does not change—when the eigenvectors are represented differently.

Throughout, the matrices are real. A list \(\mathbf{q}_1,\dots,\mathbf{q}_n\) is an orthonormal basis of \(\mathbb{R}^n\) when \(\mathbf{q}_i^{\top}\mathbf{q}_j=0\) for \(i\ne j\), \(\mathbf{q}_i^{\top}\mathbf{q}_i=1\), and the list is a basis. Put these vectors in order as the columns of \(\mathbf{Q}\). Then \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_n\); a square matrix with this property is called orthogonal. Put the real numbers \(\lambda_1,\dots,\lambda_n\) in a diagonal matrix \(\mathbf{D}\), in the same order as their corresponding vectors.

Definition: Given an orthonormal basis \(\mathbf{q}_1,\dots,\mathbf{q}_n\) of \(\mathbb{R}^n\) and prescribed real numbers \(\lambda_1,\dots,\lambda_n\), the matrix constructed from this paired data is \(\mathbf{A}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\), where \(\mathbf{Q}=[\mathbf{q}_1\ \cdots\ \mathbf{q}_n]\) and \(\mathbf{D}=\operatorname{diag}(\lambda_1,\dots,\lambda_n)\).

The order of the data matters: the \(j\)th diagonal entry of \(\mathbf{D}\) is paired with the \(j\)th column of \(\mathbf{Q}\). A correct construction therefore begins by deciding which eigenvalue belongs to each chosen eigenvector. The following result explains why the formula works and when the full data determine the matrix uniquely.

Theorem: Let \(\mathbf{q}_1,\dots,\mathbf{q}_n\) be an orthonormal basis of \(\mathbb{R}^n\), and let \(\lambda_1,\dots,\lambda_n\in\mathbb{R}\). If \(\mathbf{Q}\) has these vectors as its columns and \(\mathbf{D}=\operatorname{diag}(\lambda_1,\dots,\lambda_n)\), then \(\mathbf{A}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\) is symmetric and satisfies \(\mathbf{A}\mathbf{q}_j=\lambda_j\mathbf{q}_j\) for every \(j\). Moreover, it is the unique matrix that satisfies all these eigenvector equations.

Proof. Since \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_n\), the columns of \(\mathbf{Q}\) form a basis and \(\mathbf{Q}\mathbf{Q}^{\top}=\mathbf{I}_n\) as well. The matrix \(\mathbf{D}\) is diagonal with real entries, so \(\mathbf{D}^{\top}=\mathbf{D}\). Therefore \((\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top})^{\top}=\mathbf{Q}\mathbf{D}^{\top}\mathbf{Q}^{\top}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\), proving symmetry. For each \(j\), \(\mathbf{Q}^{\top}\mathbf{q}_j=\mathbf{e}_j\), where \(\mathbf{e}_j\) is the \(j\)th standard basis vector. Thus \(\mathbf{A}\mathbf{q}_j=\mathbf{Q}\mathbf{D}\mathbf{e}_j=\lambda_j\mathbf{Q}\mathbf{e}_j=\lambda_j\mathbf{q}_j\). To prove uniqueness, let \(\mathbf{B}\) be any matrix satisfying \(\mathbf{B}\mathbf{q}_j=\lambda_j\mathbf{q}_j\) for all \(j\). Collecting these equations as columns gives \(\mathbf{B}\mathbf{Q}=\mathbf{Q}\mathbf{D}\). Multiplying on the right by \(\mathbf{Q}^{\top}\) gives \(\mathbf{B}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\). Hence no other matrix satisfies all the prescribed equations. \(\square\)

The formula can also be read as a sequence of operations: \(\mathbf{Q}^{\top}\) takes coordinates in the orthonormal eigenvector basis, \(\mathbf{D}\) multiplies each coordinate by its assigned eigenvalue, and \(\mathbf{Q}\) returns to standard coordinates. This interpretation helps keep the order and pairing straight.

Constructing and Checking the Matrix

Worked Example: A Two-Dimensional Construction

Construct the symmetric matrix whose eigenvectors are \(\mathbf{q}_1=(1,1)^{\top}/\sqrt{2}\) and \(\mathbf{q}_2=(-1,1)^{\top}/\sqrt{2}\), with corresponding eigenvalues \(5\) and \(1\).

The two vectors have length \(1\), since each squared length is \((1+1)/2=1\), and their dot product is \((-1+1)/2=0\). Thus they are an orthonormal basis. Use them as the columns of \(\mathbf{Q}\), keeping the eigenvalues in matching order in \(\mathbf{D}\):

$$ \mathbf{Q}=\frac{1}{\sqrt{2}} \begin{bmatrix}1&-1\\1&1\end{bmatrix}, \qquad \mathbf{D}=\begin{bmatrix}5&0\\0&1\end{bmatrix}. $$

First multiply \(\mathbf{Q}\mathbf{D}\), which scales its first column by \(5\) and its second column by \(1\). Then multiply by \(\mathbf{Q}^{\top}\):

$$ \mathbf{Q}\mathbf{D}\mathbf{Q}^{\top} =\frac12 \begin{bmatrix}5&-1\\5&1\end{bmatrix} \begin{bmatrix}1&1\\-1&1\end{bmatrix} =\frac12\begin{bmatrix}6&4\\4&6\end{bmatrix} =\begin{bmatrix}3&2\\2&3\end{bmatrix}. $$

Check: Multiplying the result by \(\mathbf{q}_1\) gives \((5,5)^{\top}/\sqrt{2}=5\mathbf{q}_1\). Multiplying by \(\mathbf{q}_2\) gives \((-1,1)^{\top}/\sqrt{2}=\mathbf{q}_2\). The matrix is symmetric because its two off-diagonal entries are both \(2\), as the theorem also guarantees.

Worked Example: Three Eigenvectors in \(\mathbb{R}^3\)

Construct the matrix for \(\mathbf{q}_1=(1,1,0)^{\top}/\sqrt{2}\), \(\mathbf{q}_2=(1,-1,0)^{\top}/\sqrt{2}\), and \(\mathbf{q}_3=(0,0,1)^{\top}\), assigned eigenvalues \(4,1,-2\), respectively.

The first two vectors have length \(1\) and dot product \(0\). Each is orthogonal to \(\mathbf{q}_3\), whose length is also \(1\). They therefore form an orthonormal basis. The corresponding matrices and their product are

$$ \mathbf{Q}=\frac{1}{\sqrt{2}} \begin{bmatrix}1&1&0\\1&-1&0\\0&0&\sqrt{2}\end{bmatrix}, \qquad \mathbf{D}=\begin{bmatrix}4&0&0\\0&1&0\\0&0&-2\end{bmatrix}, $$
$$ \mathbf{A}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top} =\begin{bmatrix}\tfrac52&\tfrac32&0\\[2pt]\tfrac32&\tfrac52&0\\[2pt]0&0&-2\end{bmatrix}. $$

Check: The first row and column block sends \((1,1)^{\top}\) to \((4,4)^{\top}\), so \(\mathbf{A}\mathbf{q}_1=4\mathbf{q}_1\). It sends \((1,-1)^{\top}\) to \((1,-1)^{\top}\), so \(\mathbf{A}\mathbf{q}_2=\mathbf{q}_2\). Finally, \(\mathbf{A}\mathbf{q}_3=(0,0,-2)^{\top}=-2\mathbf{q}_3\). The computed matrix is symmetric, and each chosen eigenvalue is verified against its paired vector.

Signs, Ordering, and Repeated Eigenvalues

Changing the sign of an eigenvector does not change the matrix, provided its eigenvalue stays paired with it. Reordering the data also leaves the matrix unchanged when each eigenvalue moves together with its eigenvector. These facts follow from a single invariance principle.

Theorem: Let \(\mathbf{Q}\) be orthogonal and \(\mathbf{D}\) be real diagonal. If \(\mathbf{U}\) is orthogonal and \(\mathbf{U}\mathbf{D}=\mathbf{D}\mathbf{U}\), then \((\mathbf{Q}\mathbf{U})\mathbf{D}(\mathbf{Q}\mathbf{U})^{\top}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\). In particular, changing signs of eigenvectors leaves the construction unchanged; simultaneously permuting the eigenvectors and their eigenvalues also leaves it unchanged.

Proof. Since \(\mathbf{U}\) is orthogonal, \(\mathbf{U}\mathbf{U}^{\top}=\mathbf{I}_n\). The proposed construction is \(\mathbf{Q}\mathbf{U}\mathbf{D}\mathbf{U}^{\top}\mathbf{Q}^{\top}\). From \(\mathbf{U}\mathbf{D}=\mathbf{D}\mathbf{U}\), multiplying on the left by \(\mathbf{U}^{\top}\) gives \(\mathbf{D}=\mathbf{U}^{\top}\mathbf{D}\mathbf{U}\); multiplying this equality on the right by \(\mathbf{U}^{\top}\) gives \(\mathbf{D}\mathbf{U}^{\top}=\mathbf{U}^{\top}\mathbf{D}\). Consequently \(\mathbf{U}\mathbf{D}\mathbf{U}^{\top}=\mathbf{D}\mathbf{U}\mathbf{U}^{\top}=\mathbf{D}\), proving the claimed equality. For sign changes, take \(\mathbf{U}\) diagonal with entries \(1\) or \(-1\); it commutes with diagonal \(\mathbf{D}\). For a permutation, let \(\mathbf{P}\) be the matrix that permutes standard basis vectors, take \(\mathbf{Q}'=\mathbf{Q}\mathbf{P}\), and move the diagonal entries with them by setting \(\mathbf{D}'=\mathbf{P}^{\top}\mathbf{D}\mathbf{P}\). Then \(\mathbf{Q}'\mathbf{D}'\mathbf{Q}'^{\top}=\mathbf{Q}\mathbf{P}\mathbf{P}^{\top}\mathbf{D}\mathbf{P}\mathbf{P}^{\top}\mathbf{Q}^{\top}=\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\). \(\square\)

If an eigenvalue is repeated, the choice of orthonormal basis within its eigenspace can change as well. A change of orthonormal basis within that eigenspace acts by an orthogonal transformation on the corresponding columns. Because the associated diagonal entries of \(\mathbf{D}\) are equal, that transformation commutes with \(\mathbf{D}\), so the theorem shows that the constructed matrix is unchanged.

Worked Example: A Repeated Eigenvalue

Take eigenvalues \(3,3,-1\). One orthonormal eigenvector basis is the standard basis, which gives \(\mathbf{Q}=\mathbf{I}_3\) and \(\mathbf{A}=\operatorname{diag}(3,3,-1)\). Instead, choose the first two vectors to be \((1,1,0)^{\top}/\sqrt{2}\) and \((1,-1,0)^{\top}/\sqrt{2}\), and keep \((0,0,1)^{\top}\) as the third vector. These are still orthonormal, and the assigned eigenvalues remain \(3,3,-1\).

The first two columns now have different directions, but their equal eigenvalues make their combined contribution unchanged. Directly, the matrix is

$$ 3\begin{bmatrix}\tfrac12&\tfrac12&0\\\tfrac12&\tfrac12&0\\0&0&0\end{bmatrix} +3\begin{bmatrix}\tfrac12&-\tfrac12&0\\-\tfrac12&\tfrac12&0\\0&0&0\end{bmatrix} -\begin{bmatrix}0&0&0\\0&0&0\\0&0&1\end{bmatrix} =\begin{bmatrix}3&0&0\\0&3&0\\0&0&-1\end{bmatrix}. $$

Check: The displayed result sends each of the first two chosen vectors to three times itself, and sends \((0,0,1)^{\top}\) to \(-1\) times itself. Thus the alternative orthonormal basis gives the same matrix and satisfies all three eigenvector equations.

A Pairing Mistake to Avoid

It is not enough to permute the columns of \(\mathbf{Q}\) while leaving the diagonal entries of \(\mathbf{D}\) fixed. That changes which eigenvalue is assigned to each direction. For the two-dimensional example above, swap the columns of \(\mathbf{Q}\) but keep \(\mathbf{D}=\operatorname{diag}(5,1)\). The resulting matrix is \(\begin{bmatrix}3&-2\\-2&3\end{bmatrix}\), not the original \(\begin{bmatrix}3&2\\2&3\end{bmatrix}\). Indeed, the new first column is the old \(\mathbf{q}_2\), so the new matrix multiplies that vector by \(5\) rather than \(1\).

The correction is to swap the diagonal entries at the same time: use \(\mathbf{D}'=\operatorname{diag}(1,5)\). Then the original vector–eigenvalue pairings are restored, and the formula returns \(\begin{bmatrix}3&2\\2&3\end{bmatrix}\). A useful final audit is to check that the columns of \(\mathbf{Q}\) are orthonormal, that \(\mathbf{D}\) lists the eigenvalues in matching order, and that multiplication confirms \(\mathbf{A}\mathbf{q}_j=\lambda_j\mathbf{q}_j\) for each column.

The Spectral Theorem states that every real symmetric matrix has an orthonormal basis of real eigenvectors. Its proof comes in the earlier material on the Spectral Theorem. The construction here gives the reverse direction directly: any chosen real eigenvalues paired with an orthonormal basis produce a real symmetric matrix. Thus the formula is both a practical construction and a precise description of how a full set of orthonormal eigenpair data determines a matrix.

Check Your Understanding

For each question, keep the eigenvalue–eigenvector pairing explicit and verify any proposed matrix by multiplication.

  1. Construct the symmetric matrix with eigenvectors \((1,1)^{\top}/\sqrt{2}\) and \((1,-1)^{\top}/\sqrt{2}\), paired with eigenvalues \(2\) and \(6\).
  2. Explain why changing the sign of one column of an orthogonal \(\mathbf{Q}\) does not change \(\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\).
  3. In a simultaneous permutation of eigenvectors and eigenvalues, how must the diagonal matrix \(\mathbf{D}\) change?
  4. For \(\mathbf{D}=\operatorname{diag}(4,4,1)\), explain why an orthogonal change among the first two eigenvectors leaves the constructed matrix unchanged.
  5. Give a direct reason that a matrix satisfying \(\mathbf{A}\mathbf{q}_j=\lambda_j\mathbf{q}_j\) for every vector in an orthonormal basis must equal \(\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}\).

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