Determinant of a matrix
This functionality does not run in MATLAB.
det(A) returns the determinant of the matrix A.
If the argument does not evaluate to a matrix of one of the types mentioned above, a symbolic call det(A) is returned.
The MinorExpansion option is useful for small matrices (typically, matrices of dimension up to 10) containing many symbolic entries. By default, det tries to recognize matrices that can benefit from using MinorExpansion, and uses this option when computing their determinants. Nevertheless, det does not always recognize these matrices. Also, identifying that a matrix is small enough and contains many symbolic entries takes time. To improve performance, use the MinorExpansion option explicitly.
By default, det calls normal before returning results. This additional internal call ensures that the final result is normalized. This call can be computationally expensive. It also affects the result returned by det only if a matrix contains variables or exact expressions, such as sqrt(5) or sin(PI/7)).
We compute the determinant of a matrix given by various data types:
A := array(1..2, 1..2, [[1, 2], [3, PI]]); det(A)
B := hfarray(1..2, 1..2, [[1, 2], [3, PI]]); det(B)
C := matrix(2, 2, [[1, 2], [3, PI]]); det(C)
delete A, B, C:
If the input does not evaluate to a matrix, then symbolic calls are returned:
delete A, B: det(A + 2*B)
If you use the Normal option, det calls the normal function for final results. This call ensures that det returns results in normalized form:
det(matrix([[x, x^2], [x/(x + 2), 1/x]]))
If you specify Normal = FALSE, det does not call normal for the final result:
det(matrix([[x, x^2], [x/(x + 2), 1/x]]), Normal = FALSE)
Using Normal can significantly decrease performance of det. For example, computing the determinant of this matrix takes a long time:
n := 5: det5 := det(matrix([[(x[i*j]^(i + j) + x[i+j]^j)/(i + j) $ j = 1..n] $ i = 1..n])):
For better performance, specify Normal = FALSE:
n := 5: det5 := det(matrix([[(x[i*j]^(i + j) + x[i+j]^j)/(i + j) $ j = 1..n] $ i = 1..n]), Normal = FALSE):
Compute the determinant by a recursive minor expansion along the first column.
Option, specified as Normal = b
Return normalized results. The value b must be TRUE or FALSE. By default, Normal = TRUE, meaning that det guarantees normalization of the returned results. Normalizing results can be computationally expensive.