Skip to content

Symmetric matrices

Watch a symmetric matrix squeeze a circle into an ellipse whose axes always meet at a right angle, and write it as stretches along those axes.

Helps to know first
This topic

First, the picture

Squeeze a circle with a symmetric matrix. Watch it become an ellipse whose two axes meet at a right angle, whatever you do.

Stretching along perpendicular axes

A symmetric matrix S = [5 s; s 2] turns the circle into an ellipse.

The unit circle and the matrix S = [5 2; 2 2], symmetric.

semi-axes
–
long axis at
–
0.00 / 8.20 s
Describe this picture

One panel with the unit circle and a faint grid. The matrix is S=[5ss2]\mathbf{S}=\begin{bmatrix}5&s\\s&2\end{bmatrix}, starting at s=2s=2. Over about 8 s the circle and the grid warp into an ellipse, and its two semi-axes grow out from the centre as arrows, with a right-angle mark between them: a long one of 6 along (2,1)(2,1), at 26.57°, and a short one of 1 along (−1,2)(-1,2), at 116.57°. Readouts give the two semi-axes and the angle of the long one. One control after the clip: a slider for ss from 0 to 3.16. The ellipse changes shape and the axes turn, but they stay at a right angle. At s=0s=0 the axes lie along the coordinate axes with lengths 5 and 2. At s=3s=3 they are 6.854 and 0.146 long, at 31.72°. Near s=3.16s=3.16 the short axis shrinks to almost nothing.

Perpendicular axes

A matrix like the one in the picture has a mirror pattern: the entry above the diagonal equals the entry below it. A matrix that equals its own transpose, from Transposes and permutations, is symmetric:

S=S⊤.\mathbf{S}=\mathbf{S}^\top.

I write a symmetric matrix as S\mathbf{S}. Every symmetric matrix in the picture turns the circle into an ellipse whose two axes meet at a right angle. The eigenvectors point along the axes, and the eigenvalues are the lengths of the semi-axes (their sizes, if one is negative). Take s=2s=2:

S=[5222].\mathbf{S}=\begin{bmatrix}5&2\\2&2\end{bmatrix}.

Its trace is 7 and its determinant 10−4=610-4=6, so its eigenvalues are 6 and 1, as on Finding eigenvalues. The eigenvectors are (2,1)(2,1), since S(2,1)=(12,6)=6 (2,1)\mathbf{S}(2,1)=(12,6)=6\,(2,1), and (−1,2)(-1,2), since S(−1,2)=(−1,2)\mathbf{S}(-1,2)=(-1,2). And (2,1)⋅(−1,2)=−2+2=0(2,1)\cdot(-1,2)=-2+2=0: a right angle.

Compare the matrix of the eigenvectors page, [1.510.51]\begin{bmatrix}1.5&1\\0.5&1\end{bmatrix}, which is not symmetric. Its eigenvectors (2,1)(2,1) and (1,−1)(1,-1) have cos⁡θ=1/10=0.316\cos\theta=1/\sqrt{10}=0.316, so they meet at 71.57°, not 90°. Right angles are a gift of symmetry, not of every matrix.

Why the axes are perpendicular

Here is the reason, in one line. Let Sv1=λ1v1\mathbf{S}\mathbf{v}_1=\lambda_1\mathbf{v}_1 and Sv2=λ2v2\mathbf{S}\mathbf{v}_2=\lambda_2\mathbf{v}_2. Move S\mathbf{S} across the dot product with the transpose, (Sv1)⋅v2=v1⋅(S⊤v2)(\mathbf{S}\mathbf{v}_1)\cdot\mathbf{v}_2=\mathbf{v}_1\cdot(\mathbf{S}^\top\mathbf{v}_2), and use S⊤=S\mathbf{S}^\top=\mathbf{S}:

λ1 v1⋅v2=(Sv1)⋅v2=v1⋅(Sv2)=λ2 v1⋅v2.\begin{aligned} \lambda_1\,\mathbf{v}_1\cdot\mathbf{v}_2&=(\mathbf{S}\mathbf{v}_1)\cdot\mathbf{v}_2\\ &=\mathbf{v}_1\cdot(\mathbf{S}\mathbf{v}_2)=\lambda_2\,\mathbf{v}_1\cdot\mathbf{v}_2. \end{aligned}

So (λ1−λ2) v1⋅v2=0(\lambda_1-\lambda_2)\,\mathbf{v}_1\cdot\mathbf{v}_2=0. When the two eigenvalues differ, the dot product must be 0, and the eigenvectors are perpendicular. When they are equal, every direction in their plane is stretched alike, so you may choose a perpendicular pair.

Real eigenvalues

A symmetric matrix never has complex eigenvalues. For [abbc]\begin{bmatrix}a&b\\b&c\end{bmatrix} the quantity under the square root in the formula of Finding eigenvalues is

(a+c)2−4(ac−b2)=(a−c)2+4b2 ≥ 0.\begin{aligned} &(a+c)^2-4(ac-b^2)\\ &\quad=(a-c)^2+4b^2\ \ge\ 0. \end{aligned}

