# Matrix determinant (det)

Determinant of a square matrix.

With this function, the solver shows the steps whenever it finds them.

## How to write it

### det(matrix)

**matrix**

A matrix, written as a list of rows. Takes a matrix, written as a list of rows.

## Examples

- $\displaystyle \begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix} = -2$

  `det([[1, 2], [3, 4]])`

  In the solver, `det([[1, 2], [3, 4]])` gives `-2`.

  [Open in the solver](https://hilberon.com/?q=det%28%5B%5B1%2C%202%5D%2C%20%5B3%2C%204%5D%5D%29)
- $\displaystyle \begin{vmatrix} a & b \\ c & d \end{vmatrix} = a d-b c$

  `det([[a, b], [c, d]])`

  In the solver, `det([[a, b], [c, d]])` gives `a*d - b*c`.

  [Open in the solver](https://hilberon.com/?q=det%28%5B%5Ba%2C%20b%5D%2C%20%5Bc%2C%20d%5D%5D%29)

## Related functions

- [diagonal](https://hilberon.com/library/diagonal)

  The diagonal of a matrix, as a list.
- [cross](https://hilberon.com/library/cross)

  Cross product of two vectors in three dimensions.
- [diagonal_matrix](https://hilberon.com/library/diagonal_matrix)

  A matrix with the given list on its diagonal and zeros elsewhere.
- [cholesky_decomposition](https://hilberon.com/library/cholesky_decomposition)

  Cholesky decomposition of a symmetric positive definite matrix.
- [dot](https://hilberon.com/library/dot)

  Dot product of two vectors, or product of two matrices.
- [characteristic_polynomial](https://hilberon.com/library/characteristic_polynomial)

  Characteristic polynomial of a square matrix in a variable.

---
Source: https://hilberon.com/library/det
