Tutorials › Linear Algebra › Computing LU Factors From an Elimination Table

LU Factorization and Numerical Considerations · Tutorial 903 of 1000

Computing LU Factors From an Elimination Table

Use each elimination multiplier to build \(L\), read the resulting triangular matrix as \(U\), and check that their product recovers the original matrix.

Intermediate 9 min read

What You'll Learn

  • Identify each elimination multiplier from the current pivot and the entry beneath it.
  • Record multipliers in the matching positions of a unit lower-triangular matrix.
  • Read the upper-triangular factor from the final elimination matrix.
  • Explain why the recorded factors reconstruct the original matrix.
  • Verify an LU factorization by computing the product \(LU\).
  • Detect and correct common errors in recording multipliers.

From an Elimination Table to Two Factors

Gaussian elimination changes a matrix one row at a time. An elimination table shows the entries after each change, but it can also preserve information about how those changes were made. The key is to record each multiplier at the moment it is used. The final triangular matrix supplies \(U\), while the multipliers, placed in the correct positions, supply \(L\). This tutorial focuses on carrying out that procedure and checking the result by multiplication.

We work with square matrices over \(\mathbb{R}\). In elimination without row exchanges, the pivot at each step must be nonzero when it is used. At step \(k\), the pivot is the entry in row \(k\), column \(k\), after the earlier steps have been completed. If that pivot is \(u_{kk}\), and the current entry in row \(i\), column \(k\) is \(a_{ik}^{(k)}\), the multiplier for eliminating that entry is \(m_{ik}=a_{ik}^{(k)}/u_{kk}\). The superscript indicates the stage of elimination; it is not a power.

Definition: In an LU factorization \(\mathbf{A}=\mathbf{L}\mathbf{U}\) obtained by elimination without row exchanges, \(\mathbf{U}\) is the upper-triangular matrix left at the end of elimination. The matrix \(\mathbf{L}\) is lower triangular with every diagonal entry equal to \(1\); its entry in row \(i\), column \(k\), for \(i>k\), is the multiplier \(m_{ik}\) used to eliminate the entry in that position. All entries of \(\mathbf{L}\) above its diagonal are \(0\).

The row operations change the matrix, but the multiplier table records the coefficients needed to reconstruct the original matrix. In particular, do not read the entries below the diagonal of \(\mathbf{L}\) from the final matrix: those entries have been eliminated and are zero in \(\mathbf{U}\). Instead, copy each multiplier into the position corresponding to the entry it eliminated.

Why the Multiplier Is the Right One

Lemma: Suppose the current pivot \(u_{kk}\) is nonzero. To eliminate the current entry \(a_{ik}^{(k)}\) in row \(i>k\), the multiplier is \(m_{ik}=a_{ik}^{(k)}/u_{kk}\), and the row operation is \(R_i\to R_i-m_{ik}R_k\).

Proof. The entry in column \(k\) of row \(i\) after this operation is \(a_{ik}^{(k)}-m_{ik}u_{kk}\). With \(m_{ik}=a_{ik}^{(k)}/u_{kk}\), this becomes \(a_{ik}^{(k)}-(a_{ik}^{(k)}/u_{kk})u_{kk}=0\). Division is valid because \(u_{kk}\ne0\). \(\square\)

This calculation also explains why a table must be read stage by stage. The entry \(a_{ik}^{(k)}\) is the entry after earlier columns have been eliminated, not necessarily the corresponding entry in the original matrix. Each multiplier uses the current pivot and the current entry beneath it.

Worked Elimination Tables

Worked Example: A Three-by-Three Factorization

Find \(L\) and \(U\) for \(\mathbf{A}=\begin{bmatrix}2&1&1\\4&3&3\\8&7&9\end{bmatrix}\) by recording the elimination multipliers.

The first pivot is \(2\). The multipliers are \(m_{21}=4/2=2\) and \(m_{31}=8/2=4\). Apply both row operations:

$$ \begin{bmatrix}2&1&1\\4&3&3\\8&7&9\end{bmatrix} \sim \begin{bmatrix}2&1&1\\0&1&1\\0&3&5\end{bmatrix}. $$

Here the operations are \(R_2\to R_2-2R_1\) and \(R_3\to R_3-4R_1\): the new second row is \((4,3,3)-2(2,1,1)=(0,1,1)\), and the new third row is \((8,7,9)-4(2,1,1)=(0,3,5)\). The second pivot is \(1\), so \(m_{32}=3/1=3\). Apply \(R_3\to R_3-3R_2\): the new third row is \((0,3,5)-3(0,1,1)=(0,0,2)\).

$$ \begin{bmatrix}2&1&1\\0&1&1\\0&3&5\end{bmatrix} \sim \begin{bmatrix}2&1&1\\0&1&1\\0&0&2\end{bmatrix} =\mathbf{U}. $$

