← LibraryThe Determinant of a MatrixEngineering · Engineering MathematicsLesson 207/812← PrevNext →
ArticlePublished 7 Aug 2026Updated 9 Aug 202622 min readBy KEVOS®
Skip to content

Engineering/Mathematics/Determinants

The Determinant of a Matrix

The determinant is a function that takes a square matrix and returns a single scalar. It is defined recursively in terms of the determinants of smaller matrices, and its vanishing is exactly the condition for the matrix to be singular.

  • Core level
  • Stream: determinants
  • Reading time 13 min
  • Ref KVS-ENG-MATH-0075
Taxonomy
Engineering / Mathematics
Input
A square matrix only
Output
One scalar in
Notation
det(A) or |A|
Base case
det([a])=a
Naive cost
n! terms — unusable beyond about n=12

Overview

Unlike almost everything else in linear algebra, the determinant is not an algebraic structure. It is a function: feed it a square matrix and it returns a single number. That number carries an extraordinary amount of information about the matrix — whether it is singular, whether the associated linear system has a unique solution, how the matrix scales volume, and, once eigenvalues enter the picture, the roots of the characteristic polynomial. The economy of compressing all of that into one scalar is what has kept the determinant in the toolkit despite its computational drawbacks.

The definition given here is recursive. The determinant of a 1×1 matrix is its single entry. The determinant of an n×n matrix is an alternating sum of the entries of its first row, each multiplied by the determinant of the (n1)×(n1) matrix obtained by deleting that entry's row and column. Recursion is the honest way to present the definition, because it makes both the correctness and the cost transparent, but it is not how the quantity should ever be computed at scale.

That cost is severe. A determinant of size n expands into n determinants of size n1, each of which expands into n1 of size n2, and so on. Unwinding the recursion completely produces n! products of n entries each. For n=10 that is 3628800 terms; for n=20 it exceeds 2×1018. Practical computation therefore abandons the definition and reaches for row reduction or an LU factorisation, which reduces the work to cubic order.

Two conventions deserve early attention. First, the determinant is defined only for square matrices; asking for the determinant of a 3×4 array is a category error, not a hard computation. Second, the vertical-bar notation |A| denotes a determinant, not an absolute value or a norm: a determinant can be negative, and over it can be complex. The context — a matrix inside the bars — disambiguates, but the notation trips readers who meet it first in a numerical setting.

Definition

SubMatrix

SM

For an m×n matrix A, the submatrix Aij is the (m1)×(n1) matrix obtained from A by deleting row i and column j entirely. The remaining rows and columns keep their original relative order.

The subscripts on Aij name the row and column that were removed, not an entry that was kept. This clashes with the common use of aij for the entry in row i, column j, so the two notations must not be read interchangeably.

Determinant of a Matrix

DM

For a square matrix A, the determinant det(A)=|A| is the scalar defined recursively by the following two clauses.

  • If A=[a] is 1×1, then det(A)=a.
  • If A has size n2, then det(A) is the alternating sum [A]11det(A11)[A]12det(A12)+[A]13det(A13)+(1)n+1[A]1ndet(A1n).
Here A1j is the submatrix formed by deleting row 1 and column j, and [A]1j is the entry in row 1, column j.

Determinant of Matrices of Size Two

DMST

For A=[abcd], applying the recursive definition once gives det(A)=adbc. This closed form is the practical base case for hand computation, since decomposing a 2×2 matrix into two 1×1 determinants serves no purpose.

Concepts

Why the definition is recursive

A determinant cannot be written as a simple formula in the entries for general n without either recursion or a sum over permutations. The recursive route is chosen here because it needs no combinatorial preliminaries: every step reduces the size by one and terminates at the trivial 1×1 case. The trade-off is that the recursion conceals the symmetry of the object. Nothing in the definition suggests that the first row is unimportant, yet expansion about any row or column yields the same value — a fact that has to be proved separately.

The alternating sign pattern

The signs in the definition alternate +,,+,, along the first row, and the sign attached to position j is (1)1+j. Generalised to arbitrary position (i,j) the sign is (1)i+j, which lays out as a chequerboard with + in the top-left corner. The alternation is not decorative: it is what makes the determinant change sign when two rows are interchanged, and hence what makes it vanish when two rows are equal. Drop the signs and the resulting function (the permanent) loses almost every useful property.

