Triangular Matrices

Triangular matrices are square matrices whose entries are zero on one side of the main diagonal. Their special structure makes several matrix operations — especially determinant, inversion, and back-substitution — very efficient.

Definition of an Upper Triangular Matrix

A square matrix is upper triangular if and only if all its entries below the main diagonal are zero.

Example:

\[ U = \begin{bmatrix} \color{red}1 & 2 & 3 \\ \color{blue}0 & \color{red}4 & 5 \\ \color{blue}0 & \color{blue}0 & \color{red}6 \end{bmatrix}. \]

Note: main diagonal entries are shown in red; all entries below them (in blue) are zero.

Definition of a Lower Triangular Matrix

A square matrix is lower triangular if and only if all its entries above the main diagonal are zero.

Example:

\[ L = \begin{bmatrix} \color{red}1 & \color{blue}0 & \color{blue}0 \\ 2 & \color{red}3 & \color{blue}0 \\ 4 & 5 & \color{red}6 \end{bmatrix}. \]

Note: main diagonal entries are shown in red; all entries above them (in blue) are zero.

Key idea. The determinant of a triangular matrix is trivial to compute — just multiply the diagonal entries. This is why Gaussian elimination aims to triangularize a matrix.

Properties of Triangular Matrices

  1. The determinant of a triangular matrix equals the product of its main-diagonal entries.
  2. The transpose of an upper triangular matrix is lower triangular, and vice versa.
  3. The product of two lower triangular matrices is lower triangular. The product of two upper triangular matrices is upper triangular.
  4. The sum (or difference) of two triangular matrices of the same type is triangular of the same type.
  5. A triangular matrix is invertible if and only if every main-diagonal entry is nonzero.
  6. The inverse of an invertible triangular matrix is triangular of the same type (upper or lower).
  7. The eigenvalues of a triangular matrix are exactly its main-diagonal entries.
  8. If all diagonal entries equal \(1\), the matrix is called unit triangular (or unipotent). Unit triangular matrices are always invertible.
Strictly triangular matrices. A matrix is strictly upper triangular if all entries on or below the main diagonal are zero (i.e., the diagonal entries are also zero). A strictly triangular matrix is always nilpotent.

Comparison Table

Property Upper Triangular Lower Triangular
Nonzero entries On and above diagonal On and below diagonal
Transpose Lower triangular Upper triangular
Product of two Upper triangular Lower triangular
Sum of two Upper triangular Lower triangular
Inverse (if exists) Upper triangular Lower triangular
Determinant Product of diagonal Product of diagonal

Examples with Solutions

Example 1 — Identify Triangular Matrices

Classify each of the following as upper triangular, lower triangular, or neither.

\[ A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}, \qquad B = \begin{bmatrix} -2 & 3 & 4 \\ 0 & 0 & 5 \\ 0 & 0 & 1 \end{bmatrix} \]

\[ C = \begin{bmatrix} -1 & 0 & 0 & 0 \\ 2 & -7 & 0 & 0 \\ 5 & 4 & 2 & 0 \\ 3 & -2 & 8 & 3 \end{bmatrix}, \qquad D = \begin{bmatrix} 1 & 9 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & -4 & 1 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} \]

Solution

  • A — neither. Not square (\(2 \times 3\)), so it cannot be triangular.
  • B — upper triangular. Square, and all entries below the main diagonal (\(B_{21}, B_{31}, B_{32}\)) are zero.
  • C — lower triangular. Square, and all entries above the main diagonal are zero.
  • D — neither. Square, but there is a nonzero entry above the diagonal (\(D_{12} = 9\)) and below the diagonal (\(D_{32} = -4\)).
Example 2 — Find the Determinant of Triangular Matrices

Find the determinant of each matrix.

a) \( A = \begin{bmatrix} 3 & 0 & 0 \\ 1 & -1 & 0 \\ -2 & 3 & 2 \end{bmatrix} \)

b) \( B = \begin{bmatrix} x & 0 & 1 \\ 0 & x+1 & 1 \\ 0 & 0 & x \end{bmatrix} \)

c) \( C = \begin{bmatrix} -1 & 0 & 0 & 0 \\ 5 & -9 & 0 & 0 \\ 5 & 4 & 7 & 0 \\ 5 & 0 & 0 & 0 \end{bmatrix} \)

Solution

a) \(A\) is lower triangular. \(\det(A) = (3)(-1)(2) = -6\).

b) \(B\) is upper triangular. \(\det(B) = x \cdot (x+1) \cdot x = x^3 + x^2\).

c) \(C\) is lower triangular. \(\det(C) = (-1)(-9)(7)(0) = 0\).

Example 3 — Test the Invertibility of a Matrix

Find all real \(x\) for which the following matrix is not invertible.

\[ A = \begin{bmatrix} x-1 & 0 & 0 & 0 \\ 5 & x+1 & 0 & 0 \\ 5 & 4 & x^2 + 5 & 0 \\ 5 & 0 & x+2 & 3 \end{bmatrix} \]

Solution

