Positive Definite Matrices
Positive-Definite Matrices, Energy, and Optimization
Symmetric matrices: the starting point
A symmetric matrix is a square matrix that equals its transpose: S=ST. Symmetry matters because it gives a matrix especially useful structure: its eigenvalues are real, and it has a basis of orthogonal eigenvectors. In fact, the eigenvectors can be chosen to be an orthonormal basis.
The real-eigenvalue result follows from symmetry. If v is an eigenvector with eigenvalue λ, then Sv=λv. Using complex conjugation, symmetry gives v∗Sv=λv∗v, and the left side is real. Since v∗v is positive, λ must be real. For orthogonality, suppose Sv=λv and Sw=μw. Symmetry gives vTSw=(Sv)Tw, so μvTw=λvTw. If the eigenvalues are different, this equality requires vTw=0: the eigenvectors are perpendicular.
This structure makes it possible to understand a symmetric matrix through its eigenvalues and eigenvectors. It also gives several equivalent ways to determine whether the matrix is positive definite.
Positive definiteness and the energy of a vector
A symmetric matrix S is positive definite when its quadratic expression is positive for every nonzero vector x:
xTSx>0for every x=0.The expression xTSx is often called the energy associated with x and S. It is quadratic because each component of x is multiplied by another component of x.
For example, consider
S=[3446],x=[xy].Multiplying out the energy gives
xTSx=[xy][3446][xy]=3x2+8xy+6y2.The diagonal entries produce the squared terms, and the off-diagonal entries produce the cross terms. Here, the two off-diagonal contributions are both 4xy, giving 8xy altogether.
The cross term can be negative when x and y have opposite signs, so positive diagonal entries alone do not guarantee positive energy. Positive definiteness means that the full expression remains positive for every nonzero choice of the vector. Geometrically, the energy forms a bowl with its lowest point at the origin.
A symmetric matrix is positive definite precisely when every nonzero vector has positive energy.
A key example
For the matrix above, the determinant is
det(S)=3⋅6−4⋅4=2.Its trace, the sum of its diagonal entries, is 3+6=9. The two eigenvalues are real; their product is the determinant, and their sum is the trace. Since their product is positive and their sum is positive, both eigenvalues are positive. Thus S is positive definite.
By contrast, consider
[3445].Its determinant is 15−16=−1. Because the eigenvalues are real and their product is negative, one eigenvalue is positive and the other is negative. The matrix is indefinite: its energy is positive for some vectors and negative for others.
This contrast shows why having positive entries is not enough. Positive definiteness concerns the behavior of the entire quadratic expression, not the signs of the individual entries.
Think About It
Why can a quadratic expression with positive squared terms still become negative? The cross terms can pull the value downward, so the question is whether the squared terms always outweigh them.
Equivalent tests for positive definiteness
For a symmetric matrix, several tests give equivalent answers. Any one of these can establish positive definiteness; the most convenient test depends on the problem.
Positive eigenvalues
A symmetric matrix is positive definite exactly when all its eigenvalues are positive. To see why, use an orthonormal eigenbasis. In that basis, the energy is a sum of terms of the form λizi2, where λi are the eigenvalues and zi are the coordinates of the vector. Every nonzero vector has positive energy if and only if every λi is positive.
This is a direct test in theory, but finding eigenvalues can be inconvenient in practice.
Positive energy
The definition itself is a test: check whether xTSx>0 for every nonzero x. This viewpoint is especially helpful for proving general statements, because expressions involving the energy can often be compared or rearranged directly.
A factorization as ATA
A positive-definite matrix can be written as
S=ATAfor an invertible square matrix A. This factorization explains positive energy:
xTSx=xTATAx=(Ax)T(Ax)=∥Ax∥2.A squared length is positive unless Ax=0. Since A is invertible, Ax=0 can happen only when x=0.
The same idea explains positive semidefiniteness, introduced later: if A is not invertible, or is rectangular, ATA still has nonnegative energy, but some nonzero vectors may have zero energy.
Positive leading principal determinants
A leading principal determinant is the determinant of a square block taken from the upper-left corner of the matrix. For a matrix of size n, the tests use the upper-left blocks of sizes 1,2,…,n.
For the example
S=[3446],the first leading determinant is 3, and the second is the full determinant, 2. Both are positive, so this test confirms positive definiteness.
The word leading is important. The full determinant alone is not enough. For instance,
[−344−6]also has determinant 2, but its first leading determinant is −3. It fails the leading-determinant test and is not positive definite. In fact, it is negative definite: its eigenvalues are both negative. The full determinant records the product of the eigenvalues, not whether each one is positive.
Positive elimination pivots
Gaussian elimination links positive definiteness to pivots, the diagonal entries produced during elimination. For the example matrix, the first pivot is 3. Eliminating the 4 below it uses the multiplier 34, leaving the second pivot
6−34⋅4=6−316=32.Both pivots are positive. The second pivot also equals the second leading determinant divided by the first:
32.In general, with the leading blocks ordered from the upper-left corner, each pivot is the ratio of consecutive leading determinants. Thus positive leading determinants and positive pivots express the same test in two related forms.
For an n×n symmetric matrix, these checks involve n stages. The determinant test, pivot test, energy test, eigenvalue test, and factorization test are different ways of detecting the same positive-definite structure.
Think About It
If the determinant is positive, what does that say about the eigenvalues—and what does it leave unanswered? It gives their product, but without other information it does not establish that every eigenvalue is positive.
Positive definiteness and optimization
The bowl-shaped energy of a positive-definite matrix is also a basic model for optimization: finding the input that makes a function as small as possible. A quadratic function such as xTSx has its minimum at the origin. Adding a linear term can shift the minimum away from the origin while preserving the bowl shape:
f(x)=xTSx+bTx.For a positive-definite S, this quadratic has a unique minimum. Its gradient is 2Sx+b, so the minimum occurs where
2Sx+b=0.This simple quadratic model connects to more complicated loss functions used in machine learning. A loss function measures how poorly a model’s outputs match desired results; training seeks values of the model’s parameters that reduce that loss. In large problems, the function can depend on many variables, and it may include nonlinear terms rather than being a simple quadratic.
A function whose graph has a bowl-like shape is called convex. For a quadratic function, positive definiteness gives a strictly bowl-shaped energy, while allowing zero eigenvalues gives a flatter, positive-semidefinite case. More complicated functions can have additional bends or dips, so they need not be convex. In a nonconvex problem, a descent method may encounter a local minimum without reaching the lowest value overall.
Gradient descent
A common approach to minimization uses the gradient, the vector of first derivatives of the function. At a given point, the gradient indicates the direction of steepest increase; its negative indicates the direction of steepest decrease.
Gradient descent repeatedly performs two actions:
- It calculates the gradient at the current point.
- It moves in the direction of steepest decrease, then calculates a new gradient at the new point.
Choosing how far to move in each direction is called a line search. A step that is too long may pass the bottom of a valley and head upward again; a shorter step may be safer but slower. The method uses first derivatives rather than second derivatives, which can be much more costly to calculate when there are many variables.
Positive definiteness helps explain the shape of a quadratic bowl, but it does not guarantee that gradient descent will be fast. The eigenvalues describe how steep the bowl is in different directions. If they are very different in size, the bowl is long and narrow. From one side of such a valley, the steepest descent direction may cross to the other side rather than travel efficiently toward the bottom. Repeated crossings can make progress slow.
When the eigenvalues are equal, the bowl is circular in the corresponding coordinates. For example, the energy x2+y2 has equally steep directions. Starting anywhere other than the origin, following the steepest descent direction heads straight toward the center. Thus the relative sizes of the eigenvalues—not just whether they are positive—affect how well gradient descent behaves.
Useful operations that preserve positive definiteness
The energy test makes it easy to study some operations on positive-definite matrices without calculating new eigenvalues, determinants, or pivots.
Adding positive-definite matrices
If S and T are positive definite, then
xT(S+T)x=xTSx+xTTx.For every nonzero x, both terms on the right are positive, so their sum is positive. Therefore, S+T is positive definite.
Taking the inverse
If S is positive definite, then it is invertible, and its inverse is also symmetric and positive definite. Its eigenvalues are the reciprocals of the eigenvalues of S. Since the original eigenvalues are positive, their reciprocals are positive as well.
Changing coordinates orthogonally
If Q is an orthogonal matrix, then QTQ=I and QT=Q−1. The matrix
QTSQis symmetric whenever S is symmetric. It is also positive definite, because its energy can be rewritten as
xTQTSQx=(Qx)TS(Qx).For nonzero x, the vector Qx is also nonzero, so this energy is positive when S is positive definite. In addition, QTSQ is similar to S, which means it has the same eigenvalues.
Think About It
Why is the energy test useful when adding two positive-definite matrices? It lets each matrix contribute a positive quantity to the sum, avoiding the need to compute the sum’s eigenvalues.
Positive semidefinite matrices: the boundary case
A symmetric matrix is positive semidefinite when its energy is nonnegative for every vector:
xTSx≥0.Equivalently, all its eigenvalues are nonnegative. Unlike a positive-definite matrix, a positive-semidefinite matrix may have a zero eigenvalue. That makes it singular: there is a nonzero direction in which the energy is zero.
For the family
[344c],the determinant is 3c−16. Setting c=316 makes the determinant zero, so one eigenvalue is zero. The trace is then
3+316=325.Because the trace is the sum of the eigenvalues, the other eigenvalue is 325, which is positive. The matrix is therefore positive semidefinite: its eigenvalues are 325 and 0.
Positive-semidefinite matrices can be thought of as lying at the boundary of the positive-definite matrices. A positive-definite matrix has positive energy in every nonzero direction; a positive-semidefinite matrix may be flat in one or more directions, but its energy never drops below zero.
The all-ones matrix
Consider the 3×3 matrix whose entries are all 1:
J=111111111.All its rows are the same, so its rank is 1. It has one nonzero eigenvalue and two zero eigenvalues. The trace is 3, so the eigenvalues are 3,0,0. This matrix is positive semidefinite, but not positive definite, because it has zero eigenvalues.
The matrix has the factorization
J=ATA,A=[111].Indeed, for any vector x,
xTJx=∥Ax∥2≥0.Some nonzero vectors are sent to zero by A, so their energy is zero rather than positive. This is why J is semidefinite rather than definite.
The same matrix can be understood through its normalized eigenvector. The vector [111]T has length 3, so the corresponding unit vector is 31[111]T. Its eigenvalue is 3, and the other eigenvalues are zero. This expresses the matrix as a single eigenvector contribution: a rank-one matrix.
For a general matrix A, the product ATA is always positive semidefinite because xTATAx=∥Ax∥2. It is positive definite exactly when the columns of A are independent, so that no nonzero vector x satisfies Ax=0.
Comprehensive review
Positive definiteness is a property of a symmetric matrix that can be understood in several equivalent ways: all eigenvalues are positive; every nonzero vector has positive quadratic energy; the matrix has an appropriate factorization ATA with A invertible; all leading principal determinants are positive; and all elimination pivots are positive. These viewpoints are useful in different settings—spectral analysis, energy arguments, factorization, determinant checks, or elimination.
The energy viewpoint also connects linear algebra to optimization. A positive-definite quadratic forms a bowl, and its eigenvalues determine the bowl’s shape. A circular bowl supports direct descent toward its center, while a narrow bowl can slow gradient descent. Positive-semidefinite matrices mark the boundary case: their energy cannot be negative, but it may be zero along some nonzero directions.

Ask anything
We've read this whole study set, so questions about it get the best answers.