# Matrix Determinant Calculator

The determinant of a square matrix $A=\left({a}_{ij}\right)$ of dimension n is a real number which depends linearly on each column vector of the matrix. We denote by $\mathrm{det}\left(A\right)$ or $|A|$ the determinant of the square matrix A.

## Properties of determinants

• The determinant is equal to 0 if,
• Two lines in the matrix are equal.
• The matrix has at least one row or column equal to zero.
• The matrix is ​​unique.
• Subtracting row i from row j n times does not change the value of the determinant.
• If two rows or columns are swapped, the sign of the determinant changes from positive to negative or from negative to positive.
• The determinant of the identity matrix is equal to 1, $\mathrm{det}\left({I}_{n}\right)=1$
• The determinants of A and its transpose are equal, $\mathrm{det}\left({A}^{T}\right)=\mathrm{det}\left(A\right)$
• $\mathrm{det}\left({A}^{-1}\right)=\frac{1}{\mathrm{det}\left(A\right)}={\left[\mathrm{det}\left(A\right)\right]}^{-1}$
• If A and B have matrices of the same dimension, $\mathrm{det}\left(AB\right)=\mathrm{det}\left(A\right)×\mathrm{det}\left(B\right)$
• $\mathrm{det}\left(cA\right)={c}^{n}x\mathrm{det}\left(A\right)$
• $\mathrm{det}\left(A\right)={a}_{n}{a}_{22}\dots {a}_{nn}=\prod _{i=1}^{n}{a}_{ii}$ , if the matrix A is triangular ${a}_{ij}=0$ et $i\ne j$ , the determinant is equal to the product of the diagonal of the matrix.

## Determinant calculation methods

### Cofactor expansion (Laplace expansion)

Cofactor expansion is used for small matrices because it becomes inefficient for large matrices compared to the matrix decomposition methods.

The formula for calculating the expansion of Place is given by:

Where $k$ is a fixed choice of $i\in \left\{1,2,\dots ,n\right\}$ and $\mathrm{det}\left({A}_{kj}\right)$ is the minor of element ${a}_{ij}$.

Example

### Leibniz formula

Where ${S}_{n}\in \left\{1,2,\dots ,n\right\}$ is a set of permutations from 1 to n, and $\mathrm{sgn}$ is a function that defines the sign int the set ${\mathrm{S}}_{n}$, which returns +1 for even permutations and -1 for odd permutations.

Example

### Gauss Elimination

Gauss elimination is also used to find the determinant by transforming the matrix into a reduced row echelon form by swapping rows or columns, add to row and multiply of another row in order to show a maximum of zeros.

For each pivot we multiply by -1.

Where $p$ is the number of the permutations and $A\left[k,j\right]$ is the pivot calculated in step j.

### Rule of Sarrus

The Sarrus Rule is used for computing only 3x3 matrix determinant. The method consists in adding the first two columns after the first three columns then calculating the product of the coefficients of each diagonal according to the following scheme:

### Bareiss algorithm(Montante's method)

The Bareiss algorithm calculates the echelon form of the matrix with integer values. It looks a bit like the Gaussian elimination algorithm and in terms of the number of operations performed. Divisions made have no remainder.

The determinant is determined after several reductions of the matrix to the last row by dividing on a pivot of the diagonal with the formula: