Skip to content
VidiMaster it, module by module
Module 2/Determinants

Computing Determinants: Row Reduction & Cofactors

Two reliable ways to compute the determinant of a square matrix: row-reduce to triangular form and multiply the pivots, or expand in cofactors along a convenient row or column. Includes the exact rules for how each elementary row operation changes the value, and why det⁡(A)≠0\det(A)\neq 0 means AA is invertible.

Before you start — give these a try

Attempting first primes your brain for the lesson — even if you miss. Nothing is graded or saved; it's just a warm-up.

Compute det⁡(A)\det(A) for A=[210131012]A=\begin{bmatrix} 2&1&0 \\ 1&3&1 \\ 0&1&2 \end{bmatrix} by cofactor expansion along the first row.

Compute det⁡(A)\det(A) for the upper-triangular matrix A=[35−270−14100260005]A=\begin{bmatrix} 3&5&-2&7 \\ 0&-1&4&1 \\ 0&0&2&6 \\ 0&0&0&5 \end{bmatrix}.

What you’ll be able to do

  • Compute 2×22\times 2 and 3×33\times 3 determinants directly and by cofactor (Laplace) expansion.
  • Reduce a matrix to triangular form with elementary row operations and read off its determinant as the product of the pivots.
  • State and apply Theorem 6.1: how scaling a row, adding a multiple of one row to another, and swapping two rows each affect the determinant.
  • Compute minors and cofactors (Definition 6.2) and expand the determinant along any row or column (Proposition 6.2).
  • Use det⁡(A)=0\det(A)=0 to detect singular matrices and connect det⁡(A)≠0\det(A)\neq 0 with invertibility (Theorem 6.2).

In your course

· MATH2015 · Linear Algebra & Probability
§6.1 The determinant function§6.2 Properties of determinant
  • Definition 6.1The determinant function
    A function det⁡:Rn×n→R\det:\mathbb{R}^{n\times n}\to\mathbb{R} with (D1) det⁡(In)=1\det(I_n)=1, (D2) linearly dependent rows give 00, and (D3) linearity in each row.
  • Theorem 6.1Effect of elementary row operations on determinants
    Scaling a row by λ\lambda scales det⁡\det by λ\lambda; adding a multiple of one row to another leaves det⁡\det unchanged; swapping two rows negates det⁡\det.
  • Proposition 6.1Determinant of a triangular matrix
    det⁡\det equals the product of the diagonal entries.
  • Theorem 6.2Determinant and invertibility
    det⁡(A)=0  ⟺  rank⁡(A)<n  ⟺  A\det(A)=0 \iff \operatorname{rank}(A)<n \iff A is not invertible.
  • Definition 6.2Minors and cofactors
    Minor =det⁡(Aij)=\det(A_{ij}); cofactor =(−1)i+jdet⁡(Aij)=(-1)^{i+j}\det(A_{ij}), where AijA_{ij} deletes row ii and column jj.
  • Definition 6.3Expansion along the first row
    det⁡(A)=∑j=1n(−1)j+1a1jdet⁡(A1j)\det(A)=\sum_{j=1}^{n}(-1)^{j+1}a_{1j}\det(A_{1j}).
  • Proposition 6.2Laplace (cofactor) expansion
    det⁡(A)\det(A) may be expanded along any row or down any column.
  • Example 6.1A 4x4 determinant by row reduction
    Reducing to triangular form with one row swap gives det⁡=(−1)(1)(−1)(2)(2)=4\det=(-1)(1)(-1)(2)(2)=4.
The Rule of Sarrus (Remark 6.1) is a shortcut for 3×33\times 3 determinants only. Since det⁡(AT)=det⁡(A)\det(A^{T})=\det(A) (Theorem 6.5), every row property has a matching column property (Proposition 6.3). Grounded in the MATH2015 notes, Chapter 6.
1

The determinant as a volume-like function

For a 2×22\times 2 matrix A=[abcd]A=\begin{bmatrix} a & b \\ c & d \end{bmatrix} the determinant is det⁡(A)=ad−bc\det(A)=ad-bc, and AA is invertible exactly when ad−bc≠0ad-bc\neq 0. Up to sign, ∣det⁡(A)∣|\det(A)| is the area of the parallelogram spanned by the rows (a volume in higher dimensions). Definition 6.1 pins down the general det⁡:Rn×n→R\det:\mathbb{R}^{n\times n}\to\mathbb{R} by three properties: (D1) det⁡(In)=1\det(I_n)=1; (D2) linearly dependent rows give det⁡=0\det=0; (D3) the determinant is linear in each row separately. Everything else in the chapter is derived from these.

