Det

Det[m]

gives the determinant of the square matrix m.

Details and Options

  • Det[m,Modulus->n] computes the determinant modulo n.

Examples

open allclose all

Basic Examples  (2)

Find the determinant of a symbolic matrix:

The determinant of an exact matrix:

Scope  (13)

Basic Uses  (8)

Find the determinant of a MachinePrecision matrix:

Determinant of a complex matrix:

Determinant of an exact matrix:

Determinant of an arbitrary-precision matrix:

Determinant of a symbolic matrix:

The determinant of a large numerical matrix is computed efficiently:

Note that the result may not be a machine number:

Determinant of a matrix with finite field elements:

Determinant of a CenteredInterval matrix:

Find a random representative mrep of m:

Verify that mdet contains the determinant of mrep:

Special Matrices  (5)

Determinants of sparse matrices:

Determinants of structured matrices:

IdentityMatrix always has unit determinant:

Determinant of HilbertMatrix:

Compute the determinant of a matrix of univariate polynomials of degree :

Options  (1)

Modulus  (1)

Compute a determinant using arithmetic modulo 47:

This is faster than computing Mod[Det[m],47]:

Applications  (19)

Area and Volumes  (6)

Use Det to find area of a parallelogram spanned by and :

Visualize the parallelogram when one vertex is at the origin:

The area is given by the absolute value of the determinant:

Compare with the result given by Area:

Use Det to find the volume of a parallelepiped spanned by , and :

Visualize the parallelepiped when one vertex is at the origin:

The volume is given by the absolute value of the determinant:

Compare with a direct computation using Volume:

Use Det to find hypervolume of a hyper-parallelepiped spanned by the following vectors:

The hypervolume is given by the absolute value of the determinant:

Compare with the result given by RegionMeasure:

The determinant itself is negative, so the are not right-handed:

Simply reorder any two vectors, say the middle two, to produce a right-handed set:

Find the area of the image of the unit disk under the linear transformation associated to the matrix :

The area of the image is given by sqrt(TemplateBox[{{TemplateBox[{m}, Transpose, SyntaxForm -> SuperscriptBox], ., m}}, Det]) Area[D]=pi sqrt(TemplateBox[{{TemplateBox[{m}, Transpose, SyntaxForm -> SuperscriptBox], ., m}}, Det]):

Compare with a direct computation:

Visualize the image :

Find the volume factor in the change of variables formula between Cartesian and polar coordinates. The mapping from polar to Cartesian coordinates is given by:

Compute the Jacobian of the mapping using Grad:

By the change of variables theorem, the volume is the determinant of the Jacobian:

Compare with the result given by CoordinateChartData:

The same procedure will work with any coordinate system, for example, spherical coordinates:

Use the change of variables theorem to compute , where is the following region:

First, define hyperbolic coordinates as follows:

The region clearly corresponds to and . By the change of variables formula, intint1dudv=intintTemplateBox[{TemplateBox[{{{, {u, ,, v}, }}, {{, {x, ,, y}, }}}, Grad, SyntaxForm -> Del]}, Det]dxdy. The gradient is given by:

The determinant of the gradient is twice the function whose integral is :

Hence, is given by the trivial integral :

Compare with a direct integration over the region:

Orientation and Rotations  (5)

Determine whether the following basis for TemplateBox[{}, Reals]^3 is right-handed:

The determinant of the matrix formed by the basis is negative, so it is not right-handed:

Determine if linear transformation corresponding to is orientation-preserving or orientation-reversing:

As TemplateBox[{m}, Det]>0, the mapping is orientation-preserving:

Show that the following matrix is not a rotation matrix:

All rotation matrices have unit determinant; since TemplateBox[{m}, Det]!=1, it cannot be a rotation matrix:

Show that the matrix is orthogonal and determine if it is a rotation matrix or includes a reflection:

Up to the input precision, TemplateBox[{m}, Transpose]=TemplateBox[{m}, Inverse], which shows that is orthogonal:

All orthogonal matrices have TemplateBox[{m}, Det]=+/-1, but rotations have TemplateBox[{m}, Det]=1; as TemplateBox[{m}, Det]=-1, includes a reflection:

The generalization of a rotation matrix to complex vector spaces is a special unitary matrix that is unitary and has unit determinant. Show that the following matrix is a special unitary matrix:

