You are about to erase your work on this activity. Are you sure you want to do this?
Updated Version Available
There is an updated version of this activity. If you update to the most recent version of this activity, then your current progress on this activity will be erased. Regardless, your record of completion will remain. How would you like to proceed?
Mathematical Expression Editor
Orthogonal Matrices and Symmetric Matrices
Recall that an matrix is diagonalizable if and only if it has linearly independent
eigenvectors. (see Diagonalizable Matrices and Multiplicity) Moreover, the matrix
with these eigenvectors as columns is a diagonalizing matrix for , that is
\begin{equation*} P^{-1}AP \mbox{ is diagonal.} \end{equation*}
As we have seen, the nice bases of are the orthogonal ones, so a natural question is:
which matrices have orthogonal eigenvectors, so that columns of form an
orthogonal basis for ? These turn out to be precisely the symmetric matrices
(matrices for which ), and this is the main result of this section.
Orthogonal Matrices
Recall that an orthogonal set of vectors is called orthonormal if for each vector in
the set, and that any orthogonal set can be “normalized”, i.e. converted into an
orthonormal set . In particular, if a matrix has orthogonal eigenvectors, they can
(by normalizing) be taken to be orthonormal. The corresponding diagonalizing matrix
(we will use instead of ) has orthonormal columns, and such matrices are very easy
to invert.
The following conditions are equivalent for an matrix .
It is not enough that the rows of a matrix are merely orthogonal for to be an
orthogonal matrix. Here is an example.
Let
(a)
Check that matrix has rows that are orthogonal.
(b)
Check that matrix has columns that are NOT orthogonal.
(c)
Check that matrix has rows that are NOT orthonormal.
(d)
Create a matrix by normalizing each of the rows of .
(e)
Check that is an orthogonal matrix.
Click the arrow to see the answer.
You should get , and one can check that this is orthogonal in a number of ways.
This exploration can certainly be done by hand (although it takes some time), but it
also makes for a very nice Octave exercise.
%Exploration from Section 9.4 Orthogonal Matrices and Symmetric Matrices
A=[2 1 1; -1 1 1; 0 -1 1]
%Check that matrix A has rows that are orthogonal.
A(1,:)*transpose(A(2,:))
A(2,:)*transpose(A(3,:))
A(1,:)*transpose(A(3,:))
%Check that matrix A has columns that are NOT orthogonal.
transpose(A(:,1))*A(:,2)
%(This is 1 of 3 calculations to do.)
%Check that matrix A in the Octave window has rows that are NOT orthonormal.
%(See the results from the first question.)
%Create a matrix Q by normalizing each of the rows of A.
q1=A(1,:)/norm(A(1,:));
q2=A(2,:)/norm(A(2,:));
q3=A(3,:)/norm(A(3,:));
Q = [q1;q2;q3]
%Check that Q is an orthogonal matrix.
Q*transpose(Q)
%(You may get numbers close to zero in some places you expect
%to get zero due to rounding error)
We studied the idea of closure when we studied Subspaces of . The next theorem tells
us that orthogonal matrices are closed under matrix multiplication.
(a)
If and are orthogonal matrices, then is also orthogonal. (We say that
the set of orthogonal matices is closed under matrix multiplication.)
(b)
If is an orthogonal matrix, then so is .
Proof
For th:orthogonal_product, and are invertible, so is also invertible and \begin{equation*} (PQ)^{-1} = Q^{-1}P^{-1} = Q^{T}P^{T} = (PQ)^{T} \end{equation*}
Hence is orthogonal. For th:orthogonal_inverse, \begin{equation*} (P^{-1})^{-1} = P = (P^{T})^{T} = (P^{-1})^{T} \end{equation*}
shows that is orthogonal.
Symmetric Matrices
We now shift our focus from orthogonal matrices to another important class of
matrices called symmetric matrices. A symmetric matrix is a matrix which is equal
to its transpose. We saw a few examples of such matrices in Transpose of a
Matrix.
When we began our study of eigenvalues and eigenvectors, we saw numerous
examples of matrices with entries that were real numbers with eigenvalues
that were complex numbers. It can be shown that symmetric matrices only
have real eigenvalues. We also learned that some matrices are diagonalizable
while other matrices are not. It turns out that every symmetric matrix is
diagonalizable. In fact, we can say more, but first we need the following
definition.
An matrix is said to be orthogonally diagonalizable if an orthogonal matrix can be
found such that is diagonal.
We have learned earlier that when we diagonalize a matrix , we write for some
matrix where is diagonal, and the diagonal entries are the eigenvalues of . We have
also learned that the columns of the matrix are the corresponding eigenvectors of .
So when a matrix is orthogonally diagonalizable, we are able to accomplish the
diagonalization using a matrix consisting of eigenvectors that form an orthonormal
basis for . The following remarkable theorem shows that the matrices that have this
property are precisely the symmetric matrices.
Real Spectral Theorem Let be an matrix. Then is symmetric if and only if is
orthogonally diagonalizable.
Proof
If is orthogonally diagonalizable, then it is an easy exercise to prove
that it is symmetric. You are asked to do this in Practice Problem prob:ortho_diag_implies_symmetric.
To prove the “only if” part of this theorem, we assume is symmetric, and we need to
show it is orthogonally diagonalizable. We proceed by induction on , the size of the
symmetric matrix. If , is already diagonal. If , assume that we know the “only if”
statement holds for symmetric matrices. Let be an eigenvalue of , and
let , where . Next, set , and use the Gram-Schmidt algorithm to find an
orthonormal basis for . Let , so that is an orthogonal matrix. We have \begin{align*} Q_{1}^TAQ_{1} &= \begin{bmatrix} -- & \vec{q}_{1}^T & -- \\ -- & \vec{q}_{2}^T & -- \\ & \vdots & \\ -- & \vec{q}_{n}^T & -- \end{bmatrix} A \begin{bmatrix} | & | & & | \\ \vec{q}_1 & \vec{q}_2 & \cdots & \vec{q}_n \\ | & | & & | \end{bmatrix} \\ &= \begin{bmatrix} -- & \vec{q}_{1}^T & -- \\ -- & \vec{q}_{2}^T & -- \\ & \vdots & \\ -- & \vec{q}_{n}^T & -- \end{bmatrix} \begin{bmatrix} | & | & & | \\ A\vec{q}_1 & A\vec{q}_2 & \cdots & A\vec{q}_n \\ | & | & & | \end{bmatrix} \\ &= \begin{bmatrix} \lambda _{1} & B \\ \vec{0} & A_{1} \end{bmatrix},\\ \end{align*}
where the block has dimensions , and the block under is a zero matrix, because of
the orthogonality of the basis vectors.
Next, using the fact that is symmetric, we notice that
so is symmetric. It follows that is also a zero matrix and that is symmetric. Since
is an symmetric matrix, we may apply the inductive hypothesis, so there exists an
orthogonal matrix such that is diagonal. We observe that is orthogonal, and we
compute: \begin{align*} (Q_{1}Q_{2})^TA(Q_{1}Q_{2}) &= Q_{2}^T(Q_{1}^TAQ_{1})Q_{2} \\ &= \begin{bmatrix} 1 & 0 \\ 0 & Q^T \end{bmatrix} \begin{bmatrix} \lambda _{1} & 0 \\ 0 & A_{1} \end{bmatrix}\begin{bmatrix} 1 & 0 \\ 0 & Q \end{bmatrix}\\ &= \begin{bmatrix} \lambda _{1} & 0 \\ 0 & D_{1} \end{bmatrix} \end{align*}
Because the eigenvalues of a real symmetric matrix are real, Theorem th:PrinAxes is also called
the Real Spectral Theorem, and the set of distinct eigenvalues is called the spectrum
of the matrix. A similar result holds for matrices with complex entries (Theorem
th:025890).
Find an orthogonal matrix such that is diagonal, where .
The characteristic polynomial of is (adding twice row 1 to row 2): \begin{equation*} c_{A}(z) = \det \begin{bmatrix} z - 1 & 0 & 1 \\ 0 & z - 1 & -2 \\ 1 & -2 & z - 5 \end{bmatrix} = z(z - 1)(z - 6) \end{equation*}
Thus the eigenvalues are , , and , and corresponding eigenvectors are \begin{equation*} \vec{x}_{1} = \begin{bmatrix} 1 \\ -2 \\ 1 \end{bmatrix} \; \vec{x}_{2} = \begin{bmatrix} 2 \\ 1 \\ 0 \end{bmatrix} \; \vec{x}_{3} = \begin{bmatrix} -1 \\ 2 \\ 5 \end{bmatrix} \end{equation*}
respectively. Moreover, by what at first appears to be remarkably good luck, these
eigenvectors are orthogonal. We have , , and , so \begin{equation*} P = \begin{bmatrix} | & | & | \\ \frac{1}{\sqrt{6}}\vec{x}_{1} & \frac{1}{\sqrt{5}}\vec{x}_{2} & \frac{1}{\sqrt{30}}\vec{x}_{3} \\ | & | & | \end{bmatrix} = \frac{1}{\sqrt{30}} \begin{bmatrix} \sqrt{5} & 2\sqrt{6} & -1 \\ -2\sqrt{5} & \sqrt{6} & 2 \\ \sqrt{5} & 0 & 5 \end{bmatrix} \end{equation*}
is an orthogonal matrix. Thus and \begin{equation*} P^TAP = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 6 \end{bmatrix}. \end{equation*}
Actually, the fact that the eigenvectors in Example ex:DiagonalizeSymmetricMatrix are orthogonal is no coincidence.
These vectors certainly must be linearly independent (they correspond to distinct
eigenvalues). We will see that the fact that the matrix is symmetric implies that the
eigenvectors are orthogonal. To prove this we need the following useful fact about
symmetric matrices.
If A is an symmetric matrix, then \begin{equation*} (A\vec{x}) \dotp \vec{y} = \vec{x} \dotp (A\vec{y}) \end{equation*}
for all columns and in .
The converse also holds (see Practice Problem ex:8_2_15).
Proof
Recall that for all columns and . Because , we get \begin{equation*} (A\vec{x}) \dotp \vec{y} = (A\vec{x})^T\vec{y} = \vec{x}^TA^T\vec{y} = \vec{x}^TA\vec{y} = \vec{x} \dotp (A\vec{y}) \end{equation*}
If is a symmetric matrix, then eigenvectors of corresponding to distinct eigenvalues
are orthogonal.
Proof
Let and , where . We compute \begin{equation*} \lambda (\vec{x} \dotp \vec{y}) = (\lambda \vec{x}) \dotp \vec{y} = (A\vec{x}) \dotp \vec{y} = \vec{x} \dotp (A\vec{y}) = \vec{x} \dotp (\mu \vec{y}) = \mu (\vec{x} \dotp \vec{y}) \end{equation*}
Hence , and so because .
Now the procedure for diagonalizing a symmetric matrix is clear. Find the distinct
eigenvalues and find orthonormal bases for each eigenspace (the Gram-Schmidt
algorithm may be needed when there is a repeated eigenvalue). Then the set of all
these basis vectors is orthonormal (by Theorem th:symmetric_has_ortho_ev) and contains vectors. Here is an
example.
Orthogonally diagonalize the symmetric matrix .
The characteristic polynomial is \begin{equation*} c_{A}(z) = \det \begin{bmatrix} z-8 & 2 & -2 \\ 2 & z-5 & -4 \\ -2 & -4 & z-5 \end{bmatrix} = z(z-9)^2 \end{equation*}
Hence the distinct eigenvalues are and are of algebraic multiplicity and ,
respectively. The geometric multiplicities must be the same, for is diagonalizable,
being symmetric. It follows that and . Gaussian elimination gives \begin{equation*} \mathcal{S}_{0}(A) = \mbox{span}\{\vec{x}_{1}\}, \quad \vec{x}_{1} = \begin{bmatrix} 1 \\ 2 \\ -2 \end{bmatrix}, \quad \mbox{ and } \quad \mathcal{S}_{9}(A) = \mbox{span} \left \lbrace \begin{bmatrix} -2 \\ 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 2 \\ 0 \\ 1 \end{bmatrix} \right \rbrace \end{equation*}
The eigenvectors in are both orthogonal to as Theorem th:symmetric_has_ortho_ev guarantees, but not to
each other. However, the Gram-Schmidt process yields an orthogonal basis
\begin{equation*} \{\vec{f}_{2}, \vec{f}_{3}\} \mbox{ of } \mathcal{S}_{9}(A) \quad \mbox{ where } \quad \vec{f}_{2} = \begin{bmatrix} -2 \\ 1 \\ 0 \end{bmatrix} \mbox{ and } \vec{f}_{3} = \begin{bmatrix} 2 \\ 4 \\ 5 \end{bmatrix} \end{equation*}
Normalizing gives orthonormal vectors , so \begin{equation*} Q = \begin{bmatrix} | & | & | \\ \frac{1}{3}\vec{x}_{1} & \frac{1}{\sqrt{5}}\vec{f}_{2} & \frac{1}{3\sqrt{5}}\vec{f}_{3} \\ | & | & | \end{bmatrix} = \frac{1}{3\sqrt{5}}\begin{bmatrix} \sqrt{5} & -6 & 2 \\ 2\sqrt{5} & 3 & 4 \\ -2\sqrt{5} & 0 & 5 \end{bmatrix} \end{equation*}
is an orthogonal matrix such that is diagonal.
It is worth noting that other, more convenient, diagonalizing matrices exist. For
example, and lie in and they are orthogonal. Moreover, they both have norm (as
does ), so \begin{equation*} \hat{Q} = \begin{bmatrix} | & | & | \\ \frac{1}{3}\vec{x}_{1} & \frac{1}{3}\vec{y}_{2} & \frac{1}{3}\vec{y}_{3} \\ | & | & | \end{bmatrix} = \frac{1}{3}\begin{bmatrix} 1 & 2 & -2 \\ 2 & 1 & 2 \\ -2 & 2 & 1 \end{bmatrix} \end{equation*}
is a nicer orthogonal matrix with the property that is diagonal.
Let be an matrix. has an orthonormal set of eigenvectors if and only if is
orthogonally diagonalizable.
Proof
Let be orthonormal eigenvectors of with corresponding eigenvalues
. We must show is orthogonally diagonalizable. Let so that is orthogonal. We
have
where is the diagonal matrix with diagonal entries . But then , proving this
half of the theorem.
For the converse, if is orthogonally diagonalizable, then by Theorem th:PrinAxes it is
symmetric. But then Theorem th:symmetric_has_ortho_ev tells us that eigenvectors corresponding to
distinct eigenvalues are orthogonal. Because is (orthogonally) diagonalizable,
we know the geometric multiplicity of each eigenvalue is equal to its algebraic
multiplicity. This implies that we can use Gram-Schmidt on each eigenspace of
dimension to get a full set of orthogonal eigenvectors.
If we are willing to replace “diagonal” by “upper triangular” in the real spectral
theorem, we can weaken the requirement that is symmetric to insisting only that
has real eigenvalues.
Schur Triangularization Theorem If is an matrix with real eigenvalues, an
orthogonal matrix exists such that is upper triangular.
There is also a lower triangular version of this theorem.
The eigenvalues of an upper triangular matrix are displayed along the main diagonal.
Because and have the same determinant and trace whenever is orthogonal (for they
are similar matrices), Theorem th:Schur gives:
If is an matrix with real eigenvalues (possibly not all distinct), then and
.
This corollary remains true even if the eigenvalues are not real.
Practice Problems
Suppose is orthogonally diagonalizable. Prove that is symmetric. (This is the easy
direction of the ”if and only if” in Theorem th:PrinAxes.)
A matrix that we obtain from the identity matrix by writing its rows in a different
order is called a permutation matrix (see Theorem th:LUPA). Show that every permutation
matrix is orthogonal.
Show that the following are equivalent for an matrix .
(a)
is orthogonal.
(b)
for all .
(c)
for all , .
(d)
for all columns , .
For (d) (a), show that column of equals , where is column of the identity
matrix.
This exercise shows that linear transformations with orthogonal standard matrices
are distance-preserving (b,c) and angle-preserving (d).