Linear Algebra / Unit 7, Symmetric Matrices / Topic 7.1
Unit 7. Symmetric Matrices
A symmetric matrix is equal to its transpose. This topic shows three facts about a symmetric matrix with real entries. Its eigenvalues are real numbers, its eigenvectors can be chosen perpendicular to each other, and it can be diagonalized by an orthogonal matrix. Together, the three facts are called the spectral theorem.
You need Topics 3.3, 5.1, 5.3, 6.1, and 6.3 for this topic.
From Topic 3.3, a matrix A is symmetric when AT = A. The entry in row i and column j is equal to the entry in row j and column i. In this unit, all matrices have real entries.
Topic 5.2 showed that a real matrix can have complex eigenvalues, and Topic 5.3 showed that some matrices cannot be diagonalized. A symmetric matrix has neither difficulty.
Topic 5.1 found the eigenvalues 3 and 1 of this matrix, with the eigenvectors (1, 1) and (1, −1). Both eigenvalues are real. The dot product of the two eigenvectors is 1 − 1 = 0, so they are perpendicular.
The rule of Topic 3.3 moves a matrix across a dot product as its transpose. For a symmetric matrix the transpose is the matrix itself.
(Ax) · y = x · (Ay)Let x and y be eigenvectors with the different eigenvalues λ₁ and λ₂. Put Ax = λ₁x on the left side and Ay = λ₂y on the right side.
λ₁(x · y) = λ₂(x · y) so (λ₁ − λ₂)(x · y) = 0The two eigenvalues are different, so λ₁ − λ₂ is not zero. The dot product x · y must be zero.
For a 2 by 2 matrix, Topic 5.2 found the eigenvalues from the trace T and the determinant D. The eigenvalues are real when T² − 4D is not negative. For the symmetric matrix with the rows a, b and b, d,
T² − 4D = (a + d)² − 4(ad − b²)the trace is a + d, and the determinant is ad − b²T² − 4D = (a − d)² + 4b²multiply out and collect the termsA sum of two squares is never negative, so the eigenvalues are real. The proof for larger matrices uses complex numbers, and Topic 8.3 gives it.
A symmetric matrix always has a full set of n independent eigenvectors, even when an eigenvalue is repeated. Part 4 looks at repeated eigenvalues. Topic 8.5 returns to the proof.
Divide each eigenvector by its length, and put the unit eigenvectors q₁, …, qₙ in the columns of a matrix Q. The columns are orthonormal, so Q is an orthogonal matrix. Put the eigenvalues, in the same order, on the diagonal of a matrix Λ.
The spectral theorem. Each symmetric matrix A with real entries can be written as A = QΛQT, where Q is an orthogonal matrix whose columns are eigenvectors of A, and Λ is a diagonal matrix that holds the eigenvalues.
Compare this with the diagonalization A = XΛX⁻¹ of Topic 5.3. For a symmetric matrix the eigenvector matrix can be chosen orthogonal, and then its inverse is its transpose. No inverse has to be calculated.
The eigenvectors (1, 1) and (1, −1) both have the length √2.
Q = 1/√2 111−1 Λ = 3001 QΛQT = 1/2 111−1 3001 111−1the two factors 1/√2 give 1/2QΛQT = 1/2 313−1 111−1multiply the first two matricesQΛQT = 2112multiply by the third matrixThe statement also works in the other direction. A product QΛQT with an orthogonal Q and a diagonal Λ is always symmetric, because its transpose is (QT)TΛTQT = QΛQT. The symmetric matrices are exactly the real matrices that have an orthonormal basis of eigenvectors with real eigenvalues.
The set of eigenvalues of a matrix is called its spectrum, which is where the name of the theorem comes from.
When an eigenvalue is repeated, its eigenvectors fill a plane or a larger subspace, which Topic 5.1 called the eigenspace. A symmetric matrix always has an eigenspace as large as the number of repeats. Any orthonormal basis of the eigenspace can be used for the columns of Q, so Q is not unique.
A = 200020005The eigenvalue 2 is repeated twice, and its eigenspace is the xy-plane. The vectors (1, 0, 0) and (0, 1, 0) are one choice of two perpendicular unit eigenvectors. The vectors (1, 1, 0)/√2 and (1, −1, 0)/√2 are another choice. The eigenspace of the eigenvalue 5 is the z-axis, which is perpendicular to the plane.
If the eigenvectors that you find in a repeated eigenspace are not perpendicular, use the Gram-Schmidt process of Topic 6.2 inside that eigenspace.
From Topic 6.1, the matrix qqT projects each vector onto the line of the unit vector q. Multiplying out QΛQT column by column gives a sum with one term for each eigenvector.
A = λ₁q₁q₁T + λ₂q₂q₂T + … + λₙqₙqₙTThe matrix A projects a vector onto each eigenvector line, multiplies each projection by the eigenvalue of that line, and adds the results.
For the example, q₁ = (1, 1)/√2 and q₂ = (1, −1)/√2.
3q₁q₁T + 1q₂q₂T = 3/2 1111 + 1/2 1−1−11each term is an eigenvalue times a projection3q₁q₁T + 1q₂q₂T = 2112add the matching entriesQuantum mechanics writes each measurable quantity in this form, as a sum of eigenvalues times projections. Topic 9.2 develops this.
The eigenvectors of a symmetric matrix give a set of perpendicular axes. Along each axis, the map multiplies lengths by the eigenvalue of that axis. A symmetric map is a stretch along perpendicular directions, with no rotation of those directions. The unit circle goes to an ellipse whose axes lie along the eigenvectors, and the half-lengths of the axes are the sizes of the eigenvalues.
Try it: the eigenvector lines of a matrix
The sliders set the entries of the matrix with the rows a, b and c, d. The gray circle is the unit circle, and the green curve is its image under the matrix. The blue line and the red line are the eigenvector lines, and each arrow shows where the matrix sends the unit eigenvector of that line. Clear the check box to set c separately from b, and compare a matrix that is not symmetric.
In each case, the eigenvectors give perpendicular axes in which the problem separates into independent parts.
| Fact | Statement |
|---|---|
| Symmetric matrix | AT = A |
| Eigenvalues | All real |
| Eigenvectors | Perpendicular for different eigenvalues, and a full orthonormal set always exists |
| Spectral theorem | A = QΛQT with an orthogonal matrix Q |
| Sum of projections | A = λ₁q₁q₁T + … + λₙqₙqₙT |
| The map | A stretch along perpendicular axes |
Work each problem on paper first. Then open the answer to check your work.
λ² − 2λ − 3 = 0the trace is 2 and the determinant is −3(λ − 3)(λ + 1) = 0factor
The eigenvalues are 3 and −1. For 3, the eigenvector is (1, 1), and the unit eigenvector is (1, 1)/√2. For −1, the unit eigenvector is (1, −1)/√2.
The trace is 7 and the determinant is 6, so the eigenvalues are 6 and 1.
For 6, the equations give x = 2y, so the eigenvector is (2, 1). For 1, the equations give y = −2x, so the eigenvector is (1, −2). Both have the length √5.
Q = (1/√5) 211−2 and Λ = 6001.
The matrix is triangular, so the eigenvalues are 2 and 3. The eigenvectors are (1, 0) and (1, 1).
Their dot product is 1, so they are not perpendicular.
Use the sum of projections with q₁ = (1, 1)/√2 and q₂ = (1, −1)/√2.
A = 4/2 1111 + 2/2 1−1−11each eigenvalue times its projectionA = 3113add the matching entries
The transpose of a product reverses the order.
(BTB)T = BT(BT)Tthe transposes in the reverse order(BTB)T = BTBthe transpose of a transpose is the original matrix
The matrix is equal to its transpose, so it is symmetric. Topics 7.2 and 7.3 use this matrix.
For 3, the eigenvector is (1, 1, 1). For 0, the eigenvectors are the solutions of x + y + z = 0, which is a plane.
The plane is perpendicular to (1, 1, 1). Two perpendicular vectors in the plane are (1, −1, 0) and (1, 1, −2).
Topic 5.1 used the instruction np.linalg.eig. For a symmetric matrix, the instruction np.linalg.eigh is the better choice. It gives the eigenvalues in order from the smallest to the largest, and it gives eigenvectors that are already orthonormal. As before, the eigenvectors are the columns of the second result.
Python
The eigenvalues are 1 and 3. The columns of Q are the unit eigenvectors, with the entries 0.707 or −0.707, which is 1/√2. Python can give an eigenvector with the opposite sign. Both signs are correct.
Now find the eigenvalues of the matrix of Practice Problem 2, with the rows 5, 2 and 2, 2.
Python
From Topic 6.3, a matrix Q is orthogonal when QTQ is the identity matrix. The instruction np.round rounds the result, so that very small rounding errors show as 0.
Python
The result is the identity matrix, so the eigenvectors are orthonormal.
The instruction np.diag(w) makes a diagonal matrix from the list of eigenvalues. The product QΛQT should give the matrix A back.
Python
The result is the matrix A. No inverse was needed.
The spectral theorem also builds a matrix from chosen eigenvalues. In the next box, the same Q is used with the eigenvalues 10 and 5 in place of 1 and 6. Change the code so that the eigenvalues are 2 and 7.
Python
Each eigenvalue went up by 1, and the result is A + I. Adding the identity matrix does not change the eigenvectors.
As in Unit 5, Q[:, 0] is the first column of Q and Q[:, 1] is the second column. The instruction np.outer(q, q) calculates the matrix qqT, which projects onto the line of q. The code below adds the two projections, each multiplied by its eigenvalue.
Python
The two projection matrices have the entries 0.5 and −0.5, as in Part 5. The last result is the matrix A.
The matrix of Practice Problem 3 is not symmetric, so the code below uses np.linalg.eig. The last line prints the dot product of the two eigenvectors.
Python
The dot product is 0.707, not 0, so the eigenvectors are not perpendicular. Now change one entry of A so that the matrix is symmetric, and run the code again.
Python
For the symmetric matrix, the eigenvectors are perpendicular.
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. Which of these matrices is symmetric?
A symmetric matrix is equal to its transpose, so the entry in row 1, column 2 must be equal to the entry in row 2, column 1. Only the third matrix has two equal entries there.
2. Find the eigenvalues of the symmetric matrix 4114.
λ² − 8λ + 15 = 0the trace is 8 and the determinant is 15(λ − 3)(λ − 5) = 0factorThe eigenvectors are (1, −1) and (1, 1), which are perpendicular.
3. A is a symmetric matrix with real entries. Two of its eigenvectors belong to different eigenvalues. What is true about the two eigenvectors?
For a symmetric matrix, (Ax) · y = x · (Ay). With two eigenvectors this gives (λ₁ − λ₂)(x · y) = 0, and the eigenvalues are different, so the dot product is 0.
4. A symmetric matrix has the eigenvalue 5 with the eigenvector (1, 2). Its other eigenvalue is 0, with the eigenvector (2, c). Find c.
Eigenvectors of a symmetric matrix that belong to different eigenvalues are perpendicular.(1)(2) + (2)(c) = 0the dot product must be 0c = −1subtract 2, then divide by 2
5. A = QΛQT. The columns of Q are (0.6, 0.8) and (−0.8, 0.6), and the diagonal entries of Λ are 10 and 5. Find the two entries in the first row of A.
A = 10q₁q₁T + 5q₂q₂T.entry in row 1, column 1 = 10(0.36) + 5(0.64) = 6.8entry in row 1, column 2 = 10(0.48) + 5(−0.48) = 2.4
Next: Topic 7.2, Quadratic Forms and Positive Definite Matrices