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.
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.
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
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
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
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:
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.
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.
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
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
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
Check by expanding along the first column. Only the top entry can contribute, and the resulting minor has a zero first column:
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:
Confirm that the matrix is square and every entry below the main diagonal is zero.
Write down the entries from top left to bottom right, including any zeros and negative values.
Show intermediate products so that the sign and arithmetic can be checked.
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.
- Evaluate \(\det\begin{bmatrix}-3&2\\0&5\end{bmatrix}\), and check with the two-by-two formula.
- Evaluate \(\det\begin{bmatrix}2&1&-4\\0&-1&3\\0&0&6\end{bmatrix}\) by the diagonal-product rule.
- For an upper-triangular matrix with diagonal entries \(4,0,-3,2\), what is its determinant? State the reason.
- In a cofactor expansion along the first column of an upper-triangular matrix, which terms can be nonzero?
- Explain why a matrix with a nonzero entry below its diagonal cannot be evaluated by this upper-triangular rule alone.