Determinant of a Matrix
Every square matrix has a number attached to it: its determinant. This one number tells whether the matrix has an inverse, whether a system of linear equations has exactly one solution, and how the matrix changes areas and volumes. In this lesson you will learn what minors and cofactors are, how to calculate determinants of order 2, 3 and 4 (with a formula, with Sarrus' rule, by cofactor expansion and by row reduction), and which properties make the work short.
On this page: Definition · Notation and order · 2×2 and 3×3 determinants · Minors · Cofactors · Cofactor expansion · Properties · Calculating with the properties · When the determinant is 0 · Solved problems · Practice problems
What is a determinant?
The determinant of a square matrix $A$ is a number calculated from the entries of $A.$ It is written $\det A.$ Only square matrices have a determinant.
For a 1×1 matrix the determinant is its only entry. For a 2×2 matrix it is the product of the two entries on the main diagonal minus the product of the other two entries:
$$\det\begin{pmatrix}a&b\\c&d\end{pmatrix}=ad-bc$$For a larger matrix the determinant is defined through determinants of order one less (the cofactor expansion below), so in the end every determinant comes down to 2×2 determinants. The result can be any number: positive, negative, zero or a fraction.
Example. $\det\begin{pmatrix}3&1\\1&2\end{pmatrix}=3\cdot2-1\cdot1=5$ and $\det\begin{pmatrix}\dfrac{1}{2}&1\\1&3\end{pmatrix}=\frac{3}{2}-1=\frac{1}{2}.$
Why determinants matter:
- A square matrix has an inverse exactly when its determinant is not 0 (see inverse matrices).
- A system of $n$ linear equations with $n$ unknowns has exactly one solution exactly when the determinant of its coefficient matrix is not 0. Cramer's rule even writes that solution with determinants (see systems of linear equations).
- Geometry: the rows $(3,1)$ and $(1,2)$ of the first matrix above are two vectors in the plane. The parallelogram they span has area 5, the absolute value of the determinant. For a 3×3 matrix, $|\det A|$ is the volume of the box (parallelepiped) spanned by its three rows.
Notation
The entry in row $i$ and column $j$ of a matrix $A$ is written $a_{ij}.$ The determinant of $A$ is written $\det A$ or with the entries of $A$ between two vertical bars. For example, for
$$A=\begin{pmatrix}1&4&2\\5&3&7\\6&2&1\end{pmatrix}$$we write
$$\det A=\begin{vmatrix}1&4&2\\5&3&7\\6&2&1\end{vmatrix}$$Round brackets mean the matrix, a table of numbers. Straight bars mean its determinant, one number (in Example 9 we find that this one equals 121). The bars do not mean an absolute value: a determinant can be negative. Other books write $\det(A),$ $|A|$ or $\Delta.$
The order of a determinant
The order of a determinant is its number of rows, which is the same as its number of columns. The determinant of an ${n\times n}$ matrix has order $n.$
For example, $\begin{vmatrix}1&4\\6&2\end{vmatrix}$ has 2 rows and 2 columns, so its order is 2, and $\begin{vmatrix}4&7&9\\6&3&2\\7&1&4\end{vmatrix}$ has order 3. A matrix that is not square, for example a 2×3 matrix, has no determinant.
Calculating 2×2 and 3×3 determinants
Determinants of order 2 and 3 have short formulas. Larger determinants are calculated by cofactor expansion and with the properties of determinants, explained further down.
Calculating a 2×2 determinant
The product on the main diagonal minus the product on the secondary diagonal.
Example 1. $\begin{vmatrix}2&5\\3&8\end{vmatrix}=2\cdot8-5\cdot3=16-15=1$
Example 2. When an entry is negative, put it in brackets:
$\begin{vmatrix}-4&7\\-2&9\end{vmatrix}=(-4)\cdot9-7\cdot(-2)=-36+14=-22$
Calculating a 3×3 determinant: Sarrus' rule
For a 3×3 matrix $A,$
${\det A}={a_{11}a_{22}a_{33}}+{a_{12}a_{23}a_{31}+a_{13}a_{21}a_{32}}$
${-a_{13}a_{22}a_{31}}-{a_{11}a_{23}a_{32}-a_{12}a_{21}a_{33}}$
The six products are easy to remember with Sarrus' rule. Write the first two columns again to the right of the determinant. The three products along the lines going down to the right get a plus sign (the colours show which three entries are multiplied):
$$\begin{vmatrix}\textcolor{#c0392b}{a_{11}}&\textcolor{#1e8449}{a_{12}}&\textcolor{#1b64a8}{a_{13}}\\a_{21}&\textcolor{#c0392b}{a_{22}}&\textcolor{#1e8449}{a_{23}}\\a_{31}&a_{32}&\textcolor{#c0392b}{a_{33}}\end{vmatrix}\begin{matrix}a_{11}&a_{12}\\\textcolor{#1b64a8}{a_{21}}&a_{22}\\\textcolor{#1e8449}{a_{31}}&\textcolor{#1b64a8}{a_{32}}\end{matrix}$$The three products along the lines going up to the right get a minus sign:
$$\begin{vmatrix}a_{11}&a_{12}&\textcolor{#c0392b}{a_{13}}\\a_{21}&\textcolor{#c0392b}{a_{22}}&\textcolor{#1e8449}{a_{23}}\\\textcolor{#c0392b}{a_{31}}&\textcolor{#1e8449}{a_{32}}&\textcolor{#1b64a8}{a_{33}}\end{vmatrix}\begin{matrix}\textcolor{#1e8449}{a_{11}}&\textcolor{#1b64a8}{a_{12}}\\\textcolor{#1b64a8}{a_{21}}&a_{22}\\a_{31}&a_{32}\end{matrix}$$Instead of the two columns on the right, you can also write the first two rows below the determinant and multiply along the diagonals in the same way: the six products are the same. Sarrus' rule works only for 3×3 determinants. Where the formula comes from is shown in the section on cofactor expansion.
Example 3. Calculate $\det A$ for ${A=\begin{pmatrix}1&4&3\\2&1&5\\3&2&1\end{pmatrix}}.$
We write the first two columns again on the right:
$$\begin{vmatrix}1&4&3\\2&1&5\\3&2&1\end{vmatrix}\begin{matrix}1&4\\2&1\\3&2\end{matrix}$$${\det A}={1\cdot1\cdot1+4\cdot5\cdot3}+{3\cdot2\cdot2-3\cdot1\cdot3}-{1\cdot5\cdot2-4\cdot2\cdot1}$
$={1+60+12-9-10-8}={73-27}={46}$
The matrix calculator shows Sarrus' rule for this example.
Example 4. Calculate the determinant of ${B=\begin{pmatrix}3&5&1\\1&4&2\\7&1&9\end{pmatrix}}.$
${\det B}={3\cdot4\cdot9+5\cdot2\cdot7}+{1\cdot1\cdot1-1\cdot4\cdot7}-{3\cdot2\cdot1-5\cdot1\cdot9}$
$={108+70+1}-{28-6-45}={179-79}={100}$
Minors
Let $A$ be a square matrix. The minor $M_{ij}$ of the entry $a_{ij}$ is the determinant of the matrix that is left after deleting row $i$ and column $j$ of $A.$
The minors of a matrix of order $n$ are determinants of order ${n-1}.$ Some books write $\Delta_{ij}$ instead of $M_{ij}.$ In the examples the deleted entries are grey.
Example 5. Find the minor of the entry 2 in ${A=\begin{pmatrix}4&7\\2&9\end{pmatrix}}.$
The entry 2 is in row 2 and column 1, so it is $a_{21}.$ We delete row 2 and column 1:
$$\begin{pmatrix}\textcolor{#aaa}{4}&7\\\textcolor{#aaa}{2}&\textcolor{#aaa}{9}\end{pmatrix}$$Only the entry 7 is left, so ${M_{21}=7}.$
Example 6. Find the minors $M_{23},$ $M_{33}$ and $M_{22}$ of the matrix ${A=\begin{pmatrix}1&4&2\\5&3&7\\6&2&1\end{pmatrix}}$ from the notation section.
For $M_{23}$ we delete row 2 and column 3:
$$\begin{pmatrix}1&4&\textcolor{#aaa}{2}\\\textcolor{#aaa}{5}&\textcolor{#aaa}{3}&\textcolor{#aaa}{7}\\6&2&\textcolor{#aaa}{1}\end{pmatrix}$$$M_{23}=\begin{vmatrix}1&4\\6&2\end{vmatrix}=1\cdot2-4\cdot6=-22$
In the same way we delete row 3 and column 3, and then row 2 and column 2:
$M_{33}=\begin{vmatrix}1&4\\5&3\end{vmatrix}=3-20=-17$
$M_{22}=\begin{vmatrix}1&2\\6&1\end{vmatrix}=1-12=-11$
Example 7. Find the minor of the entry 5 in ${B=\begin{pmatrix}2&5&1&3\\4&1&7&9\\6&8&3&2\\7&8&1&4\end{pmatrix}}.$
The entry 5 is $a_{12}.$ We delete row 1 and column 2:
$$\begin{pmatrix}\textcolor{#aaa}{2}&\textcolor{#aaa}{5}&\textcolor{#aaa}{1}&\textcolor{#aaa}{3}\\4&\textcolor{#aaa}{1}&7&9\\6&\textcolor{#aaa}{8}&3&2\\7&\textcolor{#aaa}{8}&1&4\end{pmatrix}$$The minor is a 3×3 determinant, and Sarrus' rule gives its value:
$M_{12}=\begin{vmatrix}4&7&9\\6&3&2\\7&1&4\end{vmatrix}=48+98+54-189-8-168=-165$
More generally, any $k$ rows and any $k$ columns of a matrix (square or not) give a minor of order $k\text{:}$ the determinant of the entries where these rows and columns cross. For example, rows 2 and 3 and columns 2 and 3 of the matrix $B$ above give the minor $\begin{vmatrix}1&7\\8&3\end{vmatrix}=3-56=-53$ of order 2: we deleted rows 1 and 4 and columns 1 and 4. Minors of every order are used to find the rank of a matrix.
Cofactors
The cofactor of the entry $a_{ij}$ is its minor with a sign:
$$C_{ij}=(-1)^{i+j}M_{ij}$$When ${i+j}$ is even, the cofactor equals the minor; when ${i+j}$ is odd, it is the minor with the opposite sign. The signs alternate like the squares of a chessboard, with ${+}$ in the top left corner:
$$\begin{pmatrix}+&-&+\\-&+&-\\+&-&+\end{pmatrix}$$ $$\begin{pmatrix}+&-&+&-\\-&+&-&+\\+&-&+&-\\-&+&-&+\end{pmatrix}$$For example, the cofactor of $a_{25}$ (in a matrix of order 5 or more) is ${C_{25}}={(-1)^{2+5}M_{25}}={-M_{25}}.$
Example 8. Find the cofactors of the entries of row 2 of ${A=\begin{pmatrix}1&4&2\\5&3&7\\6&2&1\end{pmatrix}}.$
$C_{21}=-\begin{vmatrix}4&2\\2&1\end{vmatrix}=-(4-4)=0$
$C_{22}=+\begin{vmatrix}1&2\\6&1\end{vmatrix}=1-12=-11$
$C_{23}=-\begin{vmatrix}1&4\\6&2\end{vmatrix}=-(2-24)=22$
Compare with Example 6: ${C_{22}=M_{22}}$ because ${2+2}$ is even, and ${C_{23}=-M_{23}}$ because ${2+3}$ is odd.
Cofactor expansion along a row or a column
Multiply every entry of one row (or one column) by its cofactor and add the products. The sum is the determinant. Along row $i\text{:}$
${\det A}={a_{i1}C_{i1}+a_{i2}C_{i2}}+{\dots+a_{in}C_{in}}$
Along column $j\text{:}$
${\det A}={a_{1j}C_{1j}+a_{2j}C_{2j}}+{\dots+a_{nj}C_{nj}}$
Every row and every column gives the same result.
This is also called the Laplace expansion. It turns a determinant of order $n$ into $n$ determinants of order ${n-1},$ so it works for every order, and it is the definition of the determinant of a large matrix. For $\begin{pmatrix}a&b\\c&d\end{pmatrix}$ the cofactors of row 1 are ${C_{11}=d}$ and ${C_{12}=-c},$ and the expansion gives the familiar formula ${a\cdot d+b\cdot(-c)}={ad-bc}.$ For a 3×3 matrix the expansion along row 1 is
$\det A=a_{11}\begin{vmatrix}a_{22}&a_{23}\\a_{32}&a_{33}\end{vmatrix}-a_{12}\begin{vmatrix}a_{21}&a_{23}\\a_{31}&a_{33}\end{vmatrix}$
$+a_{13}\begin{vmatrix}a_{21}&a_{22}\\a_{31}&a_{32}\end{vmatrix}$
Multiplying out the three 2×2 determinants gives exactly the six products of Sarrus' rule.
Example 9. Calculate the determinant of ${A=\begin{pmatrix}1&4&2\\5&3&7\\6&2&1\end{pmatrix}}$ by expansion along row 1.
$C_{11}=+\begin{vmatrix}3&7\\2&1\end{vmatrix}=3-14=-11$
$C_{12}=-\begin{vmatrix}5&7\\6&1\end{vmatrix}=-(5-42)=37$
$C_{13}=+\begin{vmatrix}5&3\\6&2\end{vmatrix}=10-18=-8$
${\det A}={1\cdot(-11)}+{4\cdot37+2\cdot(-8)}={-11+148-16}={121}$
Row 2 gives the same value with the cofactors from Example 8:
${\det A}={5\cdot0}+{3\cdot(-11)+7\cdot22}={-33+154}={121}$
The matrix calculator shows this expansion step by step.
A zero entry times its cofactor is 0, so its cofactor need not be calculated. That is why you should expand along the row or column with the most zeros.
Example 10. Calculate $\begin{vmatrix}2&0&1\\3&0&-1\\4&5&2\end{vmatrix}.$
Column 2 has two zeros, so we expand along column 2. Only the entry ${a_{32}=5}$ is left. We delete row 3 and column 2; the sign is ${(-1)^{3+2}=-1}\text{:}$
$\begin{vmatrix}2&\textcolor{#aaa}{0}&1\\3&\textcolor{#aaa}{0}&-1\\\textcolor{#aaa}{4}&\textcolor{#c0392b}{5}&\textcolor{#aaa}{2}\end{vmatrix}=5\cdot(-1)^{3+2}\begin{vmatrix}2&1\\3&-1\end{vmatrix}$
$$=-5\cdot(-2-3)=25$$The matrix calculator can expand along any row or column you choose.
Example 11. Calculate the 4×4 determinant $\begin{vmatrix}4&3&2&2\\0&1&-3&3\\0&-1&3&3\\0&3&1&1\end{vmatrix}.$
Column 1 has only one entry that is not 0, so we expand along column 1 and need only one cofactor. We delete row 1 and column 1:
$$\begin{vmatrix}\textcolor{#c0392b}{4}&\textcolor{#aaa}{3}&\textcolor{#aaa}{2}&\textcolor{#aaa}{2}\\\textcolor{#aaa}{0}&1&-3&3\\\textcolor{#aaa}{0}&-1&3&3\\\textcolor{#aaa}{0}&3&1&1\end{vmatrix}$$ $$=4\cdot(-1)^{1+1}\begin{vmatrix}1&-3&3\\-1&3&3\\3&1&1\end{vmatrix}$$By Sarrus' rule:
$={4}\cdot {(3-27-3-27-3-3)}={4\cdot(-60)}={-240}$
Properties of the determinant
Let $A$ be a square matrix of order $n.$ We write $R_i$ for row $i$ and $C_j$ for column $j$ (a column has one index, a cofactor $C_{ij}$ has two).
- The transpose has the same determinant: ${\det A^T=\det A}.$ So rows and columns behave in the same way, and every property below that speaks about rows is also true for columns. For example, $\begin{vmatrix}1&5\\3&8\end{vmatrix}=\begin{vmatrix}1&3\\5&8\end{vmatrix}=-7.$
- A row of zeros gives determinant 0: expand along that row. For example, $\begin{vmatrix}1&4&2\\0&0&0\\3&9&5\end{vmatrix}=0,$ and with a column of zeros, $\begin{vmatrix}1&4&0\\4&2&0\\3&9&0\end{vmatrix}=0.$
- Swapping two rows changes the sign of the determinant: $\begin{vmatrix}3&8\\1&5\end{vmatrix}=-\begin{vmatrix}1&5\\3&8\end{vmatrix}=7.$
- Two equal rows give determinant 0. Swapping them does not change the matrix but changes the sign, so ${\det A=-\det A},$ and this is only possible when ${\det A=0}.$ For example, $\begin{vmatrix}1&4&2\\1&4&2\\3&9&5\end{vmatrix}=0$ (rows 1 and 2 are equal) and $\begin{vmatrix}1&4&1\\4&2&4\\3&9&3\end{vmatrix}=0$ (columns 1 and 3 are equal).
- A common factor of all entries of one row can be taken out in front of the determinant. Below we take 3 out of row 1 and then 2 out of column 3: $$\begin{vmatrix}3&9&12\\5&1&8\\7&4&2\end{vmatrix}=3\begin{vmatrix}1&3&4\\5&1&8\\7&4&2\end{vmatrix}$$ $$=6\begin{vmatrix}1&3&2\\5&1&4\\7&4&1\end{vmatrix}$$ Read backwards, this property says: multiplying one row by $k$ multiplies the determinant by $k.$
- Proportional rows give determinant 0: take the factor out, and two rows become equal. For example, $\begin{vmatrix}1&4&2\\2&8&4\\3&9&5\end{vmatrix}=0$ because ${R_2=2R_1},$ and $\begin{vmatrix}8&4&7\\4&2&3\\18&9&8\end{vmatrix}=0$ because ${C_1=2C_2}.$
- Adding a multiple of another row to a row does not change the determinant. For $\begin{vmatrix}1&5\\3&8\end{vmatrix}=-7,$ the operations ${R_1\to R_1+R_2},$ ${R_1\to R_1+3R_2}$ and ${C_1\to C_1+C_2}$ give
$\begin{vmatrix}4&13\\3&8\end{vmatrix}=\begin{vmatrix}10&29\\3&8\end{vmatrix}=\begin{vmatrix}6&5\\11&8\end{vmatrix}=-7$
Be careful: the row that changes must not be multiplied. The operation ${R_1\to 2R_1+3R_2}$ also doubles row 1, so it doubles the determinant: $\begin{vmatrix}11&34\\3&8\end{vmatrix}=-14.$ - A row that is a sum of other rows, or more generally a combination of them, gives determinant 0: subtracting those rows produces a row of zeros. For example, $\begin{vmatrix}1&4&2\\7&2&3\\8&6&5\end{vmatrix}=0$ because ${R_3=R_1+R_2},$ and $\begin{vmatrix}9&12&3\\1&8&7\\5&7&2\end{vmatrix}=0$ because ${C_2=C_1+C_3}.$
- A sum in one row splits the determinant into two:
$\begin{vmatrix}a+p&b+q\\c&d\end{vmatrix}=\begin{vmatrix}a&b\\c&d\end{vmatrix}+\begin{vmatrix}p&q\\c&d\end{vmatrix}$
Only one row is split at a time. For whole matrices, in general ${\det(A+B)\ne\det A+\det B}.$ - A triangular matrix (all entries below the main diagonal are 0, or all entries above it) has determinant equal to the product of its diagonal entries: expand along the first column again and again (if the zeros are below the diagonal) or along the first row (if they are above it). For example, $\begin{vmatrix}2&7&-1\\0&3&5\\0&0&4\end{vmatrix}=2\cdot3\cdot4=24.$ In particular, the identity matrix has ${\det I_n=1}.$
- The determinant of a product is the product of the determinants: ${\det(AB)=\det A\cdot\det B}.$
For example, for ${A=\begin{pmatrix}1&2\\3&4\end{pmatrix}}$ and ${B=\begin{pmatrix}2&0\\1&3\end{pmatrix}}$ we have ${\det A=-2}$ and ${\det B=6},$ and
$AB=\begin{pmatrix}1&2\\3&4\end{pmatrix}\begin{pmatrix}2&0\\1&3\end{pmatrix}=\begin{pmatrix}4&6\\10&12\end{pmatrix}$
$\det(AB)=\begin{vmatrix}4&6\\10&12\end{vmatrix}=48-60=-12=(-2)\cdot6$
It follows that ${\det(A^m)=(\det A)^m}$ and, for an invertible matrix, ${\det(A^{-1})=\frac{1}{\det A}}.$ Also ${\det(AB)=\det(BA)},$ although in general ${AB\ne BA}$ (see matrix multiplication). - A number factor comes out with the power $n\text{:}$ ${\det(kA)=k^n\det A}$ for a matrix of order $n,$ because each of the $n$ rows is multiplied by $k.$ For example, $\det\begin{pmatrix}3&6\\9&12\end{pmatrix}=36-54=-18=3^2\cdot(-2).$
How the three row operations change the determinant (the same is true for columns):
- swapping two rows, ${R_i\leftrightarrow R_j}\text{:}$ the sign changes;
- multiplying a row by a number, ${R_i\to kR_i}\text{:}$ the determinant is multiplied by $k;$
- adding a multiple of another row, ${R_i\to R_i+kR_j}\text{:}$ no change.
Calculating determinants with the properties
Expanding a 4×4 determinant directly needs four 3×3 determinants, and a 5×5 determinant needs five 4×4 determinants. The properties make the work much shorter. There are two ways to use them.
Creating zeros, then expanding
Choose a row or a column, preferably one with zeros or with an entry 1. With operations ${R_i\to R_i+kR_j}$ (or the same with columns), make all its entries except one equal to 0. Then expand along it: only one cofactor is left. To get zeros in a column, combine rows; to get zeros in a row, combine columns.
Example 12. Calculate $\begin{vmatrix}1&2&-1\\3&7&2\\-2&1&4\end{vmatrix}.$
Column 1 starts with 1. The operations ${R_2\to R_2-3R_1}$ and ${R_3\to R_3+2R_1}$ make the other two entries of column 1 equal to 0 and do not change the determinant:
$$\begin{vmatrix}1&2&-1\\3&7&2\\-2&1&4\end{vmatrix}=\begin{vmatrix}1&2&-1\\0&1&5\\0&5&2\end{vmatrix}$$We expand along column 1:
$$=1\cdot\begin{vmatrix}1&5\\5&2\end{vmatrix}=2-25=-23$$Reduction to triangular form
Use row operations to make the matrix triangular, and keep track of how each operation changes the determinant (see the box above): a swap changes the sign, a factor taken out of a row goes in front, and ${R_i\to R_i+kR_j}$ changes nothing. At the end, multiply the entries on the diagonal. This is the idea of Gaussian elimination, and it is how computers calculate large determinants.
Example 13. Calculate $\det A$ for ${A=\begin{pmatrix}0&2&1\\1&3&2\\2&4&7\end{pmatrix}}.$
The top left entry is 0, so we first swap rows 1 and 2, ${R_1\leftrightarrow R_2}.$ The sign changes:
$$\det A=\begin{vmatrix}0&2&1\\1&3&2\\2&4&7\end{vmatrix}=-\begin{vmatrix}1&3&2\\0&2&1\\2&4&7\end{vmatrix}$$${R_3\to R_3-2R_1}$ does not change the determinant:
$$=-\begin{vmatrix}1&3&2\\0&2&1\\0&-2&3\end{vmatrix}$$${R_3\to R_3+R_2}\text{:}$
$$=-\begin{vmatrix}1&3&2\\0&2&1\\0&0&4\end{vmatrix}$$The determinant is triangular, so we multiply the diagonal entries:
$$=-1\cdot2\cdot4=-8$$Calculating a 4×4 determinant
Sarrus' rule does not work for 4×4 determinants. Before you start calculating, look at the determinant:
- Is it 0 at once? Look for a row or a column of zeros, two equal or proportional rows or columns, or a row that is a sum of other rows.
- Can a common factor be taken out of a row or a column?
- Does every row contain the same numbers in a different order? Then adding all the other rows to one of them gives a common factor (see Problem 7 below).
- Which row or column has zeros or an entry 1? Create zeros there and expand, or reduce the determinant to triangular form.
For example, the following three determinants are 0 without any calculation. In the first, row 3 consists of zeros; in the second, columns 1 and 3 are equal; in the third, row 3 is twice row 2.
$$\begin{vmatrix}1&3&9&2\\5&8&4&3\\0&0&0&0\\2&3&1&8\end{vmatrix}=0$$ $$\begin{vmatrix}1&3&1&2\\5&8&5&3\\0&4&0&0\\2&3&2&8\end{vmatrix}=0$$ $$\begin{vmatrix}1&3&9&2\\5&8&4&3\\10&16&8&6\\2&3&1&8\end{vmatrix}=0$$Example 14. Calculate
$$\begin{vmatrix}4&3&2&2\\0&1&0&-2\\1&-1&3&3\\2&3&1&1\end{vmatrix}$$Row 2 already has two zeros and an entry 1. The column operation ${C_4\to C_4+2C_2}$ makes its last entry 0. Then we expand along row 2, so we delete row 2 and column 2:
$$=\begin{vmatrix}4&\textcolor{#aaa}{3}&2&8\\\textcolor{#aaa}{0}&\textcolor{#c0392b}{1}&\textcolor{#aaa}{0}&\textcolor{#aaa}{0}\\1&\textcolor{#aaa}{-1}&3&1\\2&\textcolor{#aaa}{3}&1&7\end{vmatrix}$$ $$=1\cdot(-1)^{2+2}\begin{vmatrix}4&2&8\\1&3&1\\2&1&7\end{vmatrix}$$$={84+4+8-48-4-14}={30}$
Example 15. Calculate
$$\begin{vmatrix}2&5&1&4\\4&1&6&3\\5&3&7&2\\1&0&2&4\end{vmatrix}$$Row 4 starts with 1, so we make zeros in column 1 with ${R_1\to R_1-2R_4},$ ${R_2\to R_2-4R_4}$ and ${R_3\to R_3-5R_4}.$ Then we expand along column 1, deleting row 4 and column 1:
$$=\begin{vmatrix}\textcolor{#aaa}{0}&5&-3&-4\\\textcolor{#aaa}{0}&1&-2&-13\\\textcolor{#aaa}{0}&3&-3&-18\\\textcolor{#c0392b}{1}&\textcolor{#aaa}{0}&\textcolor{#aaa}{2}&\textcolor{#aaa}{4}\end{vmatrix}$$ $$=1\cdot(-1)^{4+1}\begin{vmatrix}5&-3&-4\\1&-2&-13\\3&-3&-18\end{vmatrix}$$We take ${-1}$ out of column 2 and ${-1}$ out of column 3. Since ${(-1)\cdot(-1)=1},$ the minus sign in front stays:
$$=-\begin{vmatrix}5&3&4\\1&2&13\\3&3&18\end{vmatrix}$$$={-180-117-12}+{24+195+54}={-36}$
Example 16. Calculate by reduction to triangular form:
$$\begin{vmatrix}1&2&-1&3\\2&5&0&4\\-1&1&7&-4\\3&5&-3&12\end{vmatrix}$$Zeros below the 1 in column 1: ${R_2\to R_2-2R_1},$ ${R_3\to R_3+R_1}$ and ${R_4\to R_4-3R_1}.$ The determinant does not change:
$$=\begin{vmatrix}1&2&-1&3\\0&1&2&-2\\0&3&6&-1\\0&-1&0&3\end{vmatrix}$$Zeros below the 1 in column 2: ${R_3\to R_3-3R_2}$ and ${R_4\to R_4+R_2}\text{:}$
$$=\begin{vmatrix}1&2&-1&3\\0&1&2&-2\\0&0&0&5\\0&0&2&1\end{vmatrix}$$The swap ${R_3\leftrightarrow R_4}$ makes the determinant triangular and changes its sign:
$$=-\begin{vmatrix}1&2&-1&3\\0&1&2&-2\\0&0&2&1\\0&0&0&5\end{vmatrix}$$ $$=-1\cdot1\cdot2\cdot5=-10$$The matrix calculator shows the same method with all the steps.
When is the determinant 0?
For a square matrix $A$ of order $n,$ the following statements say the same thing (when one of them is true, all of them are true):
- ${\det A=0};$
- a row of $A$ is a combination of the other rows (and the same for the columns);
- $A$ has no inverse, that is, $A$ is singular;
- the rank of $A$ is less than $n;$
- the system ${AX=O}$ has a solution other than ${X=O}.$
Example. For ${A=\begin{pmatrix}1&2&3\\4&5&6\\7&8&9\end{pmatrix}}$ Sarrus' rule gives
$\begin{vmatrix}1&2&3\\4&5&6\\7&8&9\end{vmatrix}=45+84+96-105-48-72=0$
The reason is that ${R_1+R_3=2R_2},$ so the operation ${R_3\to R_3+R_1-2R_2}$ produces a row of zeros. This matrix has no inverse, its rank is 2, and a system of equations with this coefficient matrix has either no solution or infinitely many (see rank of a matrix and systems of linear equations).
When ${\det A\ne 0},$ everything is the other way round: $A$ has an inverse, its rank is $n,$ and every system ${AX=B}$ with this matrix has exactly one solution, which Cramer's rule writes with determinants. Geometrically, ${\det A=0}$ means that the rows of $A,$ viewed as vectors, lie on one line (for a 2×2 matrix) or in one plane (for a 3×3 matrix), so the parallelogram or box they span is flat and has area or volume 0.
Solved problems
Problem 1. Solve the equation $\begin{vmatrix}x-1&2\\4&x+1\end{vmatrix}=0.$
Solution:
$\begin{vmatrix}x-1&2\\4&x+1\end{vmatrix}=(x-1)(x+1)-2\cdot4=x^2-9$
${x^2-9=0}$ gives ${x=3}$ or ${x=-3}.$
Problem 2. $A$ and $B$ are 3×3 matrices with ${\det A=3}$ and ${\det B=-2}.$ Find ${\det(2A)},$ ${\det(A^TB)},$ ${\det(A^{-1})}$ and ${\det(-B)}.$
Solution: When a matrix of order 3 is multiplied by a number $k,$ its determinant is multiplied by ${k^3}.$
${\det(2A)=2^3\cdot3=24}$
${\det(A^TB)}={\det A^T\cdot\det B}={3\cdot(-2)}={-6}$
${\det(A^{-1})=\frac{1}{\det A}=\frac{1}{3}}$
${\det(-B)}={(-1)^3\cdot(-2)}={2}$
Problem 3. A 3×3 matrix $A$ is skew-symmetric: ${A^T=-A}.$ Prove that ${\det A=0}.$ Check it for ${A=\begin{pmatrix}0&2&-1\\-2&0&3\\1&-3&0\end{pmatrix}}.$
Solution: By the properties of the transpose and of a number factor,
${\det A}={\det A^T}={\det(-A)}={(-1)^3\det A}={-\det A}$
The only number equal to its opposite is 0, so ${\det A=0}.$ For the given matrix, Sarrus' rule confirms it:
$\begin{vmatrix}0&2&-1\\-2&0&3\\1&-3&0\end{vmatrix}=0+6-6-0-0-0=0$
For matrices of even order this is not true, for example $\begin{vmatrix}0&1\\-1&0\end{vmatrix}=1.$
Problem 4. Solve the equation ${D=0},$ where ${D=\begin{vmatrix}x&1&1\\1&x&1\\1&1&x\end{vmatrix}}.$
Solution: Every row has the same sum ${x+2}.$ We add rows 2 and 3 to row 1, ${R_1\to R_1+R_2+R_3},$ and take ${x+2}$ out of row 1:
$$D=\begin{vmatrix}x+2&x+2&x+2\\1&x&1\\1&1&x\end{vmatrix}$$ $$=(x+2)\begin{vmatrix}1&1&1\\1&x&1\\1&1&x\end{vmatrix}$$Now ${R_2\to R_2-R_1}$ and ${R_3\to R_3-R_1}$ give a triangular determinant:
$$=(x+2)\begin{vmatrix}1&1&1\\0&x-1&0\\0&0&x-1\end{vmatrix}$$ $$=(x+2)(x-1)^2$$So ${D=0}$ when ${x=-2}$ or ${x=1}.$
Problem 5. Calculate $\begin{vmatrix}4&7&2&3\\1&3&1&2\\2&5&3&4\\1&4&2&3\end{vmatrix}.$
Solution: Row 2 has the entry 1 in column 3. The column operations ${C_1\to C_1-C_3},$ ${C_2\to C_2-3C_3}$ and ${C_4\to C_4-2C_3}$ make the other entries of row 2 equal to 0. Then we expand along row 2, deleting row 2 and column 3:
$$\begin{vmatrix}2&1&\textcolor{#aaa}{2}&-1\\\textcolor{#aaa}{0}&\textcolor{#aaa}{0}&\textcolor{#c0392b}{1}&\textcolor{#aaa}{0}\\-1&-4&\textcolor{#aaa}{3}&-2\\-1&-2&\textcolor{#aaa}{2}&-1\end{vmatrix}$$ $$=1\cdot(-1)^{2+3}\begin{vmatrix}2&1&-1\\-1&-4&-2\\-1&-2&-1\end{vmatrix}$$We take ${-1}$ out of row 2 and ${-1}$ out of row 3. Since ${(-1)\cdot(-1)=1},$ the minus sign in front stays:
$$=-\begin{vmatrix}2&1&-1\\1&4&2\\1&2&1\end{vmatrix}$$$={-(8+2-2+4-8-1)}={-3}$
Problem 6. Calculate ${D=\begin{vmatrix}1&-2&3&2\\2&3&1&-1\\3&3&3&3\\-1&4&2&1\end{vmatrix}}.$
Solution: All entries of row 3 are 3, so we take 3 out of row 3:
$$D=3\begin{vmatrix}1&-2&3&2\\2&3&1&-1\\1&1&1&1\\-1&4&2&1\end{vmatrix}$$Now row 3 consists of 1s. The operations ${C_1\to C_1-C_4},$ ${C_2\to C_2-C_4}$ and ${C_3\to C_3-C_4}$ leave only one entry in row 3 that is not 0, and we expand along row 3:
$$=3\begin{vmatrix}-1&-4&1&\textcolor{#aaa}{2}\\3&4&2&\textcolor{#aaa}{-1}\\\textcolor{#aaa}{0}&\textcolor{#aaa}{0}&\textcolor{#aaa}{0}&\textcolor{#c0392b}{1}\\-2&3&1&\textcolor{#aaa}{1}\end{vmatrix}$$ $$=3\cdot1\cdot(-1)^{3+4}\begin{vmatrix}-1&-4&1\\3&4&2\\-2&3&1\end{vmatrix}$$By Sarrus' rule:
$={-3(-4+16+9+8+6+12)}={-3\cdot47}={-141}$
Do not forget the factor 3 that was taken out at the start.
Problem 7. Calculate ${D=\begin{vmatrix}2&1&3&4\\1&3&4&2\\3&4&2&1\\4&2&1&3\end{vmatrix}}.$
Solution: Every row and every column contains the numbers 1, 2, 3 and 4, so every column has the sum 10. The operation ${R_1\to R_1+R_2+R_3+R_4}$ gives a row of 10s, and we take 10 out:
$$D=\begin{vmatrix}10&10&10&10\\1&3&4&2\\3&4&2&1\\4&2&1&3\end{vmatrix}$$ $$=10\begin{vmatrix}1&1&1&1\\1&3&4&2\\3&4&2&1\\4&2&1&3\end{vmatrix}$$${C_1\to C_1-C_4},$ ${C_2\to C_2-C_4}$ and ${C_3\to C_3-C_4},$ then we expand along row 1:
$$=10\begin{vmatrix}\textcolor{#aaa}{0}&\textcolor{#aaa}{0}&\textcolor{#aaa}{0}&\textcolor{#c0392b}{1}\\-1&1&2&\textcolor{#aaa}{2}\\2&3&1&\textcolor{#aaa}{1}\\1&-1&-2&\textcolor{#aaa}{3}\end{vmatrix}$$ $$=10\cdot1\cdot(-1)^{1+4}\begin{vmatrix}-1&1&2\\2&3&1\\1&-1&-2\end{vmatrix}$$In the last determinant, row 3 is row 1 multiplied by ${-1}.$ Proportional rows give 0:
$$=-10\cdot0=0$$Problem 8. Prove that $\begin{vmatrix}a&b&c\\c&a&b\\b&c&a\end{vmatrix}=(a+b+c)(a^2+b^2+c^2-ab-bc-ca).$
Solution: Let $D$ be the determinant on the left. The sum of every row is ${a+b+c}.$ The operation ${C_1\to C_1+C_2+C_3}$ puts this sum in every entry of column 1, and we take it out:
$$D=\begin{vmatrix}a+b+c&b&c\\a+b+c&a&b\\a+b+c&c&a\end{vmatrix}$$ $$=(a+b+c)\begin{vmatrix}1&b&c\\1&a&b\\1&c&a\end{vmatrix}$$${R_2\to R_2-R_1}$ and ${R_3\to R_3-R_1},$ then expansion along column 1:
$$=(a+b+c)\begin{vmatrix}1&b&c\\0&a-b&b-c\\0&c-b&a-c\end{vmatrix}$$ $$=(a+b+c)\begin{vmatrix}a-b&b-c\\c-b&a-c\end{vmatrix}$$The 2×2 determinant is ${(a-b)(a-c)}-{(b-c)(c-b)}={a^2+b^2+c^2}-{ab-bc-ca,}$ so $D$ is ${a+b+c}$ times this expression, which proves the formula.
The second factor equals
${\frac{1}{2}\left((a-b)^2+(b-c)^2+(c-a)^2\right),}$
so it is never negative, and it is 0 only when ${a=b=c}.$ Multiplying out the whole product gives ${a^3+b^3+c^3-3abc}.$
Problem 9. Prove that $\begin{vmatrix}1&1&1\\a&b&c\\a^2&b^2&c^2\end{vmatrix}=(b-a)(c-a)(c-b).$
Solution: Let $D$ be the determinant on the left. The operations ${C_2\to C_2-C_1}$ and ${C_3\to C_3-C_1}$ make two zeros in row 1:
$$D=\begin{vmatrix}1&0&0\\a&b-a&c-a\\a^2&b^2-a^2&c^2-a^2\end{vmatrix}$$We expand along row 1:
$$=\begin{vmatrix}b-a&c-a\\b^2-a^2&c^2-a^2\end{vmatrix}$$Since ${b^2-a^2=(b-a)(b+a)}$ and ${c^2-a^2=(c-a)(c+a)},$ we take ${b-a}$ out of column 1 and ${c-a}$ out of column 2:
$$=(b-a)(c-a)\begin{vmatrix}1&1\\b+a&c+a\end{vmatrix}$$$={(b-a)(c-a)(c+a-b-a)}={(b-a)(c-a)(c-b)}$
This is the Vandermonde determinant. It is 0 exactly when two of the numbers $a,$ $b$ and $c$ are equal.
Practice problems
Try first, then open the answer.
1. Calculate $\begin{vmatrix}7&3\\2&1\end{vmatrix}.$
${7\cdot1-3\cdot2=1}$
2. Calculate $\begin{vmatrix}5&-2\\3&4\end{vmatrix}.$
${5\cdot4-(-2)\cdot3=26}$
3. Calculate $\begin{vmatrix}2&1&3\\0&-1&4\\1&2&1\end{vmatrix}$ by Sarrus' rule.
${-2+4+0+3-16-0}={-11}$
4. Find the cofactors $C_{21}$ and $C_{32}$ of the matrix $\begin{pmatrix}1&2&3\\4&5&6\\7&8&10\end{pmatrix}.$
$C_{21}=-\begin{vmatrix}2&3\\8&10\end{vmatrix}=-(20-24)=4$ and $C_{32}=-\begin{vmatrix}1&3\\4&6\end{vmatrix}=-(6-12)=6.$
5. Calculate $\begin{vmatrix}3&0&2\\1&0&5\\4&2&-1\end{vmatrix}$ by expansion along column 2.
Only the entry ${a_{32}=2}$ is not 0: $2\cdot(-1)^{3+2}\begin{vmatrix}3&2\\1&5\end{vmatrix}=-2\cdot13=-26.$
6. Explain without calculating why $\begin{vmatrix}2&4&6\\1&5&3\\3&6&9\end{vmatrix}=0.$
Column 3 is column 1 multiplied by 3. A determinant with two proportional columns is 0.
7. Calculate $\begin{vmatrix}3&1&-2&7\\0&-2&5&1\\0&0&1&4\\0&0&0&5\end{vmatrix}.$
The matrix is triangular, so the determinant is the product of the diagonal entries: ${3\cdot(-2)\cdot1\cdot5=-30}.$
8. $A$ is a 4×4 matrix with ${\det A=2}.$ Find ${\det(3A)},$ ${\det A^T},$ ${\det(A^{-1})}$ and ${\det(A^3)}.$
${\det(3A)=3^4\cdot2=162},$ ${\det A^T=2},$ ${\det(A^{-1})=\frac{1}{2}}$ and ${\det(A^3)=2^3=8}.$
9. Solve the equation $\begin{vmatrix}1&2&3\\0&x&4\\0&0&x-2\end{vmatrix}=0.$
The determinant is triangular and equals ${1\cdot x\cdot(x-2)}.$ It is 0 for ${x=0}$ and for ${x=2}.$
10. Calculate $\begin{vmatrix}1&2&0&1\\2&5&1&3\\-1&0&3&1\\3&6&1&5\end{vmatrix}.$
${R_2\to R_2-2R_1},$ ${R_3\to R_3+R_1},$ ${R_4\to R_4-3R_1},$ then ${R_3\to R_3-2R_2}$ and ${R_4\to R_4-R_3}$ give a triangular determinant with the diagonal 1, 1, 1, 2. The answer is 2.
You can check your own examples with the matrix calculator. It calculates determinants with all the steps: by Sarrus' rule, by cofactor expansion along any row or column, or by Gaussian elimination.

MENU
Matrices and Vectors