Positive Definite Matrix Test Calculator
Test whether a real symmetric matrix is positive definite, positive semidefinite, negative definite, negative semidefinite, or indefinite. Inspect approximate eigenvalues and the leading principal minors used by Sylvester's criterion.
Enter a Square Matrix
Choose a size from 1 × 1 to 8 × 8. The standard definiteness tests below apply to real symmetric matrices. Entries are allowed to be decimals or negative numbers.
What Is a Positive Definite Matrix?
A real symmetric matrix A is positive definite if its quadratic form is strictly positive for every nonzero real vector x:
Positive definite matrices appear in optimization, least-squares methods, covariance analysis, energy functions, and numerical solutions of differential equations.
Symmetry matters: the standard eigenvalue and Sylvester tests presented here are designed for real symmetric matrices.
How the Calculator Tests Definiteness
- Check symmetry. The matrix must satisfy A = AT, within a small floating-point tolerance.
- Estimate eigenvalues. A Jacobi rotation method approximately diagonalizes the symmetric matrix.
- Inspect the signs. Positive, negative, and near-zero eigenvalues determine the likely definiteness category.
- Check leading principal minors. Sylvester's criterion independently tests positive definiteness by checking whether each leading principal determinant is positive.
Numerical classifications near zero require caution. Floating-point arithmetic cannot always reliably distinguish an exact zero eigenvalue from a very small nonzero one.
Types of Matrix Definiteness
| Type | Eigenvalue condition | Quadratic form |
|---|---|---|
| Positive definite | All eigenvalues positive | xᵀAx > 0 for all x ≠ 0 |
| Positive semidefinite | All eigenvalues nonnegative | xᵀAx ≥ 0 for all x |
| Negative definite | All eigenvalues negative | xᵀAx < 0 for all x ≠ 0 |
| Negative semidefinite | All eigenvalues nonpositive | xᵀAx ≤ 0 for all x |
| Indefinite | Both positive and negative eigenvalues | Can be positive or negative |
Worked Example: Positive Definite
Consider the symmetric matrix:
[ 1 3 ]
Its leading principal minors are:
Δ₂ = det(A) = 4 × 3 − 1 × 1 = 11 > 0
Both leading principal minors are positive. By Sylvester's criterion, the matrix is positive definite.
Worked Example: Indefinite
Consider:
[ 2 1 ]
The eigenvalues are 3 and −1. Because one eigenvalue is positive and the other is negative, the matrix is indefinite.
Frequently Asked Questions
1. How do I test if a matrix is positive definite?
For a real symmetric matrix, check whether all eigenvalues are positive, or use Sylvester's criterion and check whether every leading principal minor is positive.
2. Does a positive definite matrix have to be symmetric?
In the standard real-matrix definition used here, positive definiteness is defined for symmetric matrices through the quadratic form xᵀAx. The symmetric part of a nonsymmetric real matrix determines that quadratic form, but this is a different test from requiring the original matrix to be symmetric positive definite.
3. What is Sylvester's criterion?
It states that a real symmetric matrix is positive definite if and only if all its leading principal minors are positive.
4. What is the difference between positive definite and positive semidefinite?
Positive definite requires a strictly positive quadratic form for every nonzero vector. Positive semidefinite allows the quadratic form to be zero for some nonzero vectors.
5. Can a positive definite matrix have a zero eigenvalue?
No. Every eigenvalue of a real symmetric positive definite matrix must be strictly positive.
6. Why does numerical tolerance matter?
Floating-point calculations have finite precision. An eigenvalue very close to zero may be affected by rounding, so a computed classification near the threshold is not always definitive.
7. Where are positive definite matrices used?
They are used in convex quadratic optimization, covariance matrices, least-squares problems, energy functions, and many numerical algorithms.