Positive Definite Matrix Checker

JJ Ben-Joseph headshot JJ Ben-Joseph

Enter matrix entries above.

What Does Positive Definite Mean?

In linear algebra, a real symmetric matrix is called positive definite if it induces a strictly positive quadratic form. This idea arises in many branches of mathematics and engineering. For instance, the Hessian matrix of a twice differentiable function determines whether a point is a local minimum: if the Hessian is positive definite, the point is strictly minimizing. Covariance matrices in statistics are positive semidefinite, and those arising from strictly correlated variables are positive definite. Recognizing such matrices therefore has wide practical relevance.

Several criteria determine whether a matrix is positive definite. One common approach examines eigenvalues: a symmetric matrix is positive definite exactly when all eigenvalues are positive. Another approach relies on leading principal minors, known as Sylvester's criterion. It states that a symmetric matrix is positive definite if and only if all determinants of its leading principal submatrices are positive. For a 3×3 matrix A, the submatrices are the upper left 1×1 block, the 2×2 block, and the full matrix. The determinants of these blocks, often called principal minors, provide an efficient test without computing eigenvalues directly.

Using MathML, Sylvester's condition for a 3×3 matrix A = [aij] reads:

(1) a_{11} >0 (2) a_{1122} - a_{12} a_{21} >0 (3) det ( A ) >0

The first condition simply demands that a11 be positive. The second condition requires the determinant of the top-left 2×2 block to be positive. The third condition insists that the determinant of the entire matrix is positive. If all three inequalities hold, the matrix is positive definite. If any determinant is non-positive, the matrix fails the test. This method avoids solving cubic characteristic equations and illustrates how structural properties of a matrix reveal its behavior.

To make these computations transparent, the calculator evaluates each minor explicitly. The 1×1 determinant is just a11. The 2×2 minor is computed as a11 a22 minus a12 a21. The 3×3 determinant is evaluated using the rule of Sarrus or cofactor expansion:

det(A) = a_{11} (a_{2233} -a_{23}a_{32} ) - a_{12} (a_{2133} -a_{23}a_{31} ) + a_{13} (a_{2132} -a_{22}a_{31 )

The calculator carries out these operations step by step, then reports whether the matrix is positive definite. For educational purposes, it also prints the values of each minor so users can see which condition, if any, fails.

Consider an example matrix arising from a quadratic form: [[2, -1, 0], [-1, 2, -1], [0, -1, 2]]. The principal minors are computed in the table below.

MinorValue
a112
det23
det34

All three determinants are positive, so the matrix is positive definite. Indeed, this matrix corresponds to the discrete Laplacian on a simple path and appears in numerical solutions of differential equations. Positive definiteness guarantees that solving associated linear systems is stable and that energy functionals have well defined minima.

The concept extends beyond 3×3 matrices. For n×n symmetric matrices, Sylvester's criterion requires computing n determinants, one for each leading principal submatrix. Although this calculator focuses on 3×3 matrices for simplicity, the principles are identical. In larger systems, algorithms such as Cholesky decomposition offer efficient ways to test definiteness and factor matrices. Cholesky succeeds exactly when the matrix is positive definite, producing a triangular factor L such that A = L LT. This factorization underlies many numerical methods, including least squares and Kalman filtering.

Understanding why positive definiteness matters requires a brief look at quadratic forms. Given a vector x, the expression xTA x evaluates a quadratic form. If A is positive definite, this quantity is always positive except at the zero vector. Geometrically, the set of points where xTA x = 1 forms an ellipsoid. The principal axes of the ellipsoid correspond to eigenvectors of A, and their lengths are inversely proportional to the square roots of the eigenvalues. Thus, positive definite matrices describe ellipsoids aligned with coordinate axes through orthogonal transformations. When A is not positive definite, the quadratic form may produce saddle shapes or cones.

Positive definite matrices also appear in optimization. When minimizing a convex quadratic function f(x) = ½ xTA x - bTx, the definiteness of A ensures a unique solution found by solving A x = b. Gradient descent and conjugate gradient methods rely on such properties. In statistics, covariance matrices must be positive semidefinite because variance cannot be negative. When modelling multivariate normal distributions, positive definiteness guarantees a proper probability density function. Detecting a non positive definite covariance matrix often indicates data issues or estimation errors.

The calculator's implementation reflects these theoretical ideas. It reads nine numbers from the form, constructs a 3×3 matrix, and computes the three principal minors. The script then evaluates inequalities and prints a verdict: positive definite, positive semidefinite, negative definite, negative semidefinite, or indefinite depending on the sign pattern of the minors. Because the test requires symmetry, the calculator does not enforce a21 = a12 etc., allowing exploration of what happens when the matrix is not symmetric. In such cases, the criterion is only sufficient, not necessary, but the tool can still give insights.

Beyond mere classification, inspecting minors reveals how individual entries influence definiteness. Increasing off diagonal entries in magnitude tends to decrease determinants, potentially making the matrix indefinite. Scaling all entries by a positive factor preserves definiteness, while multiplying by a negative factor flips signs and leads to negative definiteness. Such experiments help build intuition about matrix behavior.

Because all computations run in the browser, the calculator offers instant feedback. Users can modify entries and observe the effect on determinants without needing advanced software. The educational value lies in connecting abstract algebraic conditions with concrete numerical examples, deepening understanding of matrix analysis.

In conclusion, positive definite matrices serve as a backbone for many mathematical models. By implementing Sylvester's criterion, this calculator demystifies the process of verifying definiteness. Whether analyzing optimization problems, studying mechanical systems, or evaluating statistical models, the ability to test matrices quickly is invaluable. Experimentation with the tool can illuminate the delicate interplay between matrix entries and the geometry of quadratic forms.

Related Calculators

Sylvester's Criterion Calculator - Test Matrix Definiteness

Check whether a symmetric matrix is positive or negative definite using leading principal minors.

sylvesters criterion calculator positive definite matrix

Typing Speed Test - Words Per Minute Calculator

Measure your typing speed and accuracy with this client-side words per minute test.

typing speed test WPM calculator online typing test

Fisher's Exact Test Calculator - Evaluate 2x2 Contingency Tables Exactly

Compute Fisher's exact test for a 2x2 contingency table. Get an exact p-value even with small sample sizes using a hypergeometric probability model.

Fisher exact test calculator hypergeometric exact test contingency table