Cost growth and why it is prohibitive

Let T(n) be the number of scalar multiplications required by the definition. Each of the n terms requires one multiplication plus a determinant of size n1, so T(n)=n(T(n1)+1) with T(1)=0. This grows faster than n!. Computing a 5×5 determinant this way builds five 4×4 submatrices, twenty 3×3 submatrices and sixty 2×2 submatrices. At size 20 the operation count exceeds the number of instructions a modern processor executes in a century.

What the determinant decides

The reason the determinant survives despite that cost is the equivalence between vanishing determinant and singularity: a square matrix A is singular precisely when det(A)=0. Every consequence follows from that. A non-zero determinant guarantees that Ax=b has a unique solution for every b, that A1 exists, that the columns of A are linearly independent and span n, and that the rank is full. For a symbolic or parametric matrix, setting det(A)=0 is the standard route to the critical parameter values at which the system degenerates.

The 2×2 case and the inverse formula

The expression adbc appears independently as the reciprocal factor in the closed-form inverse of a 2×2 matrix: [abcd]1=1adbc[dbca], valid exactly when adbc0. That coincidence is the smallest instance of a general pattern: the determinant sits in the denominator of the adjugate formula for the inverse in every size, which is another way of saying that a zero determinant is the obstruction to invertibility.

Division-free arithmetic

The definition uses only addition, subtraction and multiplication. No division appears anywhere. For a matrix of integers this means the determinant is an integer, computable exactly with no rounding and no rational arithmetic. That property makes the determinant attractive in exact settings — integer lattices, cryptography, computer algebra — where row reduction with its divisions would introduce fractions. It is also why fraction-free elimination algorithms are built around determinantal identities rather than around ordinary pivoting.

Evaluating a determinant from the definition

Confirm the matrix is squareThe determinant is undefined for a non-square array. Check row count against column count before anything else.
Check the base casesSize 1: the answer is the single entry. Size 2: apply adbc directly rather than recursing further.
Build the first-row submatricesFor each column j, delete row 1 and column j to form A1j, a matrix one size smaller.
Recurse on each submatrixCompute det(A1j) by the same procedure, terminating at size 2 or 1.
Combine with alternating signsSum (1)1+j[A]1jdet(A1j) over j=1,,n. Track the signs explicitly rather than from memory.
InterpretA non-zero result means non-singular, invertible, full rank, unique solutions. A zero result means singular.

Equations

Recursive definition of the determinant

EQ-DM-01
det(A)=[A]11det(A11)[A]12det(A12)++(1)n+1[A]1ndet(A1n)

Expansion about the first row. Each A1j is the submatrix of size n1 obtained by deleting row 1 and column j.

Compact form of the recursion

EQ-DM-02
det(A)=j=1n(1)1+j[A]1jdet(A1j),det([a])=a

The same statement with the sign written as a power of 1, together with the base case that terminates the recursion.

Determinant of a matrix of size two

EQ-DM-03
det[abcd]=|abcd|=adbc

The practical base case. Both notations for the determinant are shown side by side.

Determinant of a matrix of size three

EQ-DM-04
|a11a12a13a21a22a23a31a32a33|=a11|a22a23a32a33|a12|a21a23a31a33|+a13|a21a22a31a32|

The recursion unwound one level for the most common hand-computed case. Note the sign pattern +,,+ across the first row.

Singularity criterion

EQ-DM-05
Ais singulardet(A)=0

The single most useful property of the determinant. Equivalently, det(A)0 characterises the non-singular, invertible, full-rank square matrices.

Inverse of a matrix of size two

EQ-DM-06
[abcd]1=1adbc[dbca]

Valid precisely when the determinant is non-zero. The determinant appearing in the denominator is the general pattern in miniature.

Cost of the recursive definition

EQ-DM-07
T(n)=n(T(n1)+1),T(1)=0

Multiplication count for the naive recursion. The solution grows faster than n!, which is why the definition is never used computationally beyond very small sizes.

Variable Definitions