It is a sum of squares, so the roots are real. The angle of the axes comes out neatly too: the eigenvector of the larger eigenvalue sits at the angle θ\theta with

tan⁡2θ=2ba−c.\tan2\theta=\frac{2b}{a-c}.

For S=[5222]\mathbf{S}=\begin{bmatrix}5&2\\2&2\end{bmatrix}, tan⁡2θ=4/3\tan2\theta=4/3, so θ\theta is 26.57°, which is 0.4636 rad: the direction of (2,1)(2,1).

The spectral theorem

Scale each eigenvector to length 1. For S\mathbf{S} above, q1=(2,1)/5\mathbf{q}_1=(2,1)/\sqrt5 and q2=(−1,2)/5\mathbf{q}_2=(-1,2)/\sqrt5. They are perpendicular and of length 1, so the matrix with them as columns,

Q=15[2−112],\mathbf{Q}=\frac{1}{\sqrt5}\begin{bmatrix}2&-1\\1&2\end{bmatrix},

has orthonormal columns, as in Orthonormal bases and Gram–Schmidt: Q⊤Q=I\mathbf{Q}^\top\mathbf{Q}=\mathbf{I}, so its inverse is its transpose. Diagonalising as in Diagonalisation and matrix powers, with Q\mathbf{Q} in place of X\mathbf{X}, gives

S=QΛQ⊤.\mathbf{S}=\mathbf{Q}\boldsymbol{\Lambda}\mathbf{Q}^\top.

This is the spectral theorem: every real symmetric matrix is a turn to its axes (Q⊤\mathbf{Q}^\top), a stretch along each axis (Λ\boldsymbol{\Lambda}), and a turn back (Q\mathbf{Q}). No inverse is needed, only a transpose.

A sum of stretches

Multiply QΛQ⊤\mathbf{Q}\boldsymbol{\Lambda}\mathbf{Q}^\top out by columns times rows, as in Matrix multiplication:

S=λ1 q1q1⊤+λ2 q2q2⊤.\mathbf{S}=\lambda_1\,\mathbf{q}_1\mathbf{q}_1^\top+\lambda_2\,\mathbf{q}_2\mathbf{q}_2^\top.

Each qq⊤\mathbf{q}\mathbf{q}^\top is the projection onto one axis, from Projections. So a symmetric matrix projects a point onto each axis, stretches each piece by its eigenvalue, and adds the pieces.

Sum of two pieces

S = [5 2; 2 2] as two flat pieces, one per eigenvector.

6 q_{1} q_{1}ᵀ flattens the circle onto the line of (2, 1) and stretches it to 6 each way.

0.00 / 8.00 s
Describe this picture

Three small panels for S=[5222]\mathbf{S}=\begin{bmatrix}5&2\\2&2\end{bmatrix}, side by side (stacked on a phone), each starting with the unit circle. In turn, about 2 s each: the first shows 6 q1q1⊤6\,\mathbf{q}_1\mathbf{q}_1^\top, the circle flattened onto the line of (2,1)(2,1) and stretched to 6 each way. The second shows 1 q2q2⊤1\,\mathbf{q}_2\mathbf{q}_2^\top, the circle flattened onto the line of (−1,2)(-1,2), 1 each way. The third adds them, point by point, and the ellipse of the first picture appears. There is no control.

With numbers:

6 q1q1⊤+1 q2q2⊤=65[4221]+15[1−2−24]=15[25101010]=[5222].\begin{aligned} &6\,\mathbf{q}_1\mathbf{q}_1^\top+1\,\mathbf{q}_2\mathbf{q}_2^\top\\ &\quad=\frac65\begin{bmatrix}4&2\\2&1\end{bmatrix}+\frac15\begin{bmatrix}1&-2\\-2&4\end{bmatrix}\\ &\quad=\frac15\begin{bmatrix}25&10\\10&10\end{bmatrix}=\begin{bmatrix}5&2\\2&2\end{bmatrix}. \end{aligned}

In signal processing · eigenvectors of a correlation matrix

The autocorrelations of a random process fill a symmetric matrix with constant diagonals, entry Rx[p−q]R_x[p-q] in row pp and column qq. Its eigenvectors are perpendicular, by this page, and for long records they are close to sinusoids. Power spectral density, in the signal processing course, uses that to read the spectrum from its eigenvalues. Matrix entries count from 1, while lags and samples count from 0.

Worked example

1. Eigenvalues, axes, factors. S=[5222]\mathbf{S}=\begin{bmatrix}5&2\\2&2\end{bmatrix}: trace 7, determinant 6, λ=6\lambda=6 and 1, eigenvectors (2,1)(2,1) and (−1,2)(-1,2). The pieces add back to S\mathbf{S}, as above. A check that needs no eigenvectors: the squares of the entries add up to 25+4+4+4=3725+4+4+4=37, and so do the squares of the eigenvalues, 36+1=3736+1=37.

