Euler Hall — free maths guides

Multiply the diagonal entries of a triangular matrix

Recognise whether a matrix is upper triangular, lower triangular, or neither. The idea in plain words, a worked example, and a check with the answers shown — part of the free Linear Algebra guides.

Product, not sum

A matrix is upper triangular if everything below the main diagonal is zero, and lower triangular if everything above it is zero. Either way it is triangular, and

det⁡A=a11a22⋯ann.\det A=a_{11}a_{22}\cdots a_{nn}.

det⁡[2310−14002]=2⋅(−1)⋅2=−4.\det\begin{bmatrix}2&3&1\\ 0&-1&4\\ 0&0&2\end{bmatrix}=2\cdot(-1)\cdot 2=-4.

Three numbers to multiply, no expansion, no signs to track. The diagonal is allowed to contain negatives and the product keeps their sign: two negatives give a positive, three give a negative.

Two things this is not:

  • - It is not the sum of the diagonal. That sum is the trace,2+(−1)+2=32+(-1)+2=3, and it is a different number with a different purpose.
  • - It does not apply to a matrix that merely contains zeros. The whole half must be zero: every entry below the diagonal for upper triangular, every entry above it for lower triangular.
Why every other term dies

The determinant is a sum of products, each taking one entry from every row and every column.

Take an upper triangular matrix and consider any product other than the diagonal one. It must take, from some rowii, an entry in a columnj<ij<i (something below the diagonal, which is zero) — because if every rowii took a column≥i\ge i, then allnn columns used would be≥\ge their row indices, forcing the selection to be exactly the diagonal. So any off-diagonal selection picks up at least one zero from below the diagonal.

Hence exactly one product survives:a11a22⋯anna_{11}a_{22}\cdots a_{nn}, taken in the identity ordering, whose sign is+1+1.

The same argument reflected gives the lower triangular case, and the transpose rule makes the reflection free.

And this is the pivot rule. Elimination converts a matrix into an upper triangularUU using row additions (free) and row exchanges (each a minus sign). So

det⁡A=(−1)#swaps⋅(product of the pivots).\det A=(-1)^{\#\text{swaps}}\cdot(\text{product of the pivots}).

One fact, two readings. That is why libraries compute determinants by elimination: the diagonal rule finishes the job.

Complete worked example, in the paper's shape

Problem.A=[30002−100542010−36]A=\begin{bmatrix}3&0&0&0\\ 2&-1&0&0\\ 5&4&2&0\\ 1&0&-3&6\end{bmatrix}. Computedet⁡A\det A.

Solution. Every entry above the diagonal is zero, soAA is lower triangular and the determinant is the diagonal product:

det⁡A=3⋅(−1)⋅2⋅6=−36.\det A=3\cdot(-1)\cdot2\cdot6=-36.

Check one term that should have died. Take the selection that usesa13=0a_{13}=0 from row 1. Then whatever rows 2 to 4 contribute, the product contains that zero, so it vanishes. Try instead the selection takinga21=2a_{21}=2 from row 2 and the diagonal elsewhere: it also needsa22a_{22}, so row 3 must avoid columns 1 and 2 — but the only nonzero in row 3 in columns 3 or 4 isa33=2a_{33}=2, and then row 4 must takea44=6a_{44}=6. That selection is the diagonal read in a different order... which is not a valid selection, since it repeats columns. Every genuinely different selection meets a zero.

A case that needs elimination first.[123257379]\begin{bmatrix}1&2&3\\ 2&5&7\\ 3&7&9\end{bmatrix} is not triangular. Eliminate:R2−2R1=(0,1,1)R_2-2R_1=(0,1,1),R3−3R1=(0,1,0)R_3-3R_1=(0,1,0), thenR3−R2=(0,0,−1)R_3-R_2=(0,0,-1). Pivots1,1,−11,1,-1, no swaps, sodet⁡A=1⋅1⋅(−1)=−1\det A=1\cdot1\cdot(-1)=-1.

By the end you can
  • Recognise whether a matrix is upper triangular, lower triangular, or neither
  • Read a triangular determinant as the product of the diagonal
  • Use the rule to shortcut a determinant that becomes triangular after elimination
Check yourself
  1. 1.det⁡[52000−31000470002]\det\begin{bmatrix}5&2&0&0\\ 0&-3&1&0\\ 0&0&4&7\\ 0&0&0&2\end{bmatrix}
  2. 2.det⁡[2143]\det\begin{bmatrix}2&1\\ 4&3\end{bmatrix} — is the diagonal product right here?
  3. 3. A reduction needs 1 exchange and produces pivots2,−1,32,-1,3. What isdet⁡A\det A?
  4. 4. Why does the rule survive if the diagonal entries are negative?
Answers
  1. 1.5⋅(−3)⋅4⋅2=−1205\cdot(-3)\cdot4\cdot2=-120. Upper triangular, four factors.
  2. 2. No. The matrix is not triangular; the determinant is2⋅3−1⋅4=22\cdot3-1\cdot4=2, while the diagonal product would be66.
  3. 3.(−1)1⋅(2⋅(−1)⋅3)=6(-1)^1\cdot(2\cdot(-1)\cdot3)=6. One swap, and the pivot product is−6-6.
  4. 4. Because a determinant is a product of signed entries, not of magnitudes. The signs of the diagonal entries are part of the number; nothing about being triangular changes that.
Work out where to start — free, no accountAnswer six real questions — free, no account