BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

Positive definite matrices and minima

For a symmetric 2 × 2 matrix (a b; b c), four tests for positive definiteness agree: both eigenvalues positive; the upper-left determinants a and ac − b² positive; the pivots a and (ac − b²)/a positive; and the new one, which most books take as the definition: xᵀAx = ax² + 2bxy + cy² > 0 for every x ≠ 0. With b = 6 and a = 2, the matrix needs c > 18. At c = 18 it is positive semidefinite (eigenvalues 0 and 20, one pivot); at c = 7 the determinant is −22, the form 2x² + 12xy + 7y² is negative at (1, −1), and its graph is a saddle. At c = 20, completing the square gives 2(x + 3y)² + 2y²: the pivots 2, 2 stand outside the squares and the multiplier 3 inside, so completing the square is elimination, and the graph is a bowl with its minimum at the origin. Cutting the bowl at height 1 gives an ellipse (a saddle gives a hyperbola). As in calculus, a minimum needs zero first derivatives and a positive definite matrix of second derivatives (f_xx, f_xy; f_xy, f_yy), which is symmetric because f_xy = f_yx. For the 3 × 3 matrix with 2 on the diagonal and −1 beside it: determinants 2, 3, 4; pivots 2, 3/2, 4/3; eigenvalues 2 − √2, 2, 2 + √2; xᵀAx = 1 is an ellipsoid whose axes point along the eigenvectors (A = QΛQᵀ, the principal axis theorem).

You need this first

Full reading path (24 pages)
  1. Vectors (8.01)
  2. Vectors and the dot product (18.02)
  3. Determinants and the cross product (18.02)
  4. Planes through three points, and matrices (18.02)
  5. Equations of planes and square systems (18.02)
  6. The geometry of linear equations (18.06)
  7. Elimination with matrices (18.06)
  8. Matrix multiplication and inverse matrices (18.06)
  9. Factorization into A = LU (18.06)
  10. Transposes, permutations and vector spaces (18.06)
  11. Properties of determinants (18.06)
  12. Determinant formulas and cofactors (18.06)
  13. Cramer's rule, the inverse matrix and volume (18.06)
  14. Column space and nullspace (18.06)
  15. Eigenvalues and eigenvectors (18.06)
  16. Diagonalisation and powers of A (18.06)
  17. Solving Ax = 0: pivot variables and special solutions (18.06)
  18. Solving Ax = b: the complete solution (18.06)
  19. Independence, basis and dimension (18.06)
  20. The four fundamental subspaces (18.06)
  21. Orthogonal vectors and subspaces (18.06)
  22. Projections onto subspaces (18.06)
  23. Projection matrices and least squares (18.06)
  24. Symmetric matrices and positive definiteness (18.06)
On this page · 6 sections
  1. Four tests for a 2 × 2 matrix
  2. The quadratic form x^TAx
  3. Completing the square is elimination
  4. Minima: the matrix of second derivatives
  5. A 3 × 3 example and an ellipsoid
  6. Summary

Positive definite matrices bring the whole course together: pivots, determinants, eigenvalues, and something new, the expression xTAxx^TAx, "the guy to watch" (transcript, p. 1). Three goals: how to tell whether a matrix is positive definite, why it matters (minima), and the geometry (ellipses, not hyperbolas) (p. 1). All matrices here are symmetric. An earlier lecture (Lecture 25) made a start.

Four tests for a 2 × 2 matrix#

For A=(abbc)A = \begin{pmatrix} a & b \\ b & c \end{pmatrix}, each of these is a complete test (pp. 1–2):

Tests for positive definiteness
(1) λ1>0, λ2>0(2) a>0, ac−b2>0(3) pivots a>0, ac−b2a>0(4) xTAx>0 for all x≠0\text{(1) } \lambda_1 > 0,\ \lambda_2 > 0 \qquad \text{(2) } a > 0,\ ac - b^2 > 0 \qquad \text{(3) pivots } a > 0,\ \frac{ac - b^2}{a} > 0 \qquad \text{(4) } x^TAx > 0 \text{ for all } x \neq 0
In words

(1) lambda one greater than 0, lambda two greater than 0 (2) a greater than 0, a c minus b squared greater than 0 (3) pivots a greater than 0, the quantity a c minus b squared, all over a greater than 0 (4) x^ capital T capital A x greater than 0 for all x is not equal to 0

Test (2) uses the upper-left ("northwest") determinants; in (3) the second pivot is the determinant divided by aa, since the product of the pivots is the determinant (p. 2). Test (4) gets the star: in most presentations it is the definition, and the other three are tests for it (p. 2).