Symbols used on this page
SymbolNameMeaningDomain / type
AMatrixThe square matrix whose determinant is requiredn x n matrix over C
nSizeCommon row and column count of the square matrixpositive integer
[A]ijEntryThe scalar in row i, column j of Acomplex scalar
AijSubmatrixThe matrix left after deleting row i and column j from A(n-1) x (n-1) matrix
det(A)DeterminantThe scalar produced by the recursive definitioncomplex scalar
|A|Determinant (bar notation)Alternative notation for det(A); not an absolute valuecomplex scalar
(1)i+jPosition signThe chequerboard sign attached to position (i,j)+1 or -1
A1InverseThe matrix satisfying AA1=A1A=In, existing exactly when det(A)0n x n matrix

Worked Numerical Example

Problem statement

A three-degree-of-freedom stiffness matrix arises from a chain of axial springs. Determine whether the assembled system is non-singular — that is, whether a unique displacement field exists for any applied load — by evaluating the determinant directly from the recursive definition.

  1. State the matrix

    After applying boundary conditions the reduced stiffness matrix, in consistent units, is the tridiagonal matrix K below. It is square of size 3, so the determinant is defined.

    K=[210131012]
  2. Form the three first-row submatrices

    Delete row 1 together with column 1, column 2 and column 3 in turn. Each deletion leaves a 2×2 matrix; the surviving entries keep their original order.

    K11=[3112],K12=[1102],K13=[1301]
  3. Evaluate the three small determinants

    Apply adbc to each. Working these three values out before assembling the sum keeps the sign bookkeeping separate from the arithmetic, which is where most hand errors occur.

    det(K11)=(3)(2)(1)(1)=5,det(K12)=(1)(2)(1)(0)=2,det(K13)=(1)(1)(3)(0)=1
  4. Assemble with alternating signs

    The signs along the first row are +,,+. Multiply each first-row entry by the determinant of its submatrix and combine.

    det(K)=(2)(5)(1)(2)+(0)(1)
  5. Complete the arithmetic

    The middle term carries two negatives — one from the entry and one from the alternating sign — so it enters the sum as 2, not +2. This is the single most common slip in a hand determinant.

    det(K)=102+0=8
  6. Cross-check by a second route

    The third column of K contains a zero in the first position, so an expansion about that column involves only two non-trivial terms. Expanding about column 3 gives (1)|2101|+(2)|2113|=(1)(2)+(2)(5)=8. Agreement between two independent expansions is a strong check on the arithmetic.

  7. Interpret the result

    det(K)=80, so K is non-singular. The reduced system Ku=f therefore has exactly one displacement solution u for every load vector f, and the stiffness matrix is invertible.

Result

The determinant is 8. Because it is non-zero, the restrained spring chain is kinematically stable: no rigid-body or mechanism motion survives the boundary conditions, and the load-displacement relationship is uniquely invertible. Had the determinant come out zero, the structure would have admitted a non-trivial displacement field under zero load — a mechanism — and no finite element solver could have returned a unique answer.

Applications & Industry Use

Structural engineering

Detecting mechanisms and buckling loads

A zero determinant of an assembled stiffness matrix signals that the structure admits a displacement pattern requiring no load — a mechanism, or at a critical load level, a buckling mode. Linear buckling analysis is precisely the search for the load factor at which det(Ke+λKg) first vanishes, so the determinant is the object whose root defines the critical load.

Control systems

Characteristic equation of a state-space model

The poles of a linear time-invariant system are the roots of det(sIA)=0. Stability analysis, pole placement and root-locus construction all operate on that determinant. For low-order models it is written out symbolically from the definition; for high-order models it is never formed explicitly and an eigenvalue routine is used instead.

Computer graphics and geometry

Orientation and signed area tests

The sign of a 2×2 or 3×3 determinant built from difference vectors decides whether three points turn clockwise or anticlockwise, and whether a tetrahedron is correctly oriented. Mesh generation, convex hull construction and back-face culling all reduce to such tests, which are exactly the cases where the recursive definition is cheap enough to use directly.

Electrical engineering

Network solvability by inspection

For a small resistive network the nodal admittance matrix can be assembled by hand and its determinant evaluated symbolically in the component values. A zero determinant identifies component combinations for which the node voltages are indeterminate — typically a floating subnetwork with no reference path to ground.

Statistics and metrology

Covariance determinants as generalised variance