2

Computing by row reduction

Theorem 6.1 says how the three elementary row operations act on det⁡\det: multiplying a row by λ\lambda multiplies det⁡\det by λ\lambda; adding a multiple of one row to another leaves det⁡\det unchanged; swapping two rows flips the sign. So run Gaussian elimination to reach a triangular matrix, tracking only the swaps (each contributes a factor −1-1) and any deliberate row scalings. By Proposition 6.1 the determinant of the triangular result is the product of its diagonal entries, so det⁡(A)=(−1)s⋅(product of pivots)\det(A)=(-1)^{s}\cdot(\text{product of pivots}), where ss is the number of swaps. If a zero row appears, the rows are dependent and det⁡(A)=0\det(A)=0.

3

Minors, cofactors, and Laplace expansion

Deleting row ii and column jj of an n×nn\times n matrix AA leaves an (n−1)×(n−1)(n-1)\times(n-1) matrix AijA_{ij}. Its determinant det⁡(Aij)\det(A_{ij}) is the minor, and Cij=(−1)i+jdet⁡(Aij)C_{ij}=(-1)^{i+j}\det(A_{ij}) is the cofactor (Definition 6.2). The sign (−1)i+j(-1)^{i+j} follows the checkerboard pattern [+−+−+−+−+]\begin{bmatrix} + & - & + \\ - & + & - \\ + & - & + \end{bmatrix}. Definition 6.3 expands along the first row, and Proposition 6.2 (Laplace expansion) generalizes it: det⁡(A)=∑j=1n(−1)i+jaijdet⁡(Aij)\det(A)=\sum_{j=1}^{n}(-1)^{i+j}a_{ij}\det(A_{ij}) along any row ii, or the analogous sum down any column jj. Choose the row or column with the most zeros to save work.

4

Which method, and the Rule of Sarrus

For 3×33\times 3 matrices the Rule of Sarrus (Remark 6.1) is a quick shortcut: det⁡(A)=a11a22a33+a12a23a31+a13a21a32−a13a22a31−a11a23a32−a12a21a33\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}. It applies only to 3×33\times 3. For larger matrices, row reduction is usually fastest, while cofactor expansion shines when a row or column is mostly zeros. Because det⁡(AT)=det⁡(A)\det(A^{T})=\det(A) (Theorem 6.5), every row rule has an identical column version (Proposition 6.3).

Theorem 6.1 — Effect of elementary row operations on determinants

Let A=(r1,…,rn)A=(r_1,\dots,r_n) with rows rir_i. (1) Multiplying a row by λ∈R\lambda\in\mathbb{R} multiplies the determinant by λ\lambda: det⁡(r1,…,λri,…,rn)=λdet⁡(r1,…,ri,…,rn)\det(r_1,\dots,\lambda r_i,\dots,r_n)=\lambda\det(r_1,\dots,r_i,\dots,r_n). (2) Adding λ\lambda times one row to another does not change the determinant. (3) Interchanging two rows reverses the sign of the determinant.

Intuition. These three rules let you carry a determinant through Gaussian elimination. Only swaps (sign flips) and deliberate row scalings change the value; the workhorse 'add a multiple of another row' operations are free. Part (2) follows from linearity (D3) together with (D2): the extra term has two proportional rows, so its determinant is 00.
Proposition 6.1 — Determinant of a triangular matrix

If AA is upper- or lower-triangular, then det⁡(A)\det(A) equals the product of its diagonal entries: det⁡(A)=a11a22⋯ann\det(A)=a_{11}a_{22}\cdots a_{nn}.

Intuition. This is the payoff of row reduction: once you reach triangular form, just multiply the diagonal. It holds because a triangular matrix either has a zero on the diagonal (dependent rows, so det⁡=0\det=0) or reduces to the identity by type-2 operations that never change the determinant, starting from det⁡(In)=1\det(I_n)=1.
Proposition 6.2 — Laplace (cofactor) expansion

