Tutorials › Linear Algebra › Products Of Upper And Lower Triangular Matrices

Matrix Operations and Algebra · Tutorial 76 of 1000

Products Of Upper And Lower Triangular Matrices

Use the entry formula for matrix multiplication to compute triangular products and prove when their zero patterns are preserved.

Beginner 9 min read

What You'll Learn

  • Identify upper and lower triangular matrices from their entries
  • Compute products of upper triangular matrices
  • Compute products of lower triangular matrices
  • Prove that matching triangular types retain their zero pattern under multiplication
  • Distinguish a guaranteed triangular product from a mixed-type product that need not be triangular

Reading the Zero Pattern

Triangular matrices have a simple, useful pattern: all entries on one side of the main diagonal are zero. When two matrices have the same triangular type, matrix multiplication preserves that pattern. The reason is visible in the entry formula: for an entry on the forbidden side of the product, every term in its sum must be zero. The types must match for this guarantee; multiplying an upper triangular matrix by a lower triangular one may produce a matrix of neither type.

Throughout, matrices have real entries. A square matrix has the same number of rows and columns; its main diagonal consists of entries with equal row and column indices. We use the standard entry formula: if \(\mathbf{A},\mathbf{B}\in\mathbb{R}^{n\times n}\), then the entry in row \(i\), column \(j\) of their product is \((\mathbf{A}\mathbf{B})_{ij}=\sum_{k=1}^{n}a_{ik}b_{kj}\). The index \(k\) runs across the entries paired in the row of \(\mathbf{A}\) and the column of \(\mathbf{B}\).

Definition: A square matrix \(\mathbf{A}=(a_{ij})\in\mathbb{R}^{n\times n}\) is upper triangular if \(a_{ij}=0\) whenever \(i>j\). It is lower triangular if \(a_{ij}=0\) whenever \(i<j\). Entries on the main diagonal may be zero or nonzero. A matrix that is both upper and lower triangular has every off-diagonal entry equal to zero, so it is diagonal.

For an upper triangular matrix, the possible nonzero entries are on or above the main diagonal. For a lower triangular matrix, they are on or below it. A triangular matrix is square by definition, so two factors in a product of triangular matrices must have the same order to be multiplied as square matrices.

Multiplying Upper Triangular Matrices

Worked Example: An Upper Triangular Product

Compute \(\mathbf{U}\mathbf{V}\) for the upper triangular matrices below. Show how the entry formula determines the result.

$$ \mathbf{U}=\begin{bmatrix}1&2&-1\\0&3&4\\0&0&2\end{bmatrix}, \qquad \mathbf{V}=\begin{bmatrix}2&-1&3\\0&1&5\\0&0&-2\end{bmatrix}. $$

Each entry is a row-column product. For row 1 of \(\mathbf{U}\), the three entries are \(1(2)+2(0)+(-1)(0)=2\), \(1(-1)+2(1)+(-1)(0)=1\), and \(1(3)+2(5)+(-1)(-2)=15\). For row 2, they are \(0(2)+3(0)+4(0)=0\), \(0(-1)+3(1)+4(0)=3\), and \(0(3)+3(5)+4(-2)=7\). For row 3, they are \(0(2)+0(0)+2(0)=0\), \(0(-1)+0(1)+2(0)=0\), and \(0(3)+0(5)+2(-2)=-4\). Thus

$$ \mathbf{U}\mathbf{V} = \begin{bmatrix} 2&1&15\\ 0&3&7\\ 0&0&-4 \end{bmatrix}. $$

Check: The first, second, and third columns of this result are respectively \((2,0,0)^{\top}\), \((1,3,0)^{\top}\), and \((15,7,-4)^{\top}\). Multiplying \(\mathbf{U}\) by the columns of \(\mathbf{V}\) gives those same columns: \(\mathbf{U}(2,0,0)^{\top}=(2,0,0)^{\top}\), \(\mathbf{U}(-1,1,0)^{\top}=(1,3,0)^{\top}\), and \(\mathbf{U}(3,5,-2)^{\top}=(15,7,-4)^{\top}\).

The zeros below the diagonal in this example are not a coincidence. The product entry \((i,j)\) is a sum of terms \(u_{ik}v_{kj}\). If \(i>j\), then a potentially nonzero \(u_{ik}\) requires \(k\ge i\), while a potentially nonzero \(v_{kj}\) requires \(k\le j\). There is no index \(k\) satisfying both inequalities when \(i>j\), so every term in that entry is zero. The proof below makes this argument precise for every order \(n\).