Practice (pp. 2–3). Take (266c)\begin{pmatrix} 2 & 6 \\ 6 & c \end{pmatrix}. For positive definiteness 2c−36>02c - 36 > 0, so cc must be more than 18: with c=19c = 19 the determinant is 38−36=238 - 36 = 2. At c=18c = 18 the matrix is on the borderline, positive semidefinite: it is singular (row 2 is three times row 1, rank one), so one eigenvalue is 00 and the trace gives the other, 2020; and there is only one pivot, 22 (p. 3).

The quadratic form x^TAx#

Multiply out with x=(x1,x2)x = (x_1, x_2) and c=18c = 18 (p. 4):

The quadratic form
xTAx=(x1x2)(26618)(x1x2)=2x12+12x1x2+18x22x^TAx = \begin{pmatrix} x_1 & x_2 \end{pmatrix}\begin{pmatrix} 2 & 6 \\ 6 & 18 \end{pmatrix}\begin{pmatrix} x_1 \\ x_2 \end{pmatrix} = 2x_1^2 + 12x_1x_2 + 18x_2^2
In words

x^ capital T capital A x equals x one x two 2 6; 6 18 x one; x two equals 2 x one squared plus 12 x one x two plus 18 x two squared

In general, with xx and yy for the components, it is ax2+2bxy+cy2ax^2 + 2bxy + cy^2: the diagonal entries multiply the squares, and the off-diagonal bb appears twice (p. 4). This is a quadratic form, purely second degree, with no linear or constant part (pp. 4–5). The definition: AA is positive definite if xTAx>0x^TAx > 0 for every xx except zero (p. 5).

A failure (pp. 5–8). Lower cc to 77. The determinant is 14−36=−2214 - 36 = -22, so the pivots are 22 and −11-11 and one eigenvalue is negative (p. 5). At x=(1,−1)x = (1, -1) the form is 2−12+7=−3<02 - 12 + 7 = -3 < 0 (p. 6). The graph of f(x,y)=2x2+12xy+7y2f(x, y) = 2x^2 + 12xy + 7y^2 goes up along the xx axis, along the yy axis and along x=yx = y, but down along x=−yx = -y: it is a saddle, and the origin a saddle point, a maximum in some directions and a minimum in others; the eigenvector directions are the ones to look at (pp. 6–8).

A success (pp. 8–12). Raise cc to 2020. The determinant is 40−36=4=λ1λ240 - 36 = 4 = \lambda_1\lambda_2 and the trace is 22=λ1+λ222 = \lambda_1 + \lambda_2; two numbers with positive product and positive sum are both positive (pp. 8–9). The graph of 2x2+12xy+20y22x^2 + 12xy + 20y^2 is a bowl with its minimum at the origin: the pure squares overwhelm the cross term (p. 9). To see it, complete the square (pp. 11–12):

Completing the square
2x2+12xy+20y2=2(x+3y)2+2y22x^2 + 12xy + 20y^2 = 2(x + 3y)^2 + 2y^2
In words

2 x squared plus 12 x y plus 20 y squared equals 2 the quantity x plus 3 y, all squared plus 2 y squared

A sum of squares with positive coefficients cannot be negative. With c=18c = 18 the leftover would be 0y20y^2; with c=7c = 7 it would be −11y2-11y^2 (p. 12). Cutting the bowl at height 1, 2x2+12xy+20y2=12x^2 + 12xy + 20y^2 = 1, gives an ellipse; cutting a saddle gives a hyperbola (p. 12).

Completing the square is elimination#

The numbers 2, 3, 2 are no accident (p. 13). Eliminate on A=(26620)A = \begin{pmatrix} 2 & 6 \\ 6 & 20 \end{pmatrix}: the multiplier is 33, and 20−3⋅6=220 - 3 \cdot 6 = 2 (p. 13):

Elimination
A=(26620)=(1031)(2602)=LUA = \begin{pmatrix} 2 & 6 \\ 6 & 20 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 3 & 1 \end{pmatrix}\begin{pmatrix} 2 & 6 \\ 0 & 2 \end{pmatrix} = LU
In words

capital A equals 2 6; 6 20 equals 1 0; 3 1 2 6; 0 2 equals L U

The pivots stand outside the squares and the multipliers inside (pp. 13–14). So positive pivots give a sum of squares with positive weights, the graph goes up, and there is a minimum at the origin: "it's all connected together" (p. 14). Because elimination works for n×nn \times n matrices, so does this argument (p. 14).