Place the multipliers \(m_{21}=2\), \(m_{31}=4\), and \(m_{32}=3\) below the diagonal in their respective positions, and put \(1\) on the diagonal:

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

Check by multiplying. The first row of \(\mathbf{L}\mathbf{U}\) is the first row of \(\mathbf{U}\), namely \((2,1,1)\). The second row is \(2(2,1,1)+(0,1,1)=(4,3,3)\). The third row is \(4(2,1,1)+3(0,1,1)+(0,0,2)=(8,7,9)\). Thus \(\mathbf{L}\mathbf{U}=\begin{bmatrix}2&1&1\\4&3&3\\8&7&9\end{bmatrix}=\mathbf{A}\).

Worked Example: A Fractional Multiplier

Factor \(\mathbf{A}=\begin{bmatrix}1&2&-1\\3&8&1\\2&7&5\end{bmatrix}\) by elimination without row exchanges.

The first pivot is \(1\), giving \(m_{21}=3\) and \(m_{31}=2\). After \(R_2\to R_2-3R_1\), row 2 becomes \((0,2,4)\). After \(R_3\to R_3-2R_1\), row 3 becomes \((0,3,7)\). The elimination table is therefore

$$ \begin{bmatrix}1&2&-1\\3&8&1\\2&7&5\end{bmatrix} \sim \begin{bmatrix}1&2&-1\\0&2&4\\0&3&7\end{bmatrix}. $$

The second pivot is \(2\), so the next multiplier is \(m_{32}=3/2\). Applying \(R_3\to R_3-\tfrac32R_2\) gives row 3 as \((0,3,7)-\tfrac32(0,2,4)=(0,0,1)\). Hence

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

The recorded multipliers give \(\mathbf{L}=\begin{bmatrix}1&0&0\\3&1&0\\2&\tfrac32&1\end{bmatrix}\). To check, the rows of \(\mathbf{L}\mathbf{U}\) are \((1,2,-1)\), \(3(1,2,-1)+(0,2,4)=(3,8,1)\), and \(2(1,2,-1)+\tfrac32(0,2,4)+(0,0,1)=(2,7,5)\). The product is exactly \(\mathbf{A}\).

Worked Example: A Nonunit First Pivot

Find the factors for \(\mathbf{A}=\begin{bmatrix}4&2&0\\2&3&1\\8&5&6\end{bmatrix}\).

The first pivot is \(4\). Thus \(m_{21}=2/4=1/2\) and \(m_{31}=8/4=2\). Subtracting \(\tfrac12R_1\) from row 2 gives \((0,2,1)\); subtracting \(2R_1\) from row 3 gives \((0,1,6)\):

$$ \begin{bmatrix}4&2&0\\2&3&1\\8&5&6\end{bmatrix} \sim \begin{bmatrix}4&2&0\\0&2&1\\0&1&6\end{bmatrix}. $$

The second pivot is \(2\), so \(m_{32}=1/2\). The operation \(R_3\to R_3-\tfrac12R_2\) changes row 3 to \((0,1,6)-\tfrac12(0,2,1)=(0,0,\tfrac{11}{2})\). Therefore

$$ \begin{bmatrix}4&2&0\\0&2&1\\0&1&6\end{bmatrix} \sim \begin{bmatrix}4&2&0\\0&2&1\\0&0&\tfrac{11}{2}\end{bmatrix} =\mathbf{U}. $$

Record the three multipliers to obtain \(\mathbf{L}=\begin{bmatrix}1&0&0\\\tfrac12&1&0\\2&\tfrac12&1\end{bmatrix}\). Multiplication checks the result: row 1 is \((4,2,0)\); row 2 is \(\tfrac12(4,2,0)+(0,2,1)=(2,3,1)\); row 3 is \(2(4,2,0)+\tfrac12(0,2,1)+(0,0,\tfrac{11}{2})=(8,5,6)\). Hence \(\mathbf{L}\mathbf{U}=\mathbf{A}\).

Why Recording the Multipliers Produces \(L\)

Theorem: Suppose elimination without row exchanges takes an \(n\times n\) matrix \(\mathbf{A}\) to an upper-triangular matrix \(\mathbf{U}\), using nonzero pivots at every elimination step. If \(m_{ik}\) is the multiplier used to eliminate the entry in row \(i\), column \(k\), then placing \(m_{ik}\) in position \((i,k)\), placing \(1\) on the diagonal, and placing \(0\) above the diagonal gives a matrix \(\mathbf{L}\) such that \(\mathbf{A}=\mathbf{L}\mathbf{U}\).

