Tutorials › Linear Algebra › Using Row Reduction To Compute Determinants

Properties of Determinants · Tutorial 242 of 1000

Using Row Reduction To Compute Determinants

Use elimination to find a determinant efficiently without losing track of the sign or scale changes caused by row operations.

Intermediate 10 min read

What You'll Learn

  • State how swaps, nonzero row scalings, and row replacements affect a determinant.
  • Reduce a square matrix to upper triangular form using valid pivots.
  • Keep a determinant ledger and use it to recover the original determinant.
  • Compute determinants when a pivot column has no available nonzero entry.
  • Check a row-reduction result against a cofactor expansion.

Why Row Reduction Helps

Cofactor expansion can become lengthy as a matrix grows, especially when many entries are nonzero. Row reduction offers another route: convert a square matrix to upper triangular form, where the determinant is the product of the diagonal entries, while keeping track of how each row operation changes the determinant. The reduction is useful only if that bookkeeping is accurate; the triangular matrix alone does not generally have the same determinant as the original.

Throughout, matrices are square matrices over \(\mathbb{R}\). An upper triangular matrix is a matrix whose entries below the main diagonal are all zero. For example, the entry in row \(i\), column \(j\) must be zero whenever \(i>j\). The three elementary row operations are swapping two rows, multiplying one row by a nonzero scalar, and adding a multiple of one row to another. Their determinant effects are different.

Determinant effects of row operations: Swapping two rows multiplies the determinant by \(-1\). Multiplying a row by a nonzero scalar \(c\) multiplies the determinant by \(c\). Replacing \(R_i\) by \(R_i+cR_j\), where \(i\ne j\), leaves the determinant unchanged. These rules follow from the determinant’s alternating and multilinear properties in its rows.

In particular, a row replacement is not a scaling: it leaves the determinant unchanged even when the added multiple is large. A row scaling has an effect that must be reversed when recovering the original determinant. We will record each operation as it is performed instead of trying to reconstruct the changes at the end.

The Triangular Form and the Bookkeeping Rule

Theorem: If \(\mathbf{U}\in\mathbb{R}^{n\times n}\) is upper triangular, then \(\det\mathbf{U}=u_{11}u_{22}\cdots u_{nn}\).

Proof. By the Leibniz formula, \(\det\mathbf{U}\) is a sum over permutations \(\pi\) of \(\{1,\dots,n\}\). A term can be nonzero only if every factor \(u_{i,\pi(i)}\) is not below the diagonal, so \(\pi(i)\ge i\) for every \(i\). But \(\sum_{i=1}^n\pi(i)=\sum_{i=1}^n i\), since \(\pi\) is a permutation. Therefore the nonnegative differences \(\pi(i)-i\) sum to zero, which forces \(\pi(i)=i\) for every \(i\). Only the identity permutation can contribute, and its term is \(u_{11}u_{22}\cdots u_{nn}\). This argument also covers a zero diagonal entry: in that case the sole possible term is zero. \(\square\)

The row-operation effects give a compact rule for the full reduction. Suppose a sequence of row operations changes \(\mathbf{A}\) into an upper triangular matrix \(\mathbf{U}\). Let \(s\) be the number of swaps, and let \(q_1,\dots,q_m\) be the nonzero scalars used in row scalings. Row replacements contribute no factor. Then

$$ \det\mathbf{U}=(-1)^s(q_1\cdots q_m)\det\mathbf{A}. $$
Determinant recovery rule: After reducing \(\mathbf{A}\) to upper triangular form, compute \(\det\mathbf{U}\) as the product of its diagonal entries, then divide by the total factor \((-1)^s(q_1\cdots q_m)\) to obtain \(\det\mathbf{A}\).

Proof. The formula follows by applying the stated determinant effect at each step. A swap contributes a factor of \(-1\), a scaling by \(q_j\) contributes \(q_j\), and every row replacement contributes \(1\). Multiplying these factors in sequence gives \(\det\mathbf{U}=(-1)^s(q_1\cdots q_m)\det\mathbf{A}\). Each scaling factor is nonzero, so division by the total factor is valid. The triangular determinant theorem then supplies \(\det\mathbf{U}\) from the diagonal. \(\square\)

Row reduction can be arranged to reach upper triangular form without dividing by zero. Scan columns from left to right, keeping track of the next row in which a pivot can be placed. If that column has a nonzero entry in or below that row, swap one such entry into the pivot position and use row replacements to make the entries beneath it zero. If the column has no such entry, leave it and continue to the next column. The column is already zero from the active pivot row downward. This process produces zeros below the diagonal, even when some columns are skipped.

Worked Reductions

Worked Example: A Swap Changes the Sign

Compute the determinant of \(\mathbf{A}=\begin{bmatrix}0&2&1\\1&1&0\\2&3&4\end{bmatrix}\) by row reduction.

The first entry is zero, so swap rows 1 and 2 to obtain a nonzero first pivot. This swap reverses the sign of the determinant. Then use row replacements to clear the entries below the first and second pivots:

$$ \begin{bmatrix}0&2&1\\1&1&0\\2&3&4\end{bmatrix} \xrightarrow{R_1\leftrightarrow R_2} \begin{bmatrix}1&1&0\\0&2&1\\2&3&4\end{bmatrix} \xrightarrow{R_3\to R_3-2R_1} \begin{bmatrix}1&1&0\\0&2&1\\0&1&4\end{bmatrix} \xrightarrow{R_3\to R_3-\frac12R_2} \begin{bmatrix}1&1&0\\0&2&1\\0&0&\frac72\end{bmatrix}. $$