Minima: the matrix of second derivatives#

In calculus a minimum needs df/dx=0df/dx = 0, and then the second derivative decides: positive means the slope increases through the point (p. 10). For a function of several variables, "positive" becomes "positive definite" for the matrix of second derivatives (pp. 10, 14):

Matrix of second derivatives
(fxxfxyfyxfyy),fxy=fyx\begin{pmatrix} f_{xx} & f_{xy} \\ f_{yx} & f_{yy} \end{pmatrix}, \qquad f_{xy} = f_{yx}
In words

f sub x x f sub x y; f sub y x f sub y y, f sub x y equals f sub y x

fxxf_{xx} and fyyf_{yy} must be positive, and also big enough to overcome the cross derivative (p. 14). The matrix is symmetric because mixed second derivatives can be taken in either order (p. 14). The 18.02 condition fxxfyy>fxy2f_{xx}f_{yy} > f_{xy}^2 is just the 2×22 \times 2 determinant test; linear algebra now gives the answer for any number of variables (p. 15).

A 3 × 3 example and an ellipsoid#

Strang's favourite matrix (pp. 15–17):

The second-difference matrix
A=(2−10−12−10−12):determinants 2,3,4;pivots 2,32,43;λ=2−2, 2, 2+2A = \begin{pmatrix} 2 & -1 & 0 \\ -1 & 2 & -1 \\ 0 & -1 & 2 \end{pmatrix}: \quad \text{determinants } 2, 3, 4; \quad \text{pivots } 2, \tfrac32, \tfrac43; \quad \lambda = 2 - \sqrt2,\ 2,\ 2 + \sqrt2
In words

capital A equals 2 minus 1 0; minus 1 2 minus 1; 0 minus 1 2 : determinants 2, 3, 4; pivots 2, three halves, four thirds; lambda equals 2 minus the square root of 2, 2, 2 plus the square root of 2

The determinants grow linearly, and the pivots are their ratios (p. 16). Strang recalls the eigenvalues from memory and checks them: they add to the trace 66, and multiply to 2(4−2)=42(4 - 2) = 4, the determinant (pp. 16–17). Its quadratic form (p. 17):

Its quadratic form
xTAx=2x12+2x22+2x32−2x1x2−2x2x3x^TAx = 2x_1^2 + 2x_2^2 + 2x_3^2 - 2x_1x_2 - 2x_2x_3
In words

x^ capital T capital A x equals 2 x one squared plus 2 x two squared plus 2 x three squared minus 2 x one x two minus 2 x two x three

No x1x3x_1x_3 term appears, because those entries are zero. The graph, in four dimensions, is a bowl (a paraboloid), and completing squares would write the form as three squares weighted by the three positive pivots (pp. 17–18). Cutting at height 1, xTAx=1x^TAx = 1, gives an ellipsoid: a lopsided football (pp. 18–19). With all eigenvalues equal it would be a sphere (the identity); with two equal, a rugby ball; here, with three different eigenvalues, it has a major, a middle and a minor axis (pp. 18–19). The principal axis theorem A=QΛQTA = Q\Lambda Q^T says the axes point along the eigenvectors, and the eigenvalues set their lengths (p. 19). (Strang says "the lengths, or the half-lengths, or one over the eigenvalues"; for xTAx=1x^TAx = 1 the half-length along an eigenvector is 1/λ1/\sqrt{\lambda}.)

Worked example

Tests of your own

(a) For which cc is A=(344c)A = \begin{pmatrix} 3 & 4 \\ 4 & c \end{pmatrix} positive definite? For c=6c = 6, complete the square in xTAxx^TAx and find the eigenvalues. (b) Is B=(420231012)B = \begin{pmatrix} 4 & 2 & 0 \\ 2 & 3 & 1 \\ 0 & 1 & 2 \end{pmatrix} positive definite?

(a) The condition

a=3>0a = 3 > 0, and 3c−16>03c - 16 > 0 requires c>16/3c > 16/3. At c=16/3c = 16/3 the matrix is only semidefinite.

(a) Completing the square, c=6c = 6

The multiplier is 4/34/3: 3x2+8xy+6y2=3(x+43y)2+(6−163)y2=3(x+43y)2+23y23x^2 + 8xy + 6y^2 = 3\left(x + \tfrac43y\right)^2 + \left(6 - \tfrac{16}{3}\right)y^2 = 3\left(x + \tfrac43y\right)^2 + \tfrac23y^2. Pivots 33 and 23\frac23, product 2=18−162 = 18 - 16, the determinant. Eigenvalues: trace 99, determinant 22, so λ=(9±73)/2≈8.77\lambda = (9 \pm \sqrt{73})/2 \approx 8.77 and 0.2280.228, both positive.

(b) Determinants and pivots

Upper-left determinants: 44; 12−4=812 - 4 = 8; det⁡B=4(6−1)−2(4−0)=12\det B = 4(6 - 1) - 2(4 - 0) = 12. All positive, so BB is positive definite. The pivots are 44, 8/4=28/4 = 2 and 12/8=3212/8 = \frac32, and xTBx=4x12+3x22+2x32+4x1x2+2x2x3>0x^TBx = 4x_1^2 + 3x_2^2 + 2x_3^2 + 4x_1x_2 + 2x_2x_3 > 0 for every x≠0x \neq 0.

Summary#

Symbols on this page

Show the 33 symbols used here
λ\lambda lambda.
An eigenvalue of A. Say it: “lambda”.
Λ\Lambda capital lambda.
The diagonal matrix of the eigenvalues. Say it: “capital lambda”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
≥\ge greater than or equal.
Is greater than or equal to. Say it: “is greater than or equal to”.
≠\neq not equal.
Is not equal to. Say it: “is not equal to”.
±\pm plus or minus.
Plus or minus: both signs, or an uncertainty (67.3 ± 1.2). Say it: “plus or minus”.
×\times times.
Times (multiplication). Between two vectors: the cross product. Say it: “times”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
det⁡\det determinant.
Determinant of a matrix. Say it: “the determinant of”.
aa a.
The top left entry of the symmetric 2 × 2 matrix: the coefficient of x² in xᵀAx. Say it: “a”.
cc c.
The bottom right entry of the symmetric 2 × 2 matrix: the coefficient of y²; in the example, the number that decides positive definiteness. Say it: “c”.
TT T.
As a superscript: the transpose. Say it: “capital T”.
xx x.
A vector (x₁, x₂, …); in 2 × 2 examples also its first component, as in ax² + 2bxy + cy². Say it: “x”.
yy y.
The second component of the vector in 2 × 2 examples. Say it: “y”.
dd d.
The d of df/dx. Say it: “d”.
nn n.
The size of the matrix. Say it: “n”.
ff f.
A function of two variables, f(x, y). Say it: “f”.
QQ Q.
The orthogonal matrix of eigenvectors in A = QΛQᵀ. Say it: “Q”.
AA A.
A symmetric matrix tested for positive definiteness; in the examples, rows (2, 6), (6, c), the 3 × 3 second-difference matrix and the worked example's rows (3, 4), (4, c). Say it: “capital A”.
BB B.
The worked example's 3 × 3 matrix with rows (4, 2, 0), (2, 3, 1), (0, 1, 2). Say it: “capital B”.
bb b.
The off-diagonal entry of the symmetric 2 × 2 matrix: xᵀAx contains 2bxy. Say it: “b”.
LL L.
The lower triangular factor in A = LU, holding the multiplier. Say it: “L”.
x1x_{1} x 1.
The first component of x. Say it: “x one”.
x2x_{2} x 2.
The second component of x. Say it: “x two”.
UU U.
The upper triangular factor in A = LU, with the pivots on its diagonal. Say it: “U”.
xnx_{n} x n.
The last component of x. Say it: “x sub n”.
x3x_{3} x three.
The third component of x. Say it: “x three”.
fxxf_{\text{xx}} f sub x x.
The second partial derivative of f with respect to x twice, ∂²f/∂x². Say it: “f sub x x”.
fxyf_{\text{xy}} f sub x y.
The mixed second partial derivative: first with respect to x, then y. Say it: “f sub x y”.
fyxf_{\text{yx}} f sub y x.
The mixed second partial derivative in the other order: first y, then x. Equal to f_xy. Say it: “f sub y x”.
fyyf_{\text{yy}} f sub y y.
The second partial derivative of f with respect to y twice, ∂²f/∂y². Say it: “f sub y y”.
λ1\lambda_{1} lambda one.
The first eigenvalue. Say it: “lambda one”.
λ2\lambda_{2} lambda two.
The second eigenvalue. Say it: “lambda two”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 31 words used here

New here