Proof. For each step \(k\), let \(\mathbf{M}_k\) be the matrix whose entry in position \((i,k)\) is \(m_{ik}\) for \(i>k\), with all other entries zero. Left multiplication by \(\mathbf{E}_k=\mathbf{I}-\mathbf{M}_k\) replaces row \(i\) by row \(i\) minus \(m_{ik}\) times row \(k\), which is precisely the operation \(R_i\to R_i-m_{ik}R_k\). It leaves row \(k\) unchanged. Also, \(\mathbf{M}_k^2=\mathbf{O}\), since the nonzero entries of \(\mathbf{M}_k\) are in column \(k\) and in rows strictly below \(k\). Consequently, \((\mathbf{I}-\mathbf{M}_k)(\mathbf{I}+\mathbf{M}_k)=\mathbf{I}\), so \(\mathbf{E}_k^{-1}=\mathbf{I}+\mathbf{M}_k\).

After all steps, \(\mathbf{U}=\mathbf{E}_{n-1}\cdots\mathbf{E}_2\mathbf{E}_1\mathbf{A}\). Inverting this sequence gives \(\mathbf{A}=(\mathbf{I}+\mathbf{M}_1)(\mathbf{I}+\mathbf{M}_2)\cdots(\mathbf{I}+\mathbf{M}_{n-1})\mathbf{U}\). For \(i<j\), \(\mathbf{M}_i\mathbf{M}_j=\mathbf{O}\): a nonzero entry of \(\mathbf{M}_i\) can only use column index \(i\) as the intermediate index in a product, while a nonzero row index of \(\mathbf{M}_j\) must be greater than \(j\), and thus greater than \(i\). Expanding the displayed product therefore leaves only \(\mathbf{I}+\mathbf{M}_1+\cdots+\mathbf{M}_{n-1}\). This is exactly the lower-triangular matrix \(\mathbf{L}\) with the recorded multipliers below its diagonal. Hence \(\mathbf{A}=\mathbf{L}\mathbf{U}\). \(\square\)

Common Mistake: Losing an Earlier Multiplier

In the first worked example, the multiplier \(m_{32}=3\) is used after the first two row operations. A tempting but incorrect choice is \(\mathbf{L}_{\mathrm{wrong}}=\begin{bmatrix}1&0&0\\2&1&0\\4&0&1\end{bmatrix}\), which forgets to record that later multiplier. Multiplying this incorrect matrix by the correct \(\mathbf{U}\) gives third row \(4(2,1,1)+(0,0,2)=(8,4,6)\), not the original third row \((8,7,9)\). The correction is to include \(m_{32}=3\) in position \((3,2)\). Then the third product row is \(4(2,1,1)+3(0,1,1)+(0,0,2)=(8,7,9)\), as required.

Another frequent error is to put the negative of each multiplier in \(\mathbf{L}\). The elimination operation subtracts \(m_{ik}\) times the pivot row, but the entry recorded in \(\mathbf{L}\) is \(m_{ik}\), not \(-m_{ik}\). The minus sign belongs to the row operation, while the reconstruction theorem shows why the multiplier itself appears in the lower factor.

A reliable computation can be organized as a short sequence:

1
Find the current pivot.
Use the diagonal entry in the matrix at the current elimination stage, and check that it is nonzero.
2
Compute and record each multiplier.
Divide each current entry beneath the pivot by the pivot. Put each result in the matching position below the diagonal of \(L\).
3
Perform the row operations.
Use \(R_i\to R_i-m_{ik}R_k\) and show the new entries in the elimination table.
4
Read \(U\) and check.
Take the final upper-triangular matrix as \(U\), then multiply \(LU\) and compare every row with the original matrix.

The multiplication check is more than a final formality. It catches missing multipliers, misplaced entries, and arithmetic errors in the elimination itself. For a small matrix, computing the rows of \(LU\) explicitly is usually the quickest check. For larger matrices, the same principle applies: each row of \(L\) forms a weighted combination of rows of \(U\), and those combinations must reproduce the corresponding rows of \(A\).

Check Your Understanding

For each factorization question, record multipliers as you eliminate and verify the proposed factors by multiplication.

  1. Find \(L\) and \(U\) for \(\begin{bmatrix}2&1\\6&5\end{bmatrix}\) without row exchanges.
  2. For \(\begin{bmatrix}1&1&0\\2&5&1\\3&7&4\end{bmatrix}\), compute the multiplier used at the second elimination step.
  3. In the first worked example, what incorrect product row results if the multiplier \(m_{32}\) is omitted from \(L\)?
  4. Explain why the multiplier for an entry below a pivot must be computed using the matrix at the current stage.
  5. State the row operation associated with a multiplier \(m_{ik}\), and identify where \(m_{ik}\) is recorded in \(L\).

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