2. Not symmetric, not perpendicular. The eigenvectors (2,1)(2,1) and (1,−1)(1,-1) of [1.510.51]\begin{bmatrix}1.5&1\\0.5&1\end{bmatrix} meet at 71.57°.

3. A data cloud. Two measurements, each with spread 1 and correlation 0.8, have the covariance matrix [10.80.81]\begin{bmatrix}1&0.8\\0.8&1\end{bmatrix}. Its eigenvalues are 1.8 along (1,1)(1,1) and 0.2 along (1,−1)(1,-1). The ellipse that holds the cloud at one standard deviation has semi-axes 1.8=1.342\sqrt{1.8}=1.342 and 0.2=0.447\sqrt{0.2}=0.447, tilted at 45°.

4. Two masses on springs. Two equal masses are joined to two walls and to each other by three equal springs, with stiffness over mass 100 s−2100\,\mathrm{s}^{-2}. Their positions obey x′′=−Kx\mathbf{x}''=-\mathbf{K}\mathbf{x} with

K=100[2−1−12].\mathbf{K}=100\begin{bmatrix}2&-1\\-1&2\end{bmatrix}.

Its eigenvalues are 100, along (1,1)(1,1), and 300, along (1,−1)(1,-1). A motion x=vcos⁡ωt\mathbf{x}=\mathbf{v}\cos\omega t along an eigenvector needs ω2=λ\omega^2=\lambda, so the masses swing together at ω=10\omega=10 rad/s, or 1.59 Hz, and against each other at ω=17.32\omega=17.32 rad/s, or 2.76 Hz.

Try these before you read the answers.

  • A symmetric matrix has eigenvalues 3 and 1. At what angle do its eigenvectors meet? 90°.
  • Eigenvalues and directions of [2112]\begin{bmatrix}2&1\\1&2\end{bmatrix}? 3 along (1,1)(1,1), and 1 along (1,−1)(1,-1).
  • Can a real symmetric 2×22\times2 matrix have complex eigenvalues? No: (a−c)2+4b2≥0(a-c)^2+4b^2\ge0.
  • If S=QΛQ⊤\mathbf{S}=\mathbf{Q}\boldsymbol{\Lambda}\mathbf{Q}^\top, what is S−1\mathbf{S}^{-1}? QΛ−1Q⊤\mathbf{Q}\boldsymbol{\Lambda}^{-1}\mathbf{Q}^\top, when no eigenvalue is 0.

Where this leads · the ellipse of a data cloud

Joint distributions, in the probability and statistics course, draws clouds of points with correlation 0.8. The ellipse those clouds fill is the ellipse of example 3: its axes are the eigenvectors of the covariance matrix.

Where you’ll meet this

Principal axes. A cloud of data points, the stress inside a beam and the way a body resists being spun all have a symmetric matrix. Its eigenvectors are the natural axes of the problem, at right angles, and its eigenvalues say how much happens along each.

Vibration modes. Anything built from masses and springs, from a guitar body to a bridge, vibrates in modes that are the eigenvectors of a symmetric matrix, as in example 4. There the masses are equal, so the modes are perpendicular, and each can be excited and measured on its own.

Least squares. The matrix A⊤A\mathbf{A}^\top\mathbf{A} of Least squares is always symmetric, since (A⊤A)⊤=A⊤A(\mathbf{A}^\top\mathbf{A})^\top=\mathbf{A}^\top\mathbf{A}.

Reference card

QuantityFormulaNotes
SymmetricS=S⊤\mathbf{S}=\mathbf{S}^\topmirror pattern across the diagonal
Eigenvaluesall real2×22\times2: (a−c)2+4b2≥0(a-c)^2+4b^2\ge0
Eigenvectorsperpendicularfor different eigenvalues
Spectral theoremS=QΛQ⊤\mathbf{S}=\mathbf{Q}\boldsymbol{\Lambda}\mathbf{Q}^\topQ⊤Q=I\mathbf{Q}^\top\mathbf{Q}=\mathbf{I}
PiecesS=∑kλk qkqk⊤\mathbf{S}=\sum_k\lambda_k\,\mathbf{q}_k\mathbf{q}_k^\topa stretch along each axis
Axis angle, 2×22\times2tan⁡2θ=2b/(a−c)\tan2\theta=2b/(a-c)for [abbc]\begin{bmatrix}a&b\\b&c\end{bmatrix}
InverseS−1=QΛ−1Q⊤\mathbf{S}^{-1}=\mathbf{Q}\boldsymbol{\Lambda}^{-1}\mathbf{Q}^\topwhen no eigenvalue is 0

Keep reading with a free account.

By creating an account you accept the terms of use.

Sign in

Already have an account? Use the service you signed up with.

Or keep reading: get new lessons by email

Are you 13 or over?

Accounts and email updates are for people aged 13 or over. We keep only your answer, never your date of birth.

End of the lesson

Where to go next.

Phasorium

Account

Sign inKeep your place on any device

Subjects

Site

Look