Multiplying Lower Triangular Matrices

Worked Example: A Lower Triangular Product

Compute the product of these lower triangular matrices:

$$ \mathbf{L}=\begin{bmatrix}1&0&0\\2&1&0\\-1&3&2\end{bmatrix}, \qquad \mathbf{M}=\begin{bmatrix}2&0&0\\-1&4&0\\3&1&-2\end{bmatrix}. $$

For row 1 of \(\mathbf{L}\), the entries of the product are \(1(2)+0(-1)+0(3)=2\), \(1(0)+0(4)+0(1)=0\), and \(1(0)+0(0)+0(-2)=0\). For row 2, they are \(2(2)+1(-1)+0(3)=3\), \(2(0)+1(4)+0(1)=4\), and \(2(0)+1(0)+0(-2)=0\). For row 3, they are \((-1)(2)+3(-1)+2(3)=1\), \((-1)(0)+3(4)+2(1)=14\), and \((-1)(0)+3(0)+2(-2)=-4\). Hence

$$ \mathbf{L}\mathbf{M} = \begin{bmatrix} 2&0&0\\ 3&4&0\\ 1&14&-4 \end{bmatrix}. $$

Check: The columns of \(\mathbf{M}\) are \((2,-1,3)^{\top}\), \((0,4,1)^{\top}\), and \((0,0,-2)^{\top}\). Multiplying by \(\mathbf{L}\) gives \((2,3,1)^{\top}\), \((0,4,14)^{\top}\), and \((0,0,-4)^{\top}\), which are exactly the columns displayed in \(\mathbf{L}\mathbf{M}\).

Here the entries above the diagonal are zero. For such an entry, \(i<j\). A potentially nonzero entry \(l_{ik}\) requires \(k\le i\), while a potentially nonzero entry \(m_{kj}\) requires \(k\ge j\). Since \(i<j\), no index satisfies both conditions. This is the lower triangular counterpart of the reasoning for the upper triangular product.

The Product Rule and Its Proof

Theorem: If \(\mathbf{A},\mathbf{B}\in\mathbb{R}^{n\times n}\) are both upper triangular, then \(\mathbf{A}\mathbf{B}\) is upper triangular. If they are both lower triangular, then \(\mathbf{A}\mathbf{B}\) is lower triangular.

Proof. First suppose that \(\mathbf{A}\) and \(\mathbf{B}\) are upper triangular. We must show that \((\mathbf{A}\mathbf{B})_{ij}=0\) whenever \(i>j\). Fix any such pair \(i,j\). By the entry formula, \((\mathbf{A}\mathbf{B})_{ij}=\sum_{k=1}^{n}a_{ik}b_{kj}\). Because \(\mathbf{A}\) is upper triangular, \(a_{ik}=0\) whenever \(i>k\); thus a nonzero \(a_{ik}\) requires \(k\ge i\). Because \(\mathbf{B}\) is upper triangular, \(b_{kj}=0\) whenever \(k>j\); thus a nonzero \(b_{kj}\) requires \(k\le j\). But \(i>j\), so \(k\ge i\) and \(k\le j\) cannot both hold. For every \(k\), at least one of \(a_{ik}\) and \(b_{kj}\) is zero. Therefore every term in the sum is zero, and \((\mathbf{A}\mathbf{B})_{ij}=0\). This holds for every \(i>j\), proving that the product is upper triangular.

Now suppose that \(\mathbf{A}\) and \(\mathbf{B}\) are lower triangular. We must show that \((\mathbf{A}\mathbf{B})_{ij}=0\) whenever \(i<j\). Fix such \(i,j\). A nonzero \(a_{ik}\) requires \(k\le i\), because \(\mathbf{A}\) is lower triangular. A nonzero \(b_{kj}\) requires \(k\ge j\), because \(\mathbf{B}\) is lower triangular. Since \(i<j\), no \(k\) can satisfy both inequalities. Thus every product \(a_{ik}b_{kj}\) in the entry sum is zero, and \((\mathbf{A}\mathbf{B})_{ij}=0\). This holds for every \(i<j\), proving that the product is lower triangular. \(\square\)

The proof relies on matching types: both factors must impose compatible zero conditions on the index \(k\). It does not require nonzero diagonal entries. It also does not assert that multiplying different triangular types preserves either pattern.

What Happens When the Types Do Not Match?

Worked Example: An Upper-Lower Product Need Not Be Triangular