The determinant of a covariance matrix is the generalised variance and appears in the normalising constant of the multivariate normal density. A determinant close to zero indicates near-perfect correlation between measured quantities, which flags a redundant instrument channel or an over-parameterised calibration model.

Cryptography and coding

Invertibility over exact rings

Hill ciphers and lattice-based constructions require key matrices that are invertible over the integers modulo n, which holds exactly when the determinant is a unit in that ring. Because the definition uses no division, the determinant can be evaluated exactly in modular arithmetic and used directly as the invertibility test.

Design Considerations

Never compute a large determinant from the definition

The recursion is a definition, not an algorithm. Above roughly n=6 the operation count makes it useless, and above n=12 it is intractable on any hardware. Production code computes det(A) as the product of the diagonal entries of the U factor of an LU factorisation, adjusted by the sign of the row permutation, at cubic cost.

Do not use a floating-point determinant as a singularity test

A determinant is not scale-invariant: multiplying an n×n matrix by 101 multiplies its determinant by 10n. A perfectly well-conditioned 20×20 matrix can therefore have a determinant of order 1020, and a badly conditioned one can have a determinant near 1. Judge singularity by the condition number or the smallest singular value, never by the magnitude of the determinant.

Expand about the sparsest line when working by hand

Every zero entry in the chosen row or column removes an entire subdeterminant from the calculation. For a matrix with a sparse row or column, expanding about it can halve the hand labour. This freedom is licensed by the theorem that expansion about any row or column gives the same value, so it costs nothing in rigour.

Prefer exact arithmetic for symbolic or integer input

Because the definition involves no division, an integer matrix has an integer determinant. Evaluating it in exact integer arithmetic gives a definitive zero-or-not answer, which floating point cannot supply. For parametric matrices, symbolic expansion followed by factoring is usually the fastest route to the critical parameter values.

Beware overflow in exact integer determinants

Determinants of integer matrices grow rapidly with size and entry magnitude — Hadamard's bound puts |det(A)| at up to the product of the row norms. A 20×20 matrix of three-digit integers can have a determinant exceeding a 64-bit integer. Use arbitrary-precision integers, or compute modulo several primes and reconstruct.

Keep the two subscript conventions apart

In this context Aij denotes a submatrix and [A]ij denotes a scalar entry. Mixing them silently converts a matrix into a number in the middle of a derivation. Where both appear in the same expression, spell out at least one of them in words the first time.

Standards & Codes

Notation, interchange and numerical standards that govern how this material is written down, stored and computed in production systems.

Applicable standards, conventions and reference implementations
ReferenceTitleRelevance to this topic
ISO 80000-2Quantities and units — Part 2: MathematicsSpecifies detA with an upright operator name and the vertical-bar form |A| as the accepted notations for a determinant, and distinguishes both from the absolute value of a scalar.
LAPACK xGETRFLU factorisation with partial pivotingThe reference route to a numerical determinant: factor PA=LU, multiply the diagonal of U, and apply the sign of the permutation P. No LAPACK routine implements the recursive definition.
IEEE 754-2019IEEE Standard for Floating-Point ArithmeticGoverns the overflow and underflow behaviour that makes a floating-point determinant unreliable for large sizes, and motivates the log-determinant form returned by numpy.linalg.slogdet.
ISO/IEC 40314Mathematical Markup Language (MathML) Version 3.0Provides the semantic markup for the bracketed and bar-delimited matrix forms used throughout this page, so the notation is machine-readable and accessible.
ISO/IEC 14882Programming languages — C++Relevant to fixed-size determinant kernels: the Eigen library's determinant() specialises to closed-form expressions for sizes up to 4×4 and switches to LU above that, a pattern the standard's template machinery makes possible.

Material Selection

For a mathematical topic, "material" is the numeric representation: the scalar field, storage format and precision the computation is built from.

Representation and precision selection
RepresentationSelect whenTrade-off
Exact machine integersSmall integer matrices where a definitive zero-or-not answer is required, such as orientation tests and modular invertibility checks.Fast and exactly correct with no rounding, but the result overflows silently once size and entry magnitude grow; Hadamard's bound should be checked in advance.
Arbitrary-precision integersComputer-algebra determinants of integer matrices of moderate size, and determinantal identities in number theory.Cannot overflow and remains exact, but operand size grows through the computation and arithmetic slows down superlinearly.
Exact rational arithmeticParametric or symbolic matrices where the determinant is wanted as a polynomial in the parameters.Yields a factorable expression whose roots are the critical parameter values, at the cost of expression swell that can dominate the runtime.
IEEE 754 binary64Numerical determinants of moderate size obtained via LU factorisation, for instance in a Gaussian likelihood evaluation.Cubic cost and predictable accuracy, but the result overflows or underflows for large sizes and is meaningless as a conditioning indicator.
Logarithmic magnitude with a separate signStatistical work where only log|det(A)| is required, as in multivariate normal log-likelihoods.Immune to the overflow that defeats a direct binary64 determinant, but discards the magnitude itself and requires care when the determinant is exactly zero.
Modular arithmetic over several primesExact determinants of large integer matrices where arbitrary-precision arithmetic is too slow.Each modular determinant is cheap and overflow-free, but a bound on the true determinant is needed to know how many primes suffice for reconstruction.

Manufacturing Notes

Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.

Operation count of the definition versus factorisation

The recursion performs more than n! multiplications. LU factorisation with partial pivoting computes the same value in about 23n3 operations. At n=15 that is the difference between roughly 1012 operations and about 2000. Every practical determinant routine in every serious library takes the factorisation route.

Hand procedure for sizes three and four

For size 3, expand about the row or column containing the most zeros and evaluate the three 2×2 determinants with adbc. For size 4, first use row operations to create zeros in one column — adding a multiple of one row to another leaves the determinant unchanged — then expand about that column. Reducing four 3×3 subdeterminants to one is the single largest saving available by hand.

Library behaviour

numpy.linalg.det and MATLAB's det both use LU factorisation and return a floating-point value. numpy.linalg.slogdet returns the sign and the natural logarithm of the magnitude separately, which is the correct choice whenever the determinant may overflow. SymPy's Matrix.det() offers a method argument selecting Bareiss fraction-free elimination, Berkowitz or cofactor expansion, with Bareiss the default for exact input.

Verifying a hand computation

Three independent checks are available. Expand about a different row or column and compare. Compute the determinant of the transpose, which must give the same value. For a 3×3 matrix of small integers, confirm the result against the product of the diagonal entries after reducing to triangular form using only row-addition operations, which do not change the determinant.

Numerical stability of the definition

Beyond its cost, the recursion is numerically poor: it forms n! products that are then added with cancellation, so the relative error can be enormous even when the answer is not small. Factorisation-based determinants inherit the backward stability of LU with partial pivoting and are the only defensible choice in floating point.

Failure Modes & Common Mistakes

Failure modes, root causes and prevention
Failure mode / mistakeImpactRoot causePrevention & detection
Taking the determinant of a non-square matrixhighApplying the definition to a rectangular array, usually after an assembly step silently changed the shape.Assert row count equals column count before calling any determinant routine; treat a shape mismatch as a modelling error, not a numerical one.
Dropping or misplacing the alternating signhighWriting [A]12det(A12) with a plus sign, or letting a negative entry cancel the alternating sign twice.Write the sign factor (1)1+j explicitly as a separate factor before substituting the entry value.
Reading Aij as an entrymediumConfusing the submatrix notation Aij with the entry notation aij, which turns a matrix into a scalar mid-derivation.Use [A]ij for entries throughout and reserve the bare subscript for submatrices, as done consistently on this page.
Judging singularity from a small floating-point determinanthighComparing det(A) against a fixed threshold, ignoring that the determinant scales as the n-th power of the matrix scale.Use the condition number, the smallest singular value, or a rank-revealing factorisation. Reserve the determinant test for exact arithmetic.
Integer overflow in an exact determinantmediumAccumulating products of large integer entries in a fixed-width type, producing a silently wrapped and completely wrong value.Bound the result with Hadamard's inequality first, then choose arbitrary-precision integers or a multi-modular scheme accordingly.
Floating-point overflow or underflowmediumMultiplying n diagonal entries of an LU factor, each of magnitude far from one, so the product leaves the representable range.Compute the sign and the logarithm of the magnitude separately using a routine such as slogdet.
Assuming determinants addmediumWriting det(A+B)=det(A)+det(B) by analogy with linear operations; the determinant is not a linear function of the matrix.Test the claim on any pair of small matrices. The determinant is multiplicative under matrix multiplication, not additive under matrix addition.
Attempting the recursion on a large matrix in codelowImplementing the definition literally as a teaching exercise and then reusing it on production-sized data.Cap the recursive implementation at a small size and dispatch to an LU-based routine above it, mirroring what established libraries do internally.

FAQs

Why is the determinant defined only for square matrices?

The recursion removes one row and one column at each step, so it terminates in a single entry only when the row and column counts agree. More fundamentally, the properties that make the determinant useful — multiplicativity, the singularity criterion, the volume interpretation — all require a map from a space to itself, which is what a square matrix represents. For rectangular matrices the analogous quantities are the singular values.

Does the determinant depend on expanding about the first row?

No. Expansion about any row or any column produces the same value, which is a theorem rather than part of the definition. The first row is chosen in the definition only because a single fixed rule makes the recursion well defined; in practice you should expand about whichever row or column has the most zeros.

Is a matrix with a very small determinant nearly singular?

Not reliably. The determinant scales as the n-th power of a uniform scaling of the matrix, so a well-conditioned matrix with small entries has a tiny determinant and a badly conditioned matrix can have a determinant near one. Near-singularity is measured by the condition number or the smallest singular value, both of which are scale-aware.

What does a negative determinant mean?

For a real matrix, the sign of the determinant records orientation: a negative value means the associated linear map reverses handedness, mapping a right-handed frame to a left-handed one. The magnitude is the volume scaling factor. Over the determinant can be any complex number and the orientation reading no longer applies.

Why not just compute the determinant to solve a linear system?

Cramer's rule expresses each unknown as a ratio of determinants, and for size two or three it is a perfectly reasonable hand method. Beyond that it is catastrophically expensive — n+1 determinants, each costing more than solving the system outright — and it is numerically inferior to Gaussian elimination even when the cost is affordable.

How is the determinant actually computed in software?

Almost universally by LU factorisation with partial pivoting. The matrix is factored as PA=LU; since L has unit diagonal and U is upper triangular, the determinant is the product of the diagonal entries of U, multiplied by +1 or 1 according to the parity of the row interchanges recorded in P. The total cost is cubic rather than factorial.

Is the determinant of an integer matrix always an integer?

Yes. The definition uses only multiplication, addition and subtraction, never division, so the ring of integers is closed under the operation. This is why the determinant is a natural exact invertibility test over the integers and over integers modulo n, where row reduction would require inverting pivots.

References

  1. Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section DM. Licensed under the GNU Free Documentation License v1.2.
  2. ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
  3. Anderson, E. et al. LAPACK Users' Guide, 3rd edition. Society for Industrial and Applied Mathematics, 1999.
  4. Higham, N. J. Accuracy and Stability of Numerical Algorithms, 2nd edition. Society for Industrial and Applied Mathematics, 2002.
  5. IEEE 754-2019, IEEE Standard for Floating-Point Arithmetic. Institute of Electrical and Electronics Engineers.

AI Suggested Questions

  • Derive the number of scalar multiplications the recursive determinant definition performs for a matrix of size n, and compare it with LU factorisation at n=15.
  • Show a well-conditioned matrix with a determinant near 1020 and a badly conditioned matrix with a determinant near 1, to demonstrate why determinant magnitude is not a conditioning measure.
  • Explain how the alternating sign pattern in the definition produces the fact that a matrix with two equal rows has zero determinant.
  • How does Bareiss fraction-free elimination compute an exact integer determinant without rational arithmetic, and what bounds the size of its intermediate values?
  • Work through a symbolic 3×3 determinant containing a design parameter and identify the parameter values that make the matrix singular.
  • Why does the determinant equal the signed volume scaling factor of the associated linear map, and how does that follow from the recursive definition?

Related Calculators

Continue learning

Orthonormal Bases and CoordinatesArticle · Engineering MathematicsNEXT LESSON →Computing DeterminantsArticle · Engineering MathematicsRanks and TransposesArticle · Engineering MathematicsProperties of DeterminantsArticle · Engineering Mathematics