pivot.
In elimination, the first nonzero number in a row, used to clear out the entries below it.
positive semidefinite.
Of a symmetric matrix: xᵀAx is never negative; all its eigenvalues are positive or zero.
quadratic form.
An expression in which every term has degree two, such as ax² + 2bxy + cy², written xᵀAx with a symmetric matrix A.
ellipsoid.
A closed surface like a ball stretched or squashed along three perpendicular directions; every flat slice through it is an ellipse.

Also used

positive definite.
Of a symmetric matrix or quadratic form: always giving a positive value for any nonzero input; equivalently, all its eigenvalues are positive. Explained in Symmetric matrices and positive definiteness.
matrix.
A rectangular table of numbers, which acts on vectors to give new ones and so describes a linear change of coordinates. Explained in Planes through three points, and matrices.
determinant.
A single number worked out from a square array of numbers (a matrix), which measures how the matrix stretches areas or volumes. Explained in Determinants and the cross product.
eigenvalue.
A number λ for which a matrix turns some non-zero vector into λ times that vector, only stretching or shrinking it. Explained in Linear systems with constant coefficients: eigenvalues and eigenvectors.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
ellipse.
An oval curve: the set of points whose distances from two fixed points, the foci, add up to the same total. Explained in Kepler's laws and orbits.
hyperbola.
An open curve with two separate branches: the set of points whose distances from two fixed points differ by the same amount. Explained in Quadratics and power laws.
symmetric.
Unchanged by some swap, reflection or turn; for an expression in two quantities, unchanged when they are exchanged. Explained in Introduction to Fourier series.
singular.
Of a square matrix: having no inverse, because its determinant is zero and some nonzero vector is sent to zero. Explained in The geometry of linear equations.
rank one.
Of a matrix: having rank exactly one, so it is a column times a row and every column is a multiple of one column. Explained in Matrix spaces, rank one and small-world graphs.
trace.
The sum of the numbers on the main diagonal of a square matrix; it equals the sum of the eigenvalues. Explained in Linear systems with constant coefficients: eigenvalues and eigenvectors.
diagonal.
In a square matrix, the entries running from the top left corner to the bottom right; a diagonal matrix has zeros everywhere else. Explained in The four fundamental subspaces.
linear.
Of a map, operator or equation: respecting sums and multiples, so that L(au + bv) = aL(u) + bL(v). Explained in The geometry of linear equations.
graph.
The picture of a function: the curve y = f(x) for one variable, or the surface z = f(x, y) for two. Explained in Graphs, straight lines and slope.
saddle point.
A point where a surface rises in some directions and falls in others, like the middle of a horse's saddle or a mountain pass. Explained in Functions of two variables and partial derivatives.
eigenvector.
A non-zero vector that a matrix only stretches or shrinks without turning: multiplying it by the matrix gives a number times the same vector. Explained in Linear systems with constant coefficients: eigenvalues and eigenvectors.
completing the square.
Rewriting x² + bx + c as (x + b/2)² plus a number, which turns any quadratic into a shifted square. Explained in Inverse substitution and completing the square.
elimination.
Solving equations by subtracting multiples of one from another until each unknown can be found in turn. Explained in The geometry of linear equations.
second derivative.
The derivative of a derivative: how fast a rate of change itself is changing. Explained in Acceleration in one dimension.
derivative.
The rate at which a function changes as its input changes: the slope of its graph at a point. Explained in Position and velocity in one dimension.
dimension.
The number of vectors in any basis of a vector space or subspace. Explained in Independence, basis and dimension.
minor axis.
The shortest diameter of an ellipse or ellipsoid: the line through its centre along which it is narrowest.
principal axis theorem.
The theorem that every real symmetric matrix has real eigenvalues and perpendicular eigenvectors, so a turn of the axes makes it diagonal. Explained in Symmetric matrices and positive definiteness.

Academic

transcript.
A written record of exactly what was said in a recorded lecture, word for word.
borderline.
On the boundary between two kinds of behaviour, belonging clearly to neither.
no accident.
Not a matter of chance: there is a deeper reason why it happens.
argument.
A chain of reasoning that leads to a conclusion; in maths also the input of a function, such as x in sin x.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

Pages that build on this

Practise

Check your understanding

  1. For which cc is (266c)\begin{pmatrix} 2 & 6 \\ 6 & c \end{pmatrix} positive definite?
  2. What does completing the square for xTAxx^TAx correspond to?
  3. f(x,y)f(x, y) has zero first derivatives at a point. When is it a minimum there?
  4. What shape is xTAx=1x^TAx = 1 for a positive definite 3×33 \times 3 matrix with three different eigenvalues?
0 of 4 answered

Flashcards

1 / 4