Ran Wei/ Linear Algebra
中文
Linear Algebra · Spectra and data

Module 10Symmetric matrices and quadratic forms

Find orthogonal principal directions and classify the sign of a quadratic form.

80 minYou need Modules 7 and 9

In this module you will

  • Use an orthonormal eigenbasis for a real symmetric matrix
  • Read the signs of a quadratic form from eigenvalues
  • Connect eigenvalues with the shape of level curves
1

Orthogonal eigenvectors

A real symmetric matrix satisfies AT=A.A^\mathsf T=A\mathclose{\text{.}} Suppose Au=λuA\mathbf u=\lambda\mathbf u and Av=μv.A\mathbf v=\mu\mathbf v\mathclose{\text{.}} Symmetry gives (Au)⋅v=u⋅(Av).(A\mathbf u)\cdot\mathbf v=\mathbf u\cdot(A\mathbf v)\mathclose{\text{.}} If λ≠μ,\lambda\ne\mu\mathclose{\text{,}} this forces u⋅v=0.\mathbf u\cdot\mathbf v=0\mathclose{\text{.}}

The spectral theorem says every real symmetric matrix has an orthonormal basis of real eigenvectors. Here is why there is a first direction. The quantity vTAv\mathbf v^\mathsf TA\mathbf v attains its maximum at some unit vector on the compact unit sphere. For a unit w\mathbf w perpendicular to the maximiser v,\mathbf v\mathclose{\text{,}} the unit direction (v+tw)/1+t2(\mathbf v+t\mathbf w)/\sqrt{1+t^2} cannot give a larger value. Expanding and clearing the denominator gives

2t wTAv+t2(wTAw−vTAv)≤0.2t\,\mathbf w^\mathsf TA\mathbf v+t^2(\mathbf w^\mathsf TA\mathbf w-\mathbf v^\mathsf TA\mathbf v)\le 0.

The coefficient of tt must vanish. Otherwise, sufficiently small tt with the same sign as that coefficient would make the left side positive. Thus AvA\mathbf v is parallel to v.\mathbf v\mathclose{\text{.}} Symmetry makes its orthogonal complement invariant. Repeat the argument there until you have an orthonormal basis. With these vectors as columns of Q,Q\mathclose{\text{,}} write A=QΛQT.A=Q\Lambda Q^\mathsf T\mathclose{\text{.}}

2

Shapes in principal coordinates

The quadratic form of AA is q(x)=xTAx.q(\mathbf x)=\mathbf x^\mathsf TA\mathbf x\mathclose{\text{.}} In eigenvector coordinates z=QTx\mathbf z=Q^\mathsf T\mathbf x it becomes ∑iλizi2.\sum_i\lambda_i z_i^2\mathclose{\text{.}} If every eigenvalue is positive, the form is positive definite. If all are nonnegative, it is positive semidefinite, with a flat direction when one is zero. Eigenvalues of both signs give an indefinite form.

Example 10.1A rotated bowl✓ Checked

For A=(2112)A=\begin{pmatrix}2&1\\1&2\end{pmatrix} the unit directions are (1,1)T/2(1,1)^\mathsf T/\sqrt2 and (1,−1)T/2,(1,-1)^\mathsf T/\sqrt2\mathclose{\text{,}} with eigenvalues 33 and 1.1\mathclose{\text{.}} Its form is 3z12+z223z_1^2+z_2^2 in these coordinates. The level curve with value one meets the first axis at distance 1/31/\sqrt3 and the second at distance one.

Try it

Compare the principal directions and the contours of the symmetric presets. Try a positive definite form, an indefinite form and one with a flat direction.

Compute itEigenvalues and a quadratic form
Python
from sympy import Matrix

A = Matrix([[2, 1], [1, 2]])
x = Matrix([1, -1])
print(sorted(A.eigenvals()))
print((x.T * A * x)[0])
Output
[1, 3]
2
3

Exercises

Exercise 10.1★Flat direction

Classify q(x,y)=4x2q(x,y)=4x^2 and give a nonzero vector where it vanishes.

Show solution✓ Checked

Its matrix has eigenvalues 44 and 0.0\mathclose{\text{.}} The form is positive semidefinite and vanishes at (0,1)T.(0,1)^\mathsf T\mathclose{\text{.}}

Exercise 10.2★★A saddle direction

Classify q(x,y)=2xyq(x,y)=2xy by finding its values at (1,1)(1,1) and (1,−1).(1,-1)\mathclose{\text{.}}

Show solution✓ Checked

The values are 22 and −2.-2\mathclose{\text{.}} The form is indefinite. Its symmetric matrix has off-diagonal entries one and diagonal entries zero.

Exercise 10.3★★★A uniform lower bound

Show that 2∥x∥2≤xTAx2\|\mathbf x\|^2\le\mathbf x^\mathsf TA\mathbf x whenever the symmetric matrix AA has every eigenvalue at least 2.2\mathclose{\text{.}} Give a case of equality.

Show solution✓ Checked

Use orthonormal eigenvector coordinates, where the squared norm is ∑izi2.\sum_i z_i^2\mathclose{\text{.}} Each difference (λi−2)zi2(\lambda_i-2)z_i^2 is nonnegative. Equality is attained for an eigenvector with eigenvalue 2,2\mathclose{\text{,}} for example the first coordinate vector for diag⁡(2,5).\operatorname{diag}(2,5)\mathclose{\text{.}}

4

Check yourself

1
Which matrices have an orthonormal real eigenbasis by the spectral theorem?
2
What does a zero eigenvalue imply for a positive semidefinite form?
3
In principal coordinates, what are the coefficients of the squares?
Finished this module?