Contents / Linear Algebra / Symmetric Matrices and Quadratic Forms
Chapter 11
Symmetric Matrices and Quadratic Forms
The Spectral Theorem, quadratic forms, and positive definite matrices.
Introduction
A matrix is symmetric when it equals its own transpose. That one equation, , is worth more than any other structural hypothesis in linear algebra. It forces the eigenvalues to be real, forces eigenvectors belonging to different eigenvalues to be perpendicular, and guarantees a full orthonormal basis of eigenvectors even when eigenvalues repeat. The general theory of diagonalisation has to worry about complex roots, defective matrices and skewed eigenbases; for symmetric matrices none of those worries survive.
The payoff is the Spectral Theorem:
with orthogonal and diagonal and real. Read from left to right it says that a symmetric matrix is a pure stretch along perpendicular axes, dressed up in the wrong coordinate system. Every other result in this chapter is a consequence. Quadratic forms lose their cross terms in the eigenvector coordinates, so conics and quadric surfaces are classified by the signs of the eigenvalues. The maximum of on the unit sphere is the largest eigenvalue, which is where constrained optimisation meets the spectrum. And positive definiteness — the matrix version of "positive number" — turns out to have five different faces, one of which (the Cholesky factorisation) is how a computer actually checks it.
Symmetric matrices appear wherever a quantity is measured symmetrically in two arguments: covariance, energy, curvature, conductance, distance. The first three sections build the spectral machinery, the next three apply it to quadratic forms and optimisation, and the last three develop positive definiteness and what it is for. The Singular Value Decomposition, which extends these ideas to matrices that are neither square nor symmetric, has a chapter of its own.
11.1Symmetric matrices and the transpose
Definition 11.1 (Symmetric and skew-symmetric matrices). A square real matrix is symmetric if
equivalently for all . It is skew-symmetric if , which forces every diagonal entry to be zero.
Symmetry is a statement about reflection across the main diagonal: the entry in row , column matches the entry in row , column . A symmetric matrix therefore carries independent numbers rather than , and only square matrices can be symmetric at all.
The reason symmetry is powerful is not the picture but the following identity, which converts a statement about entries into a statement about the dot product.
Proposition 11.2 (Symmetry is self-adjointness). A real matrix is symmetric if and only if
Proof. Write the dot product as a matrix product: . Then
If the two right-hand sides are identical, so the identity holds. Conversely, suppose the identity holds for all and . Then for all ; taking and picks out the entry of , so every entry of is zero.∎
This is the property the whole chapter runs on: a symmetric matrix can be moved from one side of a dot product to the other for free. Every proof about real eigenvalues, orthogonal eigenvectors and the Spectral Theorem is an application of it. In the language of the inner-product-spaces chapter, a symmetric matrix is exactly a self-adjoint operator on with the standard inner product.
Symmetric matrices are not closed under multiplication, but they are closed under the operations that matter most.
Proposition 11.3 (Constructions that produce symmetric matrices). Let be any real matrix and let be symmetric matrices. Then:
- (size ) and (size ) are symmetric;
- and are symmetric for every scalar ;
- is symmetric for every , and is symmetric when is invertible;
- is symmetric for every real matrix of compatible size;
- every square matrix splits uniquely as , a symmetric plus a skew-symmetric matrix.
Proof. For (1), . Parts (2) and (3) follow from and ; for the inverse, transpose to get , so . For (4), . For (5), the first summand is symmetric and the second is skew by inspection, and if with symmetric and skew, transposing gives , so and .∎
Part (1) is the single most-used fact in applied linear algebra: normal equations , Gram matrices, covariance matrices and kernel matrices are all of this form, so the Spectral Theorem applies to all of them. Part (4) is the transformation rule for quadratic forms under a change of variable, and it is why congruence rather than similarity is the natural notion for forms.
Intuition. Think of as a table of pairwise measurements: is how strongly station is connected to station . Symmetry says the connection is mutual — the road from to is the same road as the one from to . Distance matrices, spring networks, electrical conductances and correlation tables are all symmetric for this reason, and the theorems below are why those subjects have such clean theory. Traffic flow, in contrast, is genuinely directional: cars go one way and the other, the matrix is not symmetric, and none of this chapter applies.
Example 11.4 (Recognising and building symmetric matrices). Which of
are symmetric? For , compute and check that it is symmetric.
Solution.
- : the and entries are both , so . Symmetric.
- : the entry is and the entry is , so . Skew-symmetric, not symmetric.
- : reflect across the diagonal — , , . Symmetric.
- Sanity check: the diagonal entries of are the squared lengths of the columns of , namely and , and the off-diagonal entry is the dot product of the two columns, . Both appear once above and once below the diagonal, as they must.
Example 11.5 (The symmetric part of a matrix). Split into a symmetric and a skew-symmetric part.
Solution.
- .
- Symmetric part: .
- Skew part: .
- Sanity check: the two parts add back to , the second has zero diagonal, and the skew part contributes nothing to — a fact used in the section on quadratic forms.
Pitfall. The product of two symmetric matrices is usually not symmetric. With and , both symmetric, is not. In general , so is symmetric exactly when and commute.
11.2The Spectral Theorem
Diagonalising a matrix means finding a basis in which it acts by pure scaling. For a general matrix such a basis may not exist, and when it does the axes can be badly skewed. Symmetry removes both problems at once. We build the result out of two lemmas, each a two-line application of self-adjointness.
Lemma 11.6 (Real symmetric matrices have real eigenvalues). Every eigenvalue of a real symmetric matrix is real, and every eigenvalue has a real eigenvector.
Proof. The characteristic polynomial has real coefficients but might, a priori, have complex roots, so work in . Suppose with , and write for the entrywise complex conjugate. Consider the scalar
On one hand . On the other hand, conjugating and transposing a matrix leaves it fixed up to conjugation, so
using (the entries are real) and . So equals its own conjugate and is therefore real. Since is a positive real number, is real.
Given that is real, the matrix is a real singular matrix, so its null space contains a nonzero real vector; that is a real eigenvector.∎
Two hypotheses are load-bearing. Real entries: the complex matrix is equal to its transpose and has eigenvalue . (For complex matrices the right condition is , Hermitian, and the same proof then gives real eigenvalues.) Symmetry: the rotation matrix is real with eigenvalues .
Lemma 11.7 (Eigenvectors for distinct eigenvalues are orthogonal). Let be real symmetric with and , where . Then .
Proof. Move across the dot product using the self-adjointness identity:
Hence . Since , the factor is nonzero, so .∎
Notice how little was used: the eigenvectors were never computed. The orthogonality is forced by the algebra of the transpose, which is why it holds for every symmetric matrix, however large. For a non-symmetric matrix the conclusion fails at once: has eigenvectors and for the distinct eigenvalues and , and their dot product is .
When the eigenvalues are distinct, the two lemmas already finish the job: normalise the mutually orthogonal eigenvectors and you have an orthonormal eigenbasis. The work is in the repeated case, and the following induction handles it without ever mentioning multiplicities.
Theorem 11.8 (Spectral Theorem). Let be a real symmetric matrix. Then there is an orthogonal matrix (so ) and a real diagonal matrix with
The columns of are an orthonormal basis of consisting of eigenvectors of , with .
Proof. Induct on . For take and .
Let and assume the theorem for symmetric matrices of size . The characteristic polynomial of has a root in , and by the real-eigenvalue lemma that root is real with a real eigenvector, which we may scale to a unit vector .
Let , a subspace of dimension . The key point is that maps into itself: if then
so . This step is exactly where symmetry is used; without it the orthogonal complement of an eigenvector need not be invariant.
Choose an orthonormal basis of (Gram–Schmidt supplies one) and set , an orthogonal matrix. Consider . Its first column is . Moreover , so is symmetric and its first row is as well. Therefore
with symmetric of size . By the induction hypothesis with orthogonal and diagonal. Put
which is orthogonal, and , a product of orthogonal matrices and hence orthogonal. Then
a diagonal matrix. Multiplying by on the left and on the right gives . Reading column by column gives .∎
The converse is a one-liner and worth recording, because it says symmetry is not merely sufficient for orthogonal diagonalisability but necessary.
Proposition 11.9 (Orthogonally diagonalisable means symmetric). If with orthogonal and real diagonal, then is symmetric.
Proof. , since a diagonal matrix is its own transpose.∎
Corollary 11.10 (What the Spectral Theorem buys). For a real symmetric matrix :
- all eigenvalues are real, counted with multiplicity;
- for every eigenvalue, the dimension of the eigenspace equals its multiplicity as a root of the characteristic polynomial — a symmetric matrix is never defective;
- eigenvectors for distinct eigenvalues are orthogonal, and eigenspaces for distinct eigenvalues are orthogonal subspaces;
- and ;
- is the number of nonzero eigenvalues, and is the eigenspace for .
Proof. Parts (1) and (3) are the two lemmas. For (2), is similar to , so they share a characteristic polynomial; the number of 's on the diagonal of is therefore the algebraic multiplicity, and the corresponding columns of are that many independent eigenvectors, so the geometric multiplicity is at least — hence equal to — the algebraic one. For (4), similarity preserves trace and determinant, and for a diagonal matrix both are read off directly. For (5), because multiplying by invertible matrices does not change rank, and the rank of a diagonal matrix is its number of nonzero entries.∎
Intuition. Picture the unit sphere in and a symmetric acting on it. The image is an ellipsoid, and the Spectral Theorem says its three axes are perpendicular and are exactly the directions , stretched by . A non-symmetric matrix also turns the sphere into an ellipsoid, but its eigenvectors are no longer the axes of that ellipsoid; it shears as well as stretches. Symmetry is the statement "no shear in the eigenvector frame".
Method 11.11 (Orthogonally diagonalising a symmetric matrix).
- Compute the characteristic polynomial and find its roots. They are guaranteed real.
- For each eigenvalue, solve for a basis of the eigenspace.
- Apply Gram–Schmidt inside each eigenspace of dimension . Vectors from different eigenspaces are already orthogonal and need no work.
- Normalise every vector to unit length and place them as the columns of , with the matching eigenvalues in the same order on the diagonal of .
- Check and, on a small example, .
Example 11.12 (A orthogonal diagonalisation). Find and with for .
Solution.
- Characteristic equation: , i.e. , so and .
- For : gives , so spans the eigenspace and .
- For : gives , so . As the orthogonality lemma promised, .
- Assemble and .
- Sanity check: , and multiplying by gives . Also and .
Example 11.13 (A with a repeated eigenvalue). Orthogonally diagonalise
Solution.
- Expanding gives , so the eigenvalues are (twice) and . Check against the corollary: , and .
- For : . The second row gives , so ; substituting into the first row gives , i.e. , and then . The eigenspace is spanned by , of length , so .
- For : has rank ; every row is a multiple of . The eigenspace is the plane , dimension — matching the algebraic multiplicity, as a symmetric matrix must.
- Pick a basis of that plane: and . They are not orthogonal (), so Gram–Schmidt within the eigenspace:
and scaling by gives , of length . 5. Normalise: , , , and . 6. Sanity check the cross-eigenspace orthogonality that the lemma guarantees: and . Only the two vectors inside the eigenspace needed adjusting.□
Pitfall. Gram–Schmidt is needed only within a repeated eigenspace. Orthogonalising a vector from one eigenspace against a vector from another is not merely unnecessary — it destroys the eigenvector property, because the result is a combination of eigenvectors for different eigenvalues and is no longer an eigenvector at all.
11.3The spectral decomposition
The factorisation can be expanded into a sum, and the summands turn out to be projections. This form is how symmetric matrices are used in practice, and it makes powers, inverses and square roots of immediate.
Theorem 11.14 (Spectral decomposition). Let be real symmetric with orthonormal eigenvectors and eigenvalues . Then
where is the matrix of the orthogonal projection of onto the line spanned by . These projections satisfy
Proof. Write column by column: the -th column of is . Multiplying a matrix by another on the right is the sum of column-times-row outer products, so
For the projection properties, , and since ,
For , gives . Finally because is orthogonal. That is precisely the orthogonal projection onto .∎
The identity is a resolution of the identity: every vector splits into its components along the eigen-directions, , and then
So does nothing but rescale each component by its own eigenvalue. Every has rank (or rank when ), which is why the decomposition is called a sum of rank-one pieces. When eigenvalues repeat, the projections onto the individual lines can be grouped: for a distinct eigenvalue with eigenspace , summing the over the spanning gives the orthogonal projection onto the whole eigenspace, and over the distinct eigenvalues.
Example 11.15 (Spectral decomposition of a matrix). Write as .
Solution.
- From the previous section, with and with .
- .
- .
- .
- Sanity check the projection identities: , and .
Because the projections multiply so simply, any polynomial or power series in collapses onto the eigenvalues.
Proposition 11.16 (Functions of a symmetric matrix). With as above, for every integer
and if is invertible, . If every , the matrix is symmetric with nonnegative eigenvalues and satisfies .
Proof. ; each interior collapses to , leaving . Expanding as before gives . For the inverse, multiplied by is . For the square root, , using for and .∎
Example 11.17 (A matrix power and a matrix square root). Compute for , and find a symmetric square root of .
Solution.
- .
- Check directly: and .
- For : , , so and the eigenvalues are and , with the same eigenvectors and .
- .
- Sanity check: .
Remark. The square root above is the unique symmetric square root with nonnegative eigenvalues; other square roots exist (flip a sign on to get , whose square is also ), but only one of them is positive semidefinite. This canonical root is what lets a covariance matrix be "unsquared" and is the standard way to whiten data.
Pitfall. The formula needs an orthogonal so that . For a general diagonalisable matrix the correct statement is , and writing in place of is simply wrong. Likewise is a projection only when is a unit vector; in general the projection is .
11.4Quadratic forms
A quadratic form is a homogeneous polynomial of degree two. The point of this section is that every such polynomial is for exactly one symmetric , which puts the whole spectral machinery at its disposal.
Definition 11.18 (Quadratic form). A quadratic form on is a function
where is a real symmetric matrix, called the matrix of the form.
Expanding the double sum and collecting the terms and gives the working formula
So the diagonal entries are the coefficients of the squares, and each off-diagonal entry is half the coefficient of the corresponding cross term. In two variables,
Insisting that be symmetric is a normalisation, not a restriction: any square gives the same values, because the skew part contributes nothing.
Proposition 11.19 (The symmetric matrix of a form is unique). For any square , for all , where . Moreover, if and are symmetric and for all , then .
Proof. The number is , so it equals its own transpose ; averaging the two gives . For uniqueness let , symmetric with for all . Taking gives . Taking gives , hence . So .∎
Example 11.20 (Passing between a polynomial and its matrix). (a) Write in the form . (b) Write out the polynomial for and evaluate it at .
Solution.
- (a) Diagonal entries are the coefficients of the squares: , , .
- Off-diagonal entries are half the cross-term coefficients: , , and since is absent. Hence
- (b) Reading the matrix back: (each off-diagonal doubles to ).
- At : .
- Sanity check by matrix multiplication: , and .
A change of variable transforms the matrix by congruence, and this is the operation that will remove cross terms.
Proposition 11.21 (Change of variable in a quadratic form). If with invertible, then
and is symmetric. The matrices and are said to be congruent.
Proof. Substitute: . Symmetry of was proved among the constructions above.∎
Congruence is not similarity — and generally have different eigenvalues. What congruence does preserve is the number of positive, negative and zero eigenvalues.
Theorem 11.22 (Sylvester's law of inertia). Let be real symmetric and let be invertible. Then and have the same inertia: the same number of positive eigenvalues, the same number of negative eigenvalues, and the same number of zero eigenvalues. The pair is called the signature of the form.
Proof. Write for the rank, which is unchanged by multiplication by invertible matrices, so only needs proving. Let be a -dimensional subspace on which for — the span of the eigenvectors with positive eigenvalues works, since on it . Let be the span of the remaining eigenvectors, of dimension , on which . Any subspace with on must meet only in , so , i.e. . Thus is the largest dimension of a subspace on which is strictly positive — a description that mentions only the function and the linear structure. Since is a linear bijection carrying such subspaces for to such subspaces for and back, the two maxima agree. The same argument with replaced by handles .∎
Completing the square is the hand method for finding the signature; it produces a congruence without any eigenvalue computation.
Example 11.23 (Diagonalising a form by completing the square). Write as a sum of squares, and do the same for .
Solution.
- Group the terms containing : .
- Hence . With , , : signature , and unless , i.e. unless .
- For : , so . Signature : takes both signs, e.g. and .
- Sanity check against the matrices. has with and , so both eigenvalues are positive — consistent with signature . has with , so the eigenvalues have opposite signs, consistent with .
Intuition. A quadratic form is a landscape over the plane with the origin pinned at height zero. is a bowl: every direction climbs, steeper along than along . is a mountain pass: climb along , descend along . The signature counts the climbing directions and the descending directions, and Sylvester's law says that count is a property of the landscape, not of the coordinates you happened to describe it in.
Pitfall. When reading off the matrix of a form, the off-diagonal entry is half the cross-term coefficient. For the matrix is , not . Putting the whole coefficient in changes the eigenvalues and can change the classification.
11.5Principal axes and the geometry of level sets
Completing the square uses a general invertible change of variable and distorts angles and lengths. If instead the change of variable is orthogonal, the picture is rotated rather than deformed, so geometric features — axes, lengths, angles — survive. That is the content of the principal axes theorem, which is the Spectral Theorem restated for forms.
Theorem 11.24 (Principal axes theorem). Let with symmetric, and let be an orthogonal diagonalisation with eigenvalues . Under the orthogonal change of variable ,
a form with no cross terms. The columns of are the principal axes of the form.
Proof. By the change-of-variable proposition the new matrix is , using twice. A diagonal matrix has no off-diagonal entries, so the form is .∎
Since is orthogonal, : the change of variable is a rotation (or a rotation combined with a reflection, when ). The coordinate is the component of along , namely . A level set is therefore congruent, as a geometric figure, to , and the eigenvalues classify it.
Corollary 11.25 (Classification of central conics). For symmetric with eigenvalues , the curve with is:
- an ellipse if , with semi-axes and along ;
- a hyperbola if have opposite signs, with axis along the eigenvector for the positive eigenvalue;
- a pair of parallel lines if exactly one eigenvalue is zero and the other is positive, and the empty set if the nonzero eigenvalue is negative;
- the empty set if , and the single point if with both eigenvalues of the same sign.
Proof. In principal axes the equation reads . Dividing by gives whenever both eigenvalues are nonzero; this is the standard equation of an ellipse when both denominators are positive and of a hyperbola when one is negative. If both the left side is never positive. If the equation is , which is — two parallel lines — when , and has no solution when .∎
Because , the familiar discriminant test falls out: for , the curve is an ellipse when , a hyperbola when , and degenerate when . The eigenvalue version tells you more, though: it also gives the directions and the lengths of the axes.
Example 11.26 (A full conic classification). Classify and sketch .
Solution.
- Matrix of the form: , , and the cross coefficient halves to , so .
- Eigenvalues: , , so , giving and . Both positive, so the curve is an ellipse.
- Principal axes: for , forces , so ; for , and .
- In principal axes the equation is , i.e.
The semi-major axis has length and points along ; the semi-minor axis has length along . The ellipse is the standard one rotated by . 5. Sanity check: the point should lie on the curve. Substituting, . Correct.□
Example 11.27 (A hyperbola). Classify and find its vertices.
Solution.
- , with and , so and the eigenvalues are and . Opposite signs: a hyperbola.
- Eigenvectors: gives , so ; gives , so .
- Principal-axis form: , i.e. . The transverse axis is the -axis, in the direction , and the vertices are at , .
- Back in the original coordinates the vertices are .
- Sanity check: at the form is . On the curve, as required. The asymptotes are , at to the transverse axis.
Example 11.28 (A quadric surface). Classify the surface .
Solution.
- Each cross coefficient halves to , so , where is the all-ones matrix.
- has rank : its eigenvalues are (eigenvector , since each row sums to ) and twice (the plane ). Adding shifts every eigenvalue by , so has eigenvalues and .
- All eigenvalues are positive, so the surface is an ellipsoid. In principal axes, , i.e.
- The short axis has length along ; in the perpendicular plane the eigenvalue is in every direction, so the cross-section is a circle of radius . The surface is a prolate spheroid flattened along the diagonal.
- Sanity check: , and the point gives , on the surface as predicted.
Remark. For a form the rotation angle can be read off without finding eigenvectors: the principal axes make an angle with the coordinate axes where
When the denominator vanishes and , which is why both worked examples above rotated by exactly .
Pitfall. The principal axes theorem applies to central conics, those with no linear terms. A curve such as needs a translation first — complete the square in the linear terms to move the centre to the origin — and only then a rotation. Parabolas arise precisely when one eigenvalue is zero and a linear term survives the translation.
11.6Constrained optimisation and the Rayleigh quotient
A quadratic form has no maximum on all of : scaling by scales by . The meaningful question is the constrained one — how large can be on the unit sphere? The answer is the largest eigenvalue, and the proof is two lines once the form is in principal axes.
Definition 11.29 (Rayleigh quotient). For a symmetric and , the Rayleigh quotient is
It is unchanged by scaling, for , so its values are exactly the values of on the unit sphere.
Theorem 11.30 (Extreme values of a quadratic form on the unit sphere). Let be real symmetric with eigenvalues ordered and corresponding orthonormal eigenvectors . Then
attained at and respectively. Consequently, for every ,
Proof. Write , so that and by the principal axes theorem. Since with every , the quantity is a weighted average of the eigenvalues. An average of numbers lies between the smallest and the largest:
Both bounds are attained: corresponds to , giving , and gives . The unconstrained inequality follows by applying the constrained one to and multiplying through by ; it also holds trivially at .∎
The proof explains why the eigenvector is optimal in a way that Lagrange multipliers do not: in principal axes the constraint is "distribute a total weight of one among the eigenvalues", and the best you can do is put all the weight on the largest. Incidentally, Lagrange multipliers give the same answer and reveal where the name comes from — maximising subject to has stationarity condition , so the multiplier is the eigenvalue.
Restricting further to directions orthogonal to the top eigenvector produces the next eigenvalue, and iterating gives all of them.
Corollary 11.31 (The next eigenvalue). With notation as above,
attained at . More generally, maximising over unit vectors orthogonal to gives .
Proof. The constraint says , so the average now runs over only, and the same averaging argument bounds it by , attained at . The general case is identical with the first coordinates set to zero.∎
Theorem 11.32 (Courant–Fischer min–max, statement). For real symmetric with and each ,
the extrema running over subspaces of the stated dimension.
The previous corollary needed the eigenvectors in order to describe ; Courant–Fischer removes them, characterising every eigenvalue purely by the form. That is what makes it the tool for comparing spectra: it yields at once that the eigenvalues of increase when is replaced by with positive semidefinite, and the interlacing theorem for the eigenvalues of a principal submatrix. The proof is the same averaging argument applied to a dimension count: any -dimensional must intersect the -dimensional span of nontrivially, which caps the inner minimum at , and attains it.
Intuition. Stand on the surface above the unit circle and walk once around. The height you trace is a weighted average of and , and you are highest exactly over the direction and lowest over . For the walk climbs to over the direction and drops to over the direction — never outside , because you can never be higher than the highest point or lower than the lowest.
Example 11.33 (Maximum and minimum on the unit sphere). Find the maximum and minimum of subject to , and the points where they occur.
Solution.
- , with and .
- gives and .
- Maximum , attained at the unit eigenvector for : gives , so at .
- Minimum , attained at .
- Sanity check: at , ; at , , comfortably between and .
Example 11.34 (A three-variable constrained maximum). Maximise on the unit sphere in for , and find the maximum subject to the extra constraint .
Solution.
- Expand along the first row: .
- The roots are and , i.e. . Ordered: , , .
- The maximum on the unit sphere is . Its eigenvector solves : the first row gives , so , and by symmetry of the second and third rows . Thus , of length , so .
- With the extra constraint the maximum drops to , attained at the unit eigenvector for , which is (check: ).
- Sanity check: and . Also , as the orthogonality lemma requires.
Remark. The same extremal problem for a non-symmetric or rectangular matrix asks for the maximum of on the unit sphere. Since and is symmetric, this theorem answers it: the maximum is , which is the largest singular value of . That observation is the doorway to the SVD chapter.
Pitfall. The maximum of on the unit sphere is , not . For the maximum is and the minimum is ; the number is the spectral norm , which answers a different question — the maximum of , not of .
11.7Positive definite matrices
Among symmetric matrices, the positive definite ones play the role that positive numbers play among the reals: they have square roots and inverses of the same kind, they define inner products and distances, and they mark the minima of smooth functions. This section gathers the five standard tests and proves them equivalent.
Definition 11.35 (Definiteness). Let be a real symmetric matrix and . Then (and ) is
- positive definite if for all ;
- positive semidefinite if for all ;
- negative definite if for all , and negative semidefinite if for all ;
- indefinite if takes both a positive and a negative value.
Negative definiteness needs no separate theory: is negative definite exactly when is positive definite, so every test below applies after a sign flip. In signature language, positive definite means , positive semidefinite means , and indefinite means and .
Theorem 11.36 (Five equivalent tests for positive definiteness). For a real symmetric matrix , the following are equivalent.
- for every .
- Every eigenvalue of is positive.
- (Sylvester's criterion) Every leading principal minor is positive: for , where is the upper-left submatrix.
- Gaussian elimination on needs no row exchanges and produces positive pivots.
- for some matrix with linearly independent columns.
Proof. (1) (2). By the Rayleigh theorem, . So the form is positive on all unit vectors — equivalently, by scaling, on all nonzero vectors — exactly when .
(2) (5). Write and put , where is real because the eigenvalues are positive. Then , and is invertible (a product of invertible matrices), so its columns are independent.
(5) (1). , with equality only if ; independent columns force .
(1) (3). Fix and let be nonzero. Pad it with zeros to . Then , because the zero entries kill every term involving a row or column beyond the -th. So is itself positive definite, hence by (1) (2) all of its eigenvalues are positive, and — their product — is positive.
(3) (4). Elimination without row exchanges produces the factorisation with unit lower triangular and the pivots, and comparing leading blocks gives , hence . So
a ratio of positive numbers, hence positive. Positivity of also guarantees the -th pivot is nonzero at each stage, so no row exchange is ever needed.
(4) (1). With and all , substitute :
This is a sum of nonnegative terms, zero only when every ; and is invertible, so forces .
The cycle (1) (3) (4) (1) together with (1) (2) and (2) (5) (1) proves all five equivalent.∎
Each test is best for something. Test (1) is the definition and the one that transfers to infinite dimensions. Test (2) gives the most information — the actual eigenvalues — but is the most work. Test (3) is fastest by hand for : three determinants and no root-finding. Test (4) is what elimination already computes, so it is free if you were solving a system anyway. Test (5) is the structural one: it says positive definite matrices are exactly the Gram matrices of independent vectors, which is why appears in least squares and why kernel matrices in machine learning are positive semidefinite.
Proposition 11.37 (Properties of positive definite matrices). Let be positive definite matrices and . Then:
- is invertible, and is positive definite;
- every diagonal entry , and more generally every principal submatrix is positive definite;
- and are positive definite;
- is positive definite for every invertible ;
- has a unique positive definite square root ;
- the largest entry of in absolute value sits on the diagonal.
Proof. (1) No eigenvalue is zero, so is invertible; the eigenvalues of are the reciprocals . (2) Take to get ; the padding argument from the theorem, applied to an arbitrary index set rather than the first , handles principal submatrices. (3) for . (4) since when . (5) Existence is from the spectral decomposition; for uniqueness, a positive definite square root commutes with , hence preserves each eigenspace of , and on the eigenspace for it must be a positive definite matrix squaring to , so it is there. (6) Suppose for some . The principal submatrix must be positive definite by (2), so , contradicting .∎
Intuition. A positive definite defines a new way to measure length, , and a new inner product . Definiteness is exactly the axiom "the length of a nonzero vector is positive"; without it you would have nonzero vectors of length zero, and geometry would collapse. The unit "circle" in this geometry is the ellipse , whose axes are the eigenvectors and whose semi-axes are — large eigenvalue, short axis, because that direction is expensive.
Method 11.38 (Classifying a symmetric matrix by hand).
- If any diagonal entry is , it cannot be positive definite. If the diagonal has both signs, it is indefinite; stop.
- Compute the leading principal minors .
- All positive positive definite. Alternating , , negative definite (apply Sylvester to ).
- Some leading minor negative in the wrong place, or with even indefinite.
- If a leading minor is zero, Sylvester is inconclusive: compute the eigenvalues, or check all principal minors (not just the leading ones) for the semidefinite question.
Example 11.39 (Sylvester's criterion in action). Classify and .
Solution.
- .
- .
- . All three positive, so is positive definite.
- Cross-check with pivots: , , . All positive, agreeing with test (4). We computed the eigenvalues of this matrix earlier: and , all positive, agreeing with test (2).
- For : but . Sylvester fails, so is not positive definite; since the two eigenvalues have opposite signs, so is indefinite. Indeed while and .
Example 11.40 (A definiteness threshold). For which real is positive definite?
Solution.
- always.
- always.
- : expanding along the first row, .
- Sylvester's criterion therefore holds exactly when , i.e. .
- Sanity check at the threshold: for the matrix is singular, and gives , so — positive semidefinite but not definite. For , and the same vector makes negative: at , .
Pitfall. Sylvester's criterion does not extend to the semidefinite case by relaxing " " to " ". The matrix has leading minors and , both nonnegative, yet , so it is not positive semidefinite. The correct semidefinite test requires all principal minors — every symmetric choice of rows and columns, not just the leading ones — to be nonnegative. In practice, compute the eigenvalues instead.
Pitfall. Positive entries do not make a matrix positive definite, and positive definite matrices may have negative entries. has all entries positive and eigenvalues ; has negative entries and eigenvalues . Likewise alone is not enough: in has determinant .
11.8The Cholesky factorisation
Test (5) above produces some with . Demanding that be triangular pins it down completely and yields the algorithm that numerical software actually uses to test and exploit positive definiteness.
Theorem 11.41 (Cholesky factorisation). A real symmetric matrix is positive definite if and only if it can be written
with lower triangular with strictly positive diagonal entries. This is unique.
Proof. () If with invertible (its diagonal entries are nonzero), then with , whose columns are independent, so is positive definite by test (5).
() Induct on . For , with and , uniquely. For write
with . Set and . A direct multiplication gives
so taking the Schur complement reproduces . The outer factors are invertible, so is congruent to and hence positive definite; therefore is a positive definite matrix of size . By induction with lower triangular with positive diagonal, and then
is lower triangular with positive diagonal and satisfies . Uniqueness follows the same induction: comparing the entries of forces (the positive root), the first column then forces , and the remaining block is the unique factorisation of .∎
Comparing with from elimination shows , so the Cholesky diagonal entries are the square roots of the pivots: . Equating entries in column by column turns the induction into a formula.
Method 11.42 (Computing the Cholesky factor). Process columns in order. For each :
If at any step the quantity under the square root is zero or negative, stop: is not positive definite.
Example 11.43 (A Cholesky factorisation). Factor as .
Solution.
- Column : , then and .
- Column : , then
- Column : .
- So . No square root of a non-positive number appeared, so is positive definite.
- Sanity check: . And , while the pivots are , whose product is also .
Example 11.44 (Cholesky as a definiteness test). Decide whether is positive definite by attempting a Cholesky factorisation.
Solution.
- Column : , , .
- Column : , and .
- Column : . The algorithm succeeds, so is positive definite with .
- Cross-check with Sylvester: , , and . All positive.
- Contrast: changing the entry to would give , and the algorithm would fail at that step, correctly reporting that the modified matrix is not positive definite.
Remark. Cholesky is the preferred numerical test for two reasons. It costs about multiplications, half of an ordinary factorisation and far less than an eigenvalue computation, and it is backward stable without pivoting — positive definiteness itself keeps the entries of bounded, so no row exchanges are needed and no growth factor has to be monitored. Sylvester's criterion, by contrast, is a poor numerical test: computing determinants is both expensive and badly conditioned. Once is in hand, solving costs two triangular solves, then .
Pitfall. is lower triangular but it is not a matrix of eigenvectors, and its diagonal holds the square roots of the pivots, not the square roots of the eigenvalues. Only the product is shared. Also, is not the same factorisation as ; the two differ by the scaling , and has the advantage of needing no square roots, which is why it is preferred for semidefinite or indefinite symmetric matrices.
11.9Where positive definiteness comes from
The tests above are worth having because positive definiteness is the hypothesis in a surprising number of theorems. Three sources account for most appearances: curvature, energy and covariance.
Theorem 11.45 (Second derivative test). Let have continuous second partial derivatives, and let be a critical point (). Let be the Hessian at , the symmetric matrix with entries . Then:
- positive definite has a strict local minimum at ;
- negative definite a strict local maximum;
- indefinite a saddle point;
- singular the test is inconclusive.
The reason is Taylor's theorem. Near ,
the linear term having vanished. So the quadratic form is the leading behaviour, and by the Rayleigh theorem it is at least ; when that positive lower bound dominates the error term for small , forcing . The Hessian is symmetric precisely because mixed partials commute (Clairaut's theorem), which is what admits it to this chapter at all. When is singular the quadratic term vanishes in some direction and the cubic terms decide, as in versus .
Example 11.46 (Classifying critical points). Find and classify the critical points of .
Solution.
- . Setting both to zero: and , so and or . The critical points are and .
- .
- At : with , so the eigenvalues have opposite signs. Indefinite: a saddle point.
- At : with leading minors and . Positive definite: a strict local minimum, of value .
- Sanity check at the saddle: along , has a local maximum at ; along , for , a local minimum. Two directions disagreeing is exactly what a saddle looks like.
Example 11.47 (A stiffness matrix). Two springs of stiffness are connected in series: the first joins a fixed wall to a mass at displacement , the second joins that mass to a second mass at displacement . The stored elastic energy is . Write and show is positive definite.
Solution.
- Expand: .
- Halving the cross coefficient gives .
- Sylvester: , and . Positive definite.
- Structural reason: with we have , and has independent columns because . This is test (5), and physically it says the energy is a sum of squares of the individual spring extensions — zero only when nothing is stretched.
- Sanity check: the energy must be strictly positive whenever some spring is stretched, and indeed forces and then .
Proposition 11.48 (Gram and covariance matrices). For any real matrix , the matrix is symmetric positive semidefinite, and it is positive definite exactly when the columns of are linearly independent.
Proof. Symmetry was proved among the constructions. For any , , so is positive semidefinite. Equality holds for some exactly when has a nontrivial solution, i.e. exactly when the columns are dependent.∎
If the columns of are centred measurements of variables across observations, then
is the sample covariance matrix: positive semidefinite by the proposition, so all its eigenvalues are real and nonnegative, and by the Spectral Theorem it has an orthonormal eigenbasis. Those eigenvectors are the principal components and the eigenvalues are the variances along them — the maximisation from the Rayleigh section is precisely the statement that the first principal component is the direction of greatest variance. Principal Component Analysis and the numerically stable route to it are developed in the Singular Value Decomposition chapter; everything it needs about is proved here.
The same proposition is the reason least squares works: the normal equations have a unique solution exactly when has independent columns, and then is positive definite, so the critical point of the sum of squared residuals is a genuine minimum by the second derivative test — its Hessian is .
Remark. A positive definite also supplies a genuine inner product on : bilinearity and symmetry are immediate from , and positivity is the definiteness. Every inner product on arises this way, with . This is the bridge to the inner-product-spaces chapter, and it is why the Mahalanobis distance in statistics is a distance at all: is positive definite whenever is.
Intuition. Three unrelated-looking questions — "is this critical point a minimum?", "is this structure stable?", "is this covariance matrix invertible?" — are the same question. Each asks whether a certain energy-like quantity is strictly positive in every direction. The matrix changes, the test does not, and the answer is always: check the eigenvalues, the leading minors, the pivots, or run Cholesky and see whether it finishes.
Summary (The Spectral Theorem and the definiteness tests). Everything here needs real, square and symmetric, — equivalently self-adjoint, , which is the identity every proof uses. Then all eigenvalues are real, eigenvectors for distinct eigenvalues are orthogonal, no eigenvalue is defective, and the Spectral Theorem gives with orthogonal and real diagonal; conversely any such factorisation forces . Equivalently with orthogonal projections summing to , so . For the form (whose symmetric matrix is unique, with off-diagonal entries half the cross-term coefficients) the orthogonal change removes all cross terms, leaving : the signs of the eigenvalues classify the level sets (ellipse if both positive, hyperbola if mixed), and Sylvester's law of inertia says the signature survives any congruence with invertible. On the unit sphere at and at , so . Finally, is positive definite iff any one of: for ; every eigenvalue is positive; every leading principal minor is positive (Sylvester's criterion — which does not relax to for the semidefinite case); elimination needs no exchanges and gives positive pivots; with of independent columns — equivalently with lower triangular of positive diagonal, the unique Cholesky factor.
- Assuming every matrix is orthogonally diagonalisable. Only symmetric matrices are, and the converse holds too: if with orthogonal, then must be symmetric.
- Applying Gram–Schmidt across different eigenspaces. Eigenvectors for distinct eigenvalues are already orthogonal; orthogonalising them against each other destroys the eigenvector property. Gram–Schmidt is needed only *within* a repeated eigenspace.
- Writing for a non-symmetric matrix. The general formula is ; equals only when is orthogonal.
- Putting the whole cross-term coefficient into the matrix of a quadratic form. For the off-diagonal entry is , half of the coefficient of .
- Confusing congruence with similarity . Congruence preserves the signature but changes the eigenvalues; only an orthogonal makes the two coincide.
- Reporting as the maximum of on the unit sphere. The maximum is and the minimum is ; the largest absolute value answers a different question.
- Forgetting that a quadratic form has no unconstrained maximum unless it is negative semidefinite. Optimisation of a form is only meaningful subject to a constraint such as .
- Testing positive definiteness by looking at the entries. Positive entries prove nothing, and a positive definite matrix may have negative off-diagonal entries.
- Using alone as a test. In even dimensions a negative definite matrix also has positive determinant; all leading minors are needed.
- Relaxing Sylvester's criterion to for the semidefinite case. That is false — is the standard counterexample. The semidefinite test needs *all* principal minors, not just the leading ones.
- Applying the principal axes theorem to a conic with linear terms. Translate the centre to the origin first, then rotate.
- Expecting the diagonal of the Cholesky factor to hold eigenvalues. It holds the square roots of the pivots; only the products agree.
- Declaring a critical point a minimum because one second derivative is positive. The Hessian must be positive definite — every direction must curve upward, not just the coordinate directions.