The matrix is lower triangular, so

\[ \det(A) = (x-1)(x+1)(x^2+5)(3). \]

Set \(\det(A) = 0\):

  • \(x - 1 = 0 \Rightarrow x = 1\)
  • \(x + 1 = 0 \Rightarrow x = -1\)
  • \(x^2 + 5 = 0\) has no real solution.

Therefore \(A\) is not invertible for \(x = \pm 1\).

Example 4 — Find the Inverse of a Triangular Matrix

Find \(A^{-1}\) for \(A = \begin{bmatrix} 1 & 0 \\ 2 & -4 \end{bmatrix}\).

Solution

Use the \(2 \times 2\) inverse formula:

\[ \begin{bmatrix} x & y \\ z & w \end{bmatrix}^{-1} = \frac{1}{xw - yz}\begin{bmatrix} w & -y \\ -z & x \end{bmatrix}. \]

\[ A^{-1} = \frac{1}{(1)(-4) - (0)(2)} \begin{bmatrix} -4 & 0 \\ -2 & 1 \end{bmatrix} = -\frac{1}{4}\begin{bmatrix} -4 & 0 \\ -2 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ \tfrac{1}{2} & -\tfrac{1}{4} \end{bmatrix}. \]

Both \(A\) and \(A^{-1}\) are lower triangular, in agreement with Property 6.

Example 5 — Identify Invertible Triangular Matrices

Given \(A = \begin{bmatrix} 3 & 0 & 0 \\ 5 & -2 & 0 \\ 9 & -2 & 4 \end{bmatrix}\), \(B = \begin{bmatrix} -2 & 0 & 0 \\ 0 & -2 & 0 \\ -3 & 4 & -1 \end{bmatrix}\), \(C = \begin{bmatrix} 7 & 0 & 0 \\ -1 & 0 & 0 \\ 12 & -2 & 3 \end{bmatrix}\), determine which of \(A, B, C, AB, AC, A+C\) are invertible.

Solution

Determinants of the diagonal matrices:

  • \(\det(A) = (3)(-2)(4) = -24 \neq 0\) → \(A\) is invertible.
  • \(\det(B) = (-2)(-2)(-1) = -4 \neq 0\) → \(B\) is invertible.
  • \(\det(C) = (7)(0)(3) = 0\) → \(C\) is not invertible.

Using \(\det(XY) = \det(X)\det(Y)\):

  • \(\det(AB) = (-24)(-4) = 96 \neq 0\) → \(AB\) is invertible.
  • \(\det(AC) = (-24)(0) = 0\) → \(AC\) is not invertible.

Compute \(A + C\):

\[ A + C = \begin{bmatrix} 10 & 0 & 0 \\ 4 & -2 & 0 \\ 21 & -4 & 7 \end{bmatrix}. \]

\(\det(A+C) = (10)(-2)(7) = -140 \neq 0\) → \(A+C\) is invertible.

Questions with Solutions

Question 1 — Inverses of Triangular Matrices

If \(A\) and \(B\) satisfy \(AB = BA = I\), explain why \(B\) is lower triangular whenever \(A\) is lower triangular (and vice versa).

Solution

\(AB = BA = I\) means \(A\) and \(B\) are inverses. By Property 6, the inverse of an invertible lower triangular matrix is lower triangular. Hence \(B\) is lower triangular, and the same reasoning applies in the reverse direction.

Question 2 — Invertibility of Matrix Products

Given \(A = \begin{bmatrix} x^2 - 1 & -5 \\ 0 & x \end{bmatrix}\) and \(B = \begin{bmatrix} y & 0 \\ -2 & y^2 - 4 \end{bmatrix}\), find all real \(x, y\) for which \(AB\) is not invertible.

Solution

\(A\) is upper triangular, so \(\det(A) = (x^2-1)(x)\).

\(B\) is lower triangular, so \(\det(B) = (y)(y^2-4)\).

\(\det(AB) = \det(A)\det(B) = (x^2-1)(x)(y)(y^2-4)\).

This is zero when:

  • \(x^2-1 = 0 \Rightarrow x = \pm 1\)
  • \(x = 0\)
  • \(y = 0\)
  • \(y^2-4 = 0 \Rightarrow y = \pm 2\)

So \(AB\) is not invertible for \(x \in \{-1, 0, 1\}\) or \(y \in \{-2, 0, 2\}\).

Question 3 — Finding Singular Matrices

Find all real \(c\) such that \(A = \begin{bmatrix} -1 & 3 & 7 \\ 0 & c-1 & 3 \\ 0 & 0 & c^2 - 7 \end{bmatrix}\) is singular.

Solution

\(A\) is upper triangular, so \(\det(A) = (-1)(c-1)(c^2-7)\).

Setting \(\det(A) = 0\):

  • \(c - 1 = 0 \Rightarrow c = 1\)
  • \(c^2 - 7 = 0 \Rightarrow c = \pm \sqrt{7}\)

So \(A\) is singular for \(c \in \{1, \sqrt{7}, -\sqrt{7}\}\).

More References and Links