The final matrix is upper triangular, so its determinant is \(1\cdot2\cdot\frac72=7\). There was one swap and no scaling, so \(\det\mathbf{U}=-\det\mathbf{A}\). Hence \(\det\mathbf{A}=-7\).

Check: Expanding the original matrix along its first row gives \(\det\mathbf{A}=-2(4-0)+(3-2)=-8+1=-7\), in agreement with the reduction.

Worked Example: A Row Scaling Must Be Reversed

Compute the determinant of \(\mathbf{A}=\begin{bmatrix}2&4&2\\1&3&5\\3&2&1\end{bmatrix}\). Scale the first row by \(\frac12\), then use row replacements to eliminate entries beneath the pivots:

$$ \begin{bmatrix}2&4&2\\1&3&5\\3&2&1\end{bmatrix} \xrightarrow{R_1\to\frac12R_1} \begin{bmatrix}1&2&1\\1&3&5\\3&2&1\end{bmatrix} \xrightarrow[\ R_3\to R_3-3R_1\ ]{R_2\to R_2-R_1} \begin{bmatrix}1&2&1\\0&1&4\\0&-4&-2\end{bmatrix} \xrightarrow{R_3\to R_3+4R_2} \begin{bmatrix}1&2&1\\0&1&4\\0&0&14\end{bmatrix}. $$

The two row replacements do not change the determinant. The first row was scaled by \(\frac12\), so \(\det\mathbf{U}=\frac12\det\mathbf{A}\). The triangular determinant is \(1\cdot1\cdot14=14\). Therefore \(\det\mathbf{A}=2\cdot14=28\).

Check: Expansion along the first row of the original matrix gives \(2(3-10)-4(1-15)+2(2-9)=-14+56-14=28\). The scale factor has been reversed correctly.

Worked Example: When a Pivot Column Has No Pivot

Compute the determinant of \(\mathbf{A}=\begin{bmatrix}1&2&0\\2&4&1\\3&6&5\end{bmatrix}\). First clear the entries below the first pivot:

$$ \begin{bmatrix}1&2&0\\2&4&1\\3&6&5\end{bmatrix} \xrightarrow[\ R_3\to R_3-3R_1\ ]{R_2\to R_2-2R_1} \begin{bmatrix}1&2&0\\0&0&1\\0&0&5\end{bmatrix} \xrightarrow{R_3\to R_3-5R_2} \begin{bmatrix}1&2&0\\0&0&1\\0&0&0\end{bmatrix}. $$

In column 2, the entries in rows 2 and 3 are both zero, so there is no pivot available in that column. Do not divide by a zero pivot. Move to column 3 instead; the entry in row 2 is \(1\), and the final row replacement clears the entry beneath it. The resulting matrix is upper triangular, with diagonal entries \(1,0,0\). All operations were row replacements, so the determinant was unchanged. Thus \(\det\mathbf{A}=1\cdot0\cdot0=0\).

Check: Cofactor expansion along the first row of the original matrix gives \((4\cdot5-1\cdot6)-2(2\cdot5-1\cdot3)=14-14=0\).

Common Pitfalls

Forgetting a swap changes the sign. In the first example, the upper triangular matrix has diagonal product \(7\). A tempting but incorrect calculation is to report \(\det\mathbf{A}=7\), as though all row operations preserve determinants. The correction is to record the swap: \(\det\mathbf{U}=-\det\mathbf{A}\), so the original determinant is \(-7\).

Do not treat a row scaling as a row replacement. In the second example, the final determinant \(14\) belongs to a matrix whose first row was scaled by \(\frac12\). It is therefore \(\frac12\det\mathbf{A}\), not \(\det\mathbf{A}\). Recovering the original determinant requires multiplying \(14\) by \(2\).

A zero pivot is not permission to divide by zero. If no nonzero entry can be moved into the active pivot position from below, skip that column and continue. A zero diagonal entry in the resulting upper triangular matrix makes the determinant zero; the triangular determinant theorem justifies that conclusion without any division.

A useful ledger is a short record written beside the matrix: count the swaps, list every row-scaling factor, and mark row replacements as determinant-preserving. When no row scaling is used, the only correction needed after multiplying the diagonal is the sign \((-1)^s\). When scalings are used, include their product as well.

Check Your Understanding

For each question, keep a determinant ledger and justify the final diagonal product.

  1. Reduce \(\begin{bmatrix}0&1\\2&3\end{bmatrix}\) to upper triangular form and compute its determinant, recording the swap.
  2. Suppose a reduction uses two swaps and scales one row by \(3\), with all other operations being row replacements. If the final triangular determinant is \(-18\), what was the original determinant?
  3. Explain why a column with no nonzero entry at or below the active pivot row should be skipped rather than used as a pivot.
  4. Reduce \(\begin{bmatrix}1&2&1\\2&4&3\\0&1&1\end{bmatrix}\) to upper triangular form and track the determinant through each operation.
  5. State why the determinant of an upper triangular matrix is the product of its diagonal entries, including the case in which a diagonal entry is zero.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon