Tutorials › Linear Algebra › Evaluating Upper-Triangular Determinants

Determinants by Cofactor Expansion · Tutorial 222 of 1000

Evaluating Upper-Triangular Determinants

Use the diagonal entries to calculate upper-triangular determinants efficiently, and check the calculation by cofactor expansion.

Beginner 9 min read

What You'll Learn

  • Identify an upper-triangular matrix from its entries
  • Evaluate its determinant by multiplying its diagonal entries
  • Track signs and intermediate products in exact arithmetic
  • Check a determinant calculation with cofactor expansion
  • Recognize what a zero diagonal entry implies
  • Correct a common mistake involving entries above the diagonal

Read the Shape Before Calculating

For a general square matrix, cofactor expansion can involve several minors and signs. An upper-triangular matrix has a simpler structure: every entry below its main diagonal is zero. Its entries above the diagonal may be nonzero, but they do not add extra terms to the determinant. Once the shape is identified, the determinant can be evaluated with a short product, then checked by expanding along a suitable column.

All matrices in this tutorial have real entries. For an \(n\times n\) matrix, the main diagonal consists of the entries in positions \((1,1),(2,2),\dots,(n,n)\). The condition “below the diagonal” means \(i>j\), where \(i\) is the row number and \(j\) is the column number.

Definition: A square matrix \(\mathbf{A}=(a_{ij})\in\mathbb{R}^{n\times n}\) is upper triangular if \(a_{ij}=0\) whenever \(i>j\). Its diagonal entries are \(a_{11},a_{22},\dots,a_{nn}\); entries with \(i<j\) may be zero or nonzero.

For example, \(\begin{bmatrix}2&-1&3\\0&4&5\\0&0&-2\end{bmatrix}\) is upper triangular: its entries below the diagonal are all zero. The values \(-1,3,5\) above the diagonal do not change that classification. By contrast, a nonzero entry in position \((3,1)\) would mean the matrix is not upper triangular.

The Evaluation Rule

The result established in the earlier material on triangular determinants is that the determinant of a triangular matrix is the product of its diagonal entries. Applying it to an upper-triangular matrix gives the rule below. The rule works for any size \(n\geq 1\), including matrices with zero or negative diagonal entries.

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

In practice, first check that the matrix is square and that every entry below the diagonal is zero. Then list the diagonal entries in order and multiply them. Keep the signs: a negative diagonal entry contributes a negative factor, and two negative factors have a positive product. A zero diagonal entry makes the entire product zero.

Worked Example: A Two-by-Two Matrix

Evaluate the determinant of \(\mathbf{A}=\begin{bmatrix}5&-3\\0&2\end{bmatrix}\). The entry below the diagonal is zero, so the matrix is upper triangular. Its diagonal entries are \(5\) and \(2\), giving

$$ \det\mathbf{A}=5\cdot2=10. $$

Check by the two-by-two determinant formula: for \(\begin{bmatrix}a&b\\c&d\end{bmatrix}\), the determinant is \(ad-bc\). Here \(a=5\), \(b=-3\), \(c=0\), and \(d=2\), so

$$ \det\mathbf{A}=(5)(2)-(-3)(0)=10-0=10. $$

The direct calculation agrees with the diagonal product.

Worked Example: A Three-by-Three Matrix and a Cofactor Check

Evaluate \(\det\mathbf{B}\) for \(\mathbf{B}=\begin{bmatrix}2&-1&3\\0&4&5\\0&0&-2\end{bmatrix}\). The entries below the diagonal are \(0,0,0\), and the diagonal entries are \(2,4,-2\). Thus

$$ \det\mathbf{B}=2\cdot4\cdot(-2)=8\cdot(-2)=-16. $$

To check with cofactor expansion, expand along the first column. The first-column entries are \(2,0,0\), so the terms involving the second and third entries are zero. The surviving term is the entry \(2\), with positive cofactor sign, times the determinant obtained by deleting row 1 and column 1:

$$ \det\mathbf{B} =2\det\begin{bmatrix}4&5\\0&-2\end{bmatrix} =2\bigl((4)(-2)-(5)(0)\bigr) =2(-8) =-16. $$

The cofactor calculation confirms the diagonal product. In particular, the nonzero entries above the diagonal did not supply extra terms in this expansion: the zeros below the first diagonal entry removed those terms.

Why the First-Column Check Works

The cofactor expansion used above is useful for checking upper-triangular determinants of any size. In the first column, all entries except the top one are zero. Moreover, after deleting the first row and first column, the remaining matrix is again upper triangular: any entry below its diagonal came from an entry below the original diagonal, which is zero.

Proposition: If \(\mathbf{A}\in\mathbb{R}^{n\times n}\) is upper triangular with \(n\geq2\), and \(\mathbf{C}\) is the \((n-1)\times(n-1)\) matrix obtained by deleting the first row and first column of \(\mathbf{A}\), then \(\det\mathbf{A}=a_{11}\det\mathbf{C}\). The matrix \(\mathbf{C}\) is upper triangular.

Proof. In column 1 of \(\mathbf{A}\), the entry in row 1 is \(a_{11}\), and every entry in a row \(i>1\) is zero by upper triangularity. Cofactor expansion along column 1 therefore has only its first term remaining. Its cofactor sign is \((-1)^{1+1}=1\), and its minor is \(\mathbf{C}\), so \(\det\mathbf{A}=a_{11}\det\mathbf{C}\). To check the shape of \(\mathbf{C}\), its entry in row \(r\), column \(s\) comes from row \(r+1\), column \(s+1\) of \(\mathbf{A}\). If \(r>s\), then \(r+1>s+1\), so that entry of \(\mathbf{A}\) is zero. Hence every entry of \(\mathbf{C}\) below its diagonal is zero, and \(\mathbf{C}\) is upper triangular. \(\square\)

This proposition explains the cofactor check without requiring a full expansion across a row that contains several nonzero entries. Repeating the first-column expansion on each smaller upper-triangular minor exposes one diagonal factor at a time. The earlier result on triangular determinants packages that repeated computation as the diagonal-product rule.

Corollary: If an upper-triangular matrix has at least one zero diagonal entry, its determinant is zero.

Proof. By the diagonal-product rule, the determinant is the product of all diagonal entries. If one of those factors is zero, the whole product is zero. \(\square\)

Worked Example: A Four-by-Four Matrix

Evaluate \(\det\mathbf{D}\) for \(\mathbf{D}=\begin{bmatrix}1&2&-1&3\\0&-2&4&1\\0&0&3&5\\0&0&0&4\end{bmatrix}\). Each entry below the diagonal is zero. The diagonal entries, in order, are \(1,-2,3,4\). Multiplying one step at a time gives

$$ \det\mathbf{D} =1\cdot(-2)\cdot3\cdot4 =(-2)\cdot3\cdot4 =(-6)\cdot4 =-24. $$

Cofactor check: expansion along the first column leaves the top entry \(1\) times the determinant of the lower-right three-by-three minor. Expand that minor along its first column; its only nonzero entry in that column is \(-2\). The remaining two-by-two determinant is \(3\cdot4-5\cdot0=12\). Therefore

$$ \det\mathbf{D} =1\cdot\left((-2)\cdot\det\begin{bmatrix}3&5\\0&4\end{bmatrix}\right) =1\cdot\bigl((-2)((3)(4)-(5)(0))\bigr) =1\cdot((-2)(12)) =-24. $$

This check reaches the same result while retaining the intermediate minors and their signs.

Zero and Negative Diagonal Entries

The diagonal-product rule handles zero and negative values directly; neither requires a different method. A zero factor makes the determinant zero. With negative factors, count the sign of the product as you multiply, rather than dropping signs and trying to restore them at the end.

Worked Example: A Zero on the Diagonal

Let \(\mathbf{E}=\begin{bmatrix}3&1&-4\\0&0&7\\0&0&-2\end{bmatrix}\). This is upper triangular, and the diagonal entries are \(3,0,-2\). Thus

$$ \det\mathbf{E}=3\cdot0\cdot(-2)=0. $$

Check by expanding along the first column. Only the top entry can contribute, and the resulting minor has a zero first column:

$$ \det\mathbf{E} =3\det\begin{bmatrix}0&7\\0&-2\end{bmatrix} =3\bigl((0)(-2)-(7)(0)\bigr) =3(0) =0. $$

The check agrees with the product and illustrates why a zero diagonal entry forces a zero determinant.

Common Mistake: Multiplying Entries Above the Diagonal

A common incorrect calculation is to multiply the diagonal entries and then also include entries above the diagonal. For instance, for \(\mathbf{B}=\begin{bmatrix}2&-1&3\\0&4&5\\0&0&-2\end{bmatrix}\), the diagonal entries give \(-16\). Multiplying every nonzero entry instead gives \(2\cdot(-1)\cdot3\cdot4\cdot5\cdot(-2)=240\), which is not the determinant. The above-diagonal entries are not factors in the rule.

The correction is to check the defining shape and select only the entries \(a_{11},a_{22},\dots,a_{nn}\). Here the answer is \(2\cdot4\cdot(-2)=-16\), confirmed by the first-column cofactor expansion. Another error is to overlook a negative sign: \(2\cdot4\cdot(-2)\) is \(-16\), not \(16\). Writing the intermediate product \(8\cdot(-2)\) makes the sign explicit.

A Reliable Calculation Routine

For an upper-triangular determinant, use a short sequence of checks rather than expanding every row or column:

1
Check the shape.
Confirm that the matrix is square and every entry below the main diagonal is zero.
2
Read the diagonal.
Write down the entries from top left to bottom right, including any zeros and negative values.
3
Multiply exactly.
Show intermediate products so that the sign and arithmetic can be checked.
4
Check by cofactor expansion when useful.
The first column has zeros below its first entry, so its expansion reduces to that entry times a smaller upper-triangular determinant.

The shape check matters: a matrix with a nonzero entry below the diagonal is not covered by this rule. The product of its diagonal entries may still be easy to calculate, but it does not, on its own, evaluate that matrix’s determinant.

Check Your Understanding

For each question, identify the diagonal entries before calculating. Where requested, verify the result using cofactor expansion.

  1. Evaluate \(\det\begin{bmatrix}-3&2\\0&5\end{bmatrix}\), and check with the two-by-two formula.
  2. Evaluate \(\det\begin{bmatrix}2&1&-4\\0&-1&3\\0&0&6\end{bmatrix}\) by the diagonal-product rule.
  3. For an upper-triangular matrix with diagonal entries \(4,0,-3,2\), what is its determinant? State the reason.
  4. In a cofactor expansion along the first column of an upper-triangular matrix, which terms can be nonzero?
  5. Explain why a matrix with a nonzero entry below its diagonal cannot be evaluated by this upper-triangular rule alone.

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