The matrix is unitary because TemplateBox[{u}, ConjugateTranspose]=TemplateBox[{u}, Inverse]:

It also has unit determinant, so it is in fact an element of the special unitary group :

Linear and Abstract Algebra  (8)

Determine the values of the parameter for which the system , has a unique solution and describe that solution. First, form the coefficient matrix and constant vector :

The solutions will be unique as TemplateBox[{a}, Det]!=0:

Solving over the reals gives three open intervals separated at and :

Since the matrix is invertible for these values of , the solution is simply TemplateBox[{a}, Inverse].b:

Verify the solution in the original system of equations:

Use Cramer's rule to solve the system of equations , , . First, form the coefficient matrix and constant vector :

Form the three matrices where replaces the corresponding columns of :

The entries of the solution are given by TemplateBox[{{d, _, j}}, Det]/TemplateBox[{a}, Det]:

Verify the result:

Write a function implementing Cramer's rule for solving a linear system m.x=b:

Use the function to solve a system for particular values of m and b:

Verify the solution:

For numerical systems, LinearSolve is much faster and more accurate:

Determine if the matrix has a nontrivial kernel (null space):

Since the determinant is nonzero, the kernel is trivial:

Confirm the result using NullSpace:

Determine if the mapping corresponding to the matrix is injective:

Since TemplateBox[{a}, Det]=0, the mapping is not injective:

Confirm the result using FunctionInjective:

Since defines a linear function f:TemplateBox[{}, Reals]^3->TemplateBox[{}, Reals]^3, the failure to be injective implies a failure to be surjective:

Determine if the matrix defines an automorphism (a bijective linear map):

Since TemplateBox[{a}, Det]!=0, the mapping is an automorphism:

Confirm the result using FunctionBijective:

Compute the cofactor obtained from removing row i and column j:

Check the result:

Modular computation of a determinant:

Modular determinants:

Recover the result:

Shift the residue to be symmetric:

Confirm that the non-modular determinant was recovered:

Properties & Relations  (14)

The determinant is the product of the eigenvalues:

Det satisfies TemplateBox[{a}, Det]=sum_sigma^(S_n)sgn[sigma]product_i^na〚i,sigma〚i〛〛, where is all -permutations and is Signature:

Det can be computed recursively via cofactor expansion along any row:

Or any column:

The determinant is the signed volume of the parallelepiped generated by its rows:

This equals the volume up to sign:

A square matrix has an inverse if and only if its determinant is nonzero:

The determinant of a triangular matrix is the product of its diagonal elements:

The determinant of a matrix product is the product of the determinants:

The determinant of the inverse is the reciprocal of the determinant:

A matrix and its transpose have equal determinants:

The determinant of the matrix exponential is the exponential of the trace:

CharacteristicPolynomial[m] is equal to :

Det[m] can be computed from LUDecomposition[m]:

Consider two rectangular matrices and such that and are both square:

Sylvester's determinant theorem states that TemplateBox[{{𝟙, +, {a, ., b}}}, Det]=TemplateBox[{{𝟙, +, {b, ., a}}}, Det], where is the matching identity matrix:

If a matrix is the TensorProduct of two vectors and , then TemplateBox[{{𝟙, +, m}}, Det]=1+u.v:

This can be expressed equally in terms of KroneckerProduct:

This follows from Sylvester's determinant theorem for the corresponding row and column matrices:

Neat Examples  (1)

Determinants of tridiagonal matrices:

A closed-form formula for these determinants is given by (a c)^(n/2) TemplateBox[{n, {b, /, {(, {2,  , {sqrt(, {a,  , c}, )}}, )}}}, ChebyshevU]:

Wolfram Research (1988), Det, Wolfram Language function, https://reference.wolfram.com/language/ref/Det.html (updated 2024).

Text

Wolfram Research (1988), Det, Wolfram Language function, https://reference.wolfram.com/language/ref/Det.html (updated 2024).

CMS

Wolfram Language. 1988. "Det." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/Det.html.

APA

Wolfram Language. (1988). Det. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Det.html

BibTeX

@misc{reference.wolfram_2024_det, author="Wolfram Research", title="{Det}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/Det.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_det, organization={Wolfram Research}, title={Det}, year={2024}, url={https://reference.wolfram.com/language/ref/Det.html}, note=[Accessed: 21-November-2024 ]}