Positive Definite Matrices
Positive-Definite Matrices, Energy, and Optimization
Symmetric matrices and their eigenvalues
A real symmetric matrix satisfies ST=S. Symmetry gives two important properties:
All eigenvalues of a real symmetric matrix are real.
Eigenvectors belonging to distinct eigenvalues are orthogonal.
For the first property, suppose Sv=λv for a nonzero vector v. Then
Because S is real and symmetric, the numerator is real, and the denominator is positive. Thus λ is real.
For the second property, let Su=λu and Sv=μv. Symmetry gives
Substituting the eigenvalue equations yields μuTv=λuTv. If λ=μ, then uTv=0, so the eigenvectors are orthogonal.
These properties make eigenvalues especially useful for describing symmetric matrices and the quadratic functions they define.
Positive definiteness
A symmetric matrix S is positive definite if
for every nonzero vector x. The expression xTSx is called the quadratic form or, in applications, the energy associated with S.
For a symmetric matrix, positive definiteness is equivalent to each of the following tests:
Eigenvalue test: every eigenvalue of S is positive.
Energy test: xTSx>0 for every nonzero x.
Factorization test: S=ATA for some invertible square matrix A.
Leading principal-minor test: every leading principal determinant is positive.
Pivot test: all pivots in elimination without row exchanges are positive.
Each test is sufficient on its own. The best test depends on what information about the matrix is easiest to use.
Why the determinant alone is not enough
The determinant of a matrix is the product of its eigenvalues. A positive determinant therefore does not guarantee that all eigenvalues are positive: an even number of eigenvalues could be negative. For positive definiteness, tests based only on the determinant of the entire matrix are not sufficient; the leading determinants or the eigenvalues must also be considered.
A two-dimensional example
Consider
This matrix is symmetric, but symmetry alone does not make it positive definite.
Its determinant is
Because the matrix is symmetric, its two eigenvalues are real. Their product is the determinant, so one eigenvalue is positive and the other is negative. Thus S is indefinite: its quadratic form takes both positive and negative values.
The energy makes this behavior visible:
The cross term can be negative when x and y have opposite signs, and here it can outweigh the positive square terms for some vectors.
Increasing a diagonal entry
Now consider
The leading principal determinants are
Both are positive, so the matrix is positive definite.
Elimination gives the pivots directly. The first pivot is 3. Subtracting 34 times the first row from the second leaves the second pivot
The pivots are therefore 3 and 32, both positive. In this example, the second pivot is also the ratio of the second leading determinant to the first:
The boundary between positive definite and indefinite
For the family
the determinant is 3c−16. Its boundary value occurs when
At this value, the matrix is singular and has a zero eigenvalue. Its other eigenvalue is its trace,
which is positive. The matrix is therefore positive semidefinite: it has one positive eigenvalue and one zero eigenvalue.
Energy and the shape of a quadratic function
For
the energy is
The diagonal entries contribute the square terms, while each off-diagonal entry contributes to a cross term. Since the matrix is symmetric, the two off-diagonal contributions combine to give 8xy.
When S is positive definite, this quadratic function is positive away from the origin and has a bowl-shaped graph with its minimum at the origin. The cross term may be negative for some choices of x and y, but positive definiteness means the full expression remains positive for every nonzero vector.
This geometric interpretation is important: positive definiteness means the quadratic energy curves upward in every direction. If a matrix has a zero eigenvalue, the energy is flat in at least one direction rather than curving upward in every direction.
Quadratic energies and optimization
Many optimization problems seek to minimize a function of many variables. A positive-definite quadratic provides a basic model:
Its minimum is at x=0. Adding a linear term, such as xTb, shifts the location of the minimum but preserves the bowl-shaped character when S remains positive definite. The minimum can then be found by setting the first derivatives to zero.
Practical loss functions can be much more complicated. They may contain nonlinear terms and need not be purely quadratic, but quadratic energies provide a useful model for understanding how curvature affects minimization. In machine learning, for example, a loss function measures error between predictions and data, and training seeks values of the model’s parameters that minimize that loss.
Gradient descent
For a function of many variables, its gradient is the vector of its first partial derivatives. At a given point, the negative gradient indicates the direction of steepest decrease.
A basic gradient-descent procedure is:
Choose a starting point x0.
Compute the gradient at the current point.
Move in the direction of the negative gradient.
Choose a step length, often by a line search that checks how far to move along that direction.
Recompute the gradient at the new point and repeat.
The method uses first derivatives rather than a full collection of second derivatives. This matters for problems with very large numbers of variables, where computing and handling second-derivative information can be expensive. In practice, choosing step lengths and making the method converge efficiently are important challenges.
Curvature and narrow valleys
A quadratic bowl’s eigenvalues describe its curvature in different directions.
If the eigenvalues are all equal, the bowl is circular in two dimensions (or spherical in higher dimensions). For the function x2+y2, the gradient points directly toward the center, so a step in the steepest-descent direction can reach the minimum.
If the eigenvalues differ greatly, the bowl is elongated, forming a narrow valley. The steepest-descent direction may point across the valley rather than along it. Repeated steps can zigzag from one side to the other, making slow progress toward the minimum.
Thus positive definiteness ensures upward curvature, but it does not guarantee that gradient descent will be fast. The relative sizes of the eigenvalues influence how difficult the optimization is.
For general nonlinear functions, the surface may have additional dips or may fail to be convex. In those settings, a local descent process can have difficulty finding the globally best minimum.
Operations that preserve positive definiteness
The energy test is often especially effective for proving that a matrix is positive definite.
Sum of positive-definite matrices
If S and T are positive definite, then for every nonzero x,
Both terms on the right are positive, so their sum is positive. Therefore, S+T is positive definite.
Inverse of a positive-definite matrix
If S is positive definite, its eigenvalues are positive. The eigenvalues of S−1 are their reciprocals, 1/λi, which are also positive. Since S−1 is symmetric, it is positive definite as well.
Orthogonal change of coordinates
Let Q be orthogonal, so QTQ=I, and let S be positive definite. The matrix QTSQ is symmetric. For any nonzero x,
An orthogonal matrix preserves lengths and does not map a nonzero vector to zero, so Qx=0. Since S is positive definite, the expression is positive. Therefore, QTSQ is positive definite.
This result also follows from similarity: because Q−1=QT, the matrices QTSQ and S have the same eigenvalues.
Positive semidefinite matrices
A symmetric matrix S is positive semidefinite if
for every vector x. Equivalently, all its eigenvalues are nonnegative. Unlike a positive-definite matrix, a positive-semidefinite matrix may have zero eigenvalues and may be singular.
For the two-dimensional example, the boundary matrix
has one positive eigenvalue and one zero eigenvalue. It lies on the boundary between positive-definite and indefinite matrices.
A positive-semidefinite matrix can be expressed as ATA, though A need not be invertible. If A has dependent rows or columns as appropriate to the factorization, the resulting matrix can be singular. This is the semidefinite counterpart of the positive-definite factorization test.
The all-ones matrix
Consider the 3×3 matrix
Its rank is 1, so it has only one nonzero eigenvalue. The trace is 3, and the trace equals the sum of the eigenvalues. Therefore its eigenvalues are 3,0,0, making it positive semidefinite but not positive definite.
Its energy also shows this directly:
The energy is zero whenever x1+x2+x3=0, so the matrix is not positive definite.
The matrix is also a Gram-type factorization:
This is a product of the form ATA if A is taken as the row vector [111].
Key distinctions
Positive definite: all eigenvalues are positive; the energy is positive for every nonzero vector.
Positive semidefinite: all eigenvalues are nonnegative; the energy can be zero for nonzero vectors.
Indefinite: the energy takes both positive and negative values; for a symmetric matrix, this corresponds to having both positive and negative eigenvalues.
A positive determinant alone does not establish positive definiteness; the full set of leading principal determinants, or another equivalent test, is needed.

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