Multiply an upper triangular matrix by a lower triangular matrix and inspect the entries on both sides of the diagonal:

$$ \mathbf{U}=\begin{bmatrix}1&1\\0&1\end{bmatrix}, \qquad \mathbf{L}=\begin{bmatrix}1&0\\1&1\end{bmatrix}, \qquad \mathbf{U}\mathbf{L} = \begin{bmatrix} 1(1)+1(1)&1(0)+1(1)\\ 0(1)+1(1)&0(0)+1(1) \end{bmatrix} = \begin{bmatrix}2&1\\1&1\end{bmatrix}. $$

Check: The first column is \(\mathbf{U}(1,1)^{\top}=(2,1)^{\top}\), and the second is \(\mathbf{U}(0,1)^{\top}=(1,1)^{\top}\), agreeing with the displayed product. The entry below the diagonal is \(1\), so the product is not upper triangular. The entry above the diagonal is also \(1\), so it is not lower triangular.

In the matching-type proof, the zero pattern forced at least one factor in each forbidden entry’s sum to vanish. For a mixed product, that reasoning can fail. For example, in the \((2,1)\) entry above, the term \(u_{22}l_{21}=1\cdot1\) is nonzero; upper triangularity of \(\mathbf{U}\) and lower triangularity of \(\mathbf{L}\) do not force it to vanish. A particular mixed product might still happen to be triangular, but its type alone does not guarantee that result.

A Useful Consequence for Diagonal Entries

When two factors have the same triangular type, the diagonal entries of the product are especially simple. For upper triangular factors, the \((i,i)\) entry is \(\sum_{k=1}^{n}a_{ik}b_{ki}\). A nonzero \(a_{ik}\) requires \(k\ge i\), while a nonzero \(b_{ki}\) requires \(k\le i\). Both can hold only when \(k=i\). For lower triangular factors, a nonzero \(a_{ik}\) requires \(k\le i\), while a nonzero \(b_{ki}\) requires \(k\ge i\), again leaving only \(k=i\). Thus in either matching case, \((\mathbf{A}\mathbf{B})_{ii}=a_{ii}b_{ii}\). This conclusion follows directly from the same entry-by-entry argument; it does not require diagonal entries to be nonzero.

Takeaway: For matching triangular types, the product keeps the same type, and each diagonal entry is the product of the corresponding diagonal entries of the factors. These are entry-level conclusions; the off-diagonal entries of the product can still require sums of several terms.

Common Mistake: Assuming Every Zero Stays Zero

A common error is to look at a zero in one factor and assume the corresponding position in the product must also be zero. Matrix multiplication forms each entry from a full row-column sum, so the location of zeros in both factors matters. In the mixed example, a mistaken calculation might claim that the \((2,1)\) entry of \(\mathbf{U}\mathbf{L}\) is \(0\), because \(\mathbf{U}\) has a zero in position \((2,1)\). But the entry formula gives

$$ (\mathbf{U}\mathbf{L})_{21} =u_{21}l_{11}+u_{22}l_{21} =0\cdot1+1\cdot1 =1. $$

The correction is to calculate the entire row-column sum, not to copy a zero from one factor. The matching-type theorem is a guarantee about all the terms in a sum; it is not a rule that a zero in one matrix automatically transfers to the same position in the product.

Preserving triangular structure is useful because it lets us predict which entries of a product must be zero before carrying out every multiplication. When computing a product by hand, use the type as a check: if two upper triangular factors produce a nonzero entry below the diagonal, an entry calculation has gone wrong. Conversely, do not use that check for a mixed pair unless you have established the zero entries directly.

Check Your Understanding

Use the entry formula and the zero patterns, rather than guessing from the appearance of a factor.

  1. State the condition on \(a_{ij}\) that defines an upper triangular matrix, and the condition that defines a lower triangular matrix.
  2. In a product of two upper triangular matrices, explain why the \((i,j)\) entry must be zero when \(i>j\).
  3. Compute the product of \(\begin{bmatrix}2&-1\\0&3\end{bmatrix}\) and \(\begin{bmatrix}1&4\\0&-2\end{bmatrix}\), and verify its triangular type.
  4. For two lower triangular matrices, which entries of their product are guaranteed to be zero?
  5. Use the entry formula to calculate the \((2,1)\) entry of \(\begin{bmatrix}1&1\\0&1\end{bmatrix}\begin{bmatrix}1&0\\1&1\end{bmatrix}\). Why does this mixed product not contradict the product theorem?

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