For an n×nn\times n matrix AA the determinant may be expanded along any row ii or down any column jj: along row ii, det⁡(A)=∑j=1n(−1)i+jaijdet⁡(Aij)\det(A)=\sum_{j=1}^{n}(-1)^{i+j}a_{ij}\det(A_{ij}); down column jj, det⁡(A)=∑i=1n(−1)i+jaijdet⁡(Aij)\det(A)=\sum_{i=1}^{n}(-1)^{i+j}a_{ij}\det(A_{ij}), where AijA_{ij} is AA with row ii and column jj deleted.

Intuition. Definition 6.3 is the special case of expanding along the first row; this result says any row or column gives the same answer. Pick the one with the most zeros, since each zero entry removes a whole (n−1)×(n−1)(n-1)\times(n-1) minor. Do not forget the alternating sign (−1)i+j(-1)^{i+j}.
Theorem 6.2 — Determinant and invertibility

For A∈Rn×nA\in\mathbb{R}^{n\times n}: det⁡(A)=0  ⟺  rank⁡(A)<n  ⟺  dim⁡ker⁡(A)>0  ⟺  \det(A)=0 \iff \operatorname{rank}(A)<n \iff \dim\ker(A)>0 \iff the rows (equivalently the columns) are linearly dependent. Equivalently, det⁡(A)≠0  ⟺  rank⁡(A)=n  ⟺  ker⁡(A)={0}  ⟺  A\det(A)\neq 0 \iff \operatorname{rank}(A)=n \iff \ker(A)=\{0\} \iff A is invertible.

Intuition. The determinant is a single number that detects singularity. A nonzero determinant certifies full rank, trivial kernel, independent rows and columns, and the existence of an inverse all at once — which is why it is so useful for small systems and for the eigenvalue computations of the next chapter.

Worked examples

Example 1

Example 6.1. Compute det⁡(A)\det(A) for A=[1200122423120214]A=\begin{bmatrix} 1&2&0&0 \\ 1&2&2&4 \\ 2&3&1&2 \\ 0&2&1&4 \end{bmatrix} by reducing to triangular form.

  1. 1

    Apply R2→R2−R1R_2\to R_2-R_1 and R3→R3−2R1R_3\to R_3-2R_1 (type-2 operations, determinant unchanged): [120000240−1120214]\begin{bmatrix} 1&2&0&0 \\ 0&0&2&4 \\ 0&-1&1&2 \\ 0&2&1&4 \end{bmatrix}.

  2. 2

    Swap R2↔R3R_2\leftrightarrow R_3 to bring a nonzero pivot to position (2,2)(2,2). A swap multiplies the determinant by −1-1: [12000−11200240214]\begin{bmatrix} 1&2&0&0 \\ 0&-1&1&2 \\ 0&0&2&4 \\ 0&2&1&4 \end{bmatrix}.

  3. 3

    Apply R4→R4+2R2R_4\to R_4+2R_2 (type-2, unchanged): [12000−11200240038]\begin{bmatrix} 1&2&0&0 \\ 0&-1&1&2 \\ 0&0&2&4 \\ 0&0&3&8 \end{bmatrix}.

  4. 4

    Apply R4→R4−32R3R_4\to R_4-\tfrac{3}{2}R_3 (type-2, unchanged): [12000−11200240002]\begin{bmatrix} 1&2&0&0 \\ 0&-1&1&2 \\ 0&0&2&4 \\ 0&0&0&2 \end{bmatrix}.

  5. 5

    By Proposition 6.1 the triangular determinant is the product of the diagonal, and we performed one swap, so det⁡(A)=(−1)⋅(1)(−1)(2)(2)=(−1)(−4)=4\det(A)=(-1)\cdot(1)(-1)(2)(2)=(-1)(-4)=4.

Answer. det⁡(A)=4\det(A)=4.
Example 2

Compute det⁡(A)\det(A) for A=[201304152]A=\begin{bmatrix} 2&0&1 \\ 3&0&4 \\ 1&5&2 \end{bmatrix} using cofactor expansion.

Example 3

Suppose AA is a 3×33\times 3 matrix with det⁡(A)=6\det(A)=6. A matrix BB is built from AA by (i) multiplying row 1 by 33, then (ii) swapping rows 2 and 3, then (iii) adding 44 times row 1 to row 2. Find det⁡(B)\det(B).