Skip to main content

Section 4.2 Diagonalization of symmetric matrices

Recall that an n×n matrix A is symmetric if AT=A. Symmetry of A is equivalent to the following: for any vectors x,yRn,
x(Ay)=(Ax)y.
To see that this is implied by the symmetry of A, note that
x(Ay)=xT(Ay)=(xTAT)y=(Ax)Ty=(Ax)y.

Exercise 4.2.1.

Prove that if x(Ay)=(Ax)y for any x,yRn, then A is symmetric.
Hint.
If this condition is true for all x,yRn, then it is true in particular for the vectors in the standard basis for Rn.
A useful property of symmetric matrices, mentioned earlier, is that eigenvectors corresponding to distinct eigenvalues are orthogonal.

Strategy.

We want to show that if x1,x2 are eigenvectors corresponding to distinct eigenvalues λ1,λ2, then x1x2=0. It was pointed out above that since A is symmetric, we know (Ax1)x2=x1(Ax2). Can you see how to use this, and the fact that x1,x2 are eigenvectors, to prove the result?

Proof.

To see this, suppose A is symmetric, and that we have
Ax1=λ1x1 and Ax2=λ2x2,
with x10,x20, and λ1λ2. We then have, since A is symmetric, and using the result above,
λ1(x1x2)=(λ1x1)x2=(Ax1)x2=x1(Ax2)=x1(λ2x2)=λ2(x1x2).
It follows that (λ1λ2)(x1x2)=0, and since λ1λ2, we must have x1x2=0.
The procedure for diagonalizing a matrix is as follows: assuming that dimEλ(A) is equal to the multiplicity of λ for each distinct eigenvalue λ, we find a basis for Eλ(A). The union of the bases for each eigenspace is then a basis of eigenvectors for Rn, and the matrix P whose columns are those eigenvectors will satisfy P1AP=D, where D is a diagonal matrix whose diagonal entries are the eigenvalues of A.
If A is symmetric, we know that eigenvectors from different eigenspaces will be orthogonal to each other. If we further choose an orthogonal basis of eigenvectors for each eigenspace (which is possible via the Gram-Schmidt procedure), then we can construct an orthogonal basis of eigenvectors for Rn. Furthermore, if we normalize each vector, then we’ll have an orthonormal basis. The matrix P whose columns consist of these orthonormal basis vectors has a name.

Definition 4.2.3.

A matrix P is called orthogonal if PT=P1.

Strategy.

This more or less amounts to the fact that PT=P1 if and only if PPT=I, and thinking about the matrix product in terms of dot products.
A fun fact is that if the columns of P are orthonormal, then so are the rows. But this is not true if we ask for the columns to be merely orthogonal. For example, the columns of A=[105212121] are orthogonal, but (as you can check) the rows are not. But if we normalize the columns, we get
P=[1/601/302/61/52/301/62/51/30],
which, as you can confirm, is an orthogonal matrix.

Definition 4.2.5.

An n×n matrix A is said to be orthogonally diagonalizable if there exists an orthogonal matrix P such that PTAP is diagonal.
The above definition leads to the following result, also known as the Principal Axes Theorem. A careful proof is quite difficult, and omitted from this book. The hard part is showing that any symmetric matrix is orthogonally diagonalizable. There are a few ways to do this, most requiring induction on the size of the matrix. A common approach actually uses multivariable calculus! (Optimization via Lagrange multipliers, to be precise.) If you are reading this along with the book by Nicholson, there is a gap in his proof: in the induction step, he assumes the existence of a real eigenalue of A, but this has to be proved!

Example 4.2.7.

Determine the eigenvalues of A=[524282425], and find an orthogonal matrix P such that PTAP is diagonal.
Solution.
We’ll solve this problem with the help of the computer.
We get cA(x)=x(x9)2, so our eigenvalues are 0 and 9. For 0 we have E0(A)=null(A):
For 9 we have E9(A)=null(A9I).
The approach above is useful as we’re trying to remind ourselves how eigenvalues and eigenvectors are defined and computed. Eventually we might want to be more efficient. Fortunately, there’s a command for that.
Note that the output above lists each eigenvalue, followed by its multiplicity, and then the associated eigenvectors.
This gives us a basis for R3 consisting of eigenvalues of A, but we want an orthogonal basis. Note that the eigenvector corresponding to λ=0 is orthogonal to both of the eigenvectors corresponding to λ=9. But these eigenvectors are not orthogonal to each other. To get an orthogonal basis for E9(A), we apply the Gram-Schmidt algorithm.
This gives us an orthogonal basis of eigenvectors. Scaling to clear fractions, we have
{[212],[120],[425]}
From here, we need to normalize each vector to get the matrix P. But we might not like that the last vector has norm 45. One option to consider is to apply Gram-Schmidt with the vectors in the other order.
That gives us the (slightly nicer) basis
{[212],[101],[141]}.
The corresponding orthonormal basis is
B={13[212],12[101],118[141]}.
This gives us the matrix P=[2/31/21/181/304/182/31/21/18]. Let’s confirm that P is orthogonal.
Since PPT=I3, we can conclude that PT=P1, so P is orthogonal, as required. Finally, we diagonalize A.
Incidentally, the SymPy library for Python does have a diagaonalization routine; however, it does not do orthogonal diagonalization by default. Here is what it provides for our matrix A.

Exercises Exercises

1.

Find the eigenvalues λ1<λ2 and associated unit eigenvectors u1,u2 of the symmetric matrix A=[31272741].
The smaller eigenvalue λ1= has associated unit eigenvector u1= .
The larger eigenvalue λ2= has associated unit eigenvector u2= .
Note: The eigenvectors above form an orthonormal eigenbasis for A.

2.

Find the eigenvalues λ1<λ2 and associated unit eigenvectors u1,u2 of the symmetric matrix A=[27993].
The smaller eigenvalue λ1= has associated unit eigenvector u1= .
The larger eigenvalue λ2= has associated unit eigenvector u2= .
Note: The eigenvectors above form an orthonormal eigenbasis for A.

3.

Find the eigenvalues λ1<λ2 and associated unit eigenvectors u1,u2 of the symmetric matrix A=[153513333].
The eigenvalue λ1= has associated unit eigenvector u1= .
The eigenvalue λ2= has associated unit eigenvector u2= .
The eigenvalue λ3= has associated unit eigenvector u3= .
Note: The eigenvectors above form an orthonormal eigenbasis for A.
You have attempted 1 of 5 activities on this page.