Chapter 3: Gaussian Elimination and LU Factorization
This chapter studies direct methods for general linear systems. We begin with forward and backward substitution for triangular systems, describe elimination through Gauss transformations, and then derive the LU factorization. Finally, we discuss rounding errors, partial pivoting, and LU factorization with pivoting.
1. Triangular Systems
Let
We wish to solve the linear system
When \(A\) is triangular, the unknowns can be determined successively. This is the foundation of general elimination methods.
1.1 Lower Triangular Systems and Forward Substitution
Let \(L=(l_{ij})\) be a nonsingular lower triangular matrix. The system \(Lx=b\) can be written as
Solving row by row from the first row gives the forward-substitution formulas
Algorithm 1.1 (Forward Substitution)
For \(i=1,\ldots,n\), compute successively
If \(L\) is unit lower triangular, then \(l_{ii}=1\), so no division is needed.
1.2 Upper Triangular Systems and Backward Substitution
Let \(U=(u_{ij})\) be a nonsingular upper triangular matrix. Solving upward from the last row gives
Algorithm 1.2 (Backward Substitution)
For \(i=n,n-1,\ldots,1\), compute successively
Both forward and backward substitution require approximately \(n^2\) floating-point operations and therefore have complexity \(O(n^2)\).
1.3 Algebraic Properties of Triangular Matrices
Proposition 1.3 (Closure of Triangular Matrices)
The product and inverse of upper triangular matrices are upper triangular; the product and inverse of lower triangular matrices are lower triangular.
A triangular matrix whose diagonal entries are all \(1\) is called a unit triangular matrix. The product and inverse of unit triangular matrices remain unit triangular matrices of the same type.
Proof of Proposition 1.3 (click to expand)
Consider upper triangular matrices. If both \(A\) and \(B\) are upper triangular, then for \(i>j\),
because every term has either \(a_{ik}=0\) or \(b_{kj}=0\). Hence \(AB\) is upper triangular.
If \(A\) is nonsingular, each column of \(AX=I\) can be found by backward substitution, and the resulting matrix \(X=A^{-1}\) is upper triangular. The lower triangular case is analogous. If every diagonal entry equals \(1\), the diagonal entries of both the product and inverse also equal \(1\). \(\square\)
1.4 Backward Error of Triangular Solves
Let the unit roundoff be \(u\). The floating-point solution \(\widehat{x}\) produced by forward substitution can be interpreted as the exact solution of a nearby lower triangular system:
where
Similarly, backward substitution satisfies
Interpretation
Thus triangular solves are backward stable: the computed result is the exact solution of a triangular system that is very close to the original one.
2. Gaussian Elimination
2.1 Elementary Elimination and Gauss Transformations
Let \(e_i\) denote the \(i\)th standard basis vector. Left multiplication by
is equivalent to adding \(\lambda\) times row \(i\) to row \(j\).
To eliminate the first column, suppose \(a_{11}\neq0\) and define the multipliers
and the vector
The first Gauss transformation is then
It annihilates every entry below the pivot in the first column.
2.2 The \(k\)th Elimination Step
Assume that the first \(k-1\) columns have already been eliminated. At step \(k\), the pivot is \(a_{kk}^{(k)}\). If
define
and set \(\tau_1^{(k)},\ldots,\tau_k^{(k)}\) equal to zero. The corresponding Gauss transformation is
After \(n-1\) steps, we obtain the upper triangular matrix
Pivot Condition
Gaussian elimination without row interchanges requires every pivot \(a_{kk}^{(k)}\) to be nonzero. Nonsingularity of the matrix alone does not guarantee this condition.
2.3 Properties of Gauss Transformations
Since
we have
Indeed,
When \(i<j\), we also have
because \(e_i^{\mathsf T}\tau^{(j)}=0\) in the cross term.
2.4 Elimination Updates and Operation Count
At step \(k\), for \(i=k+1,\ldots,n\), first compute the multiplier
and then update the remaining entries by
The leading operation count of Gaussian elimination is approximately
floating-point operations, so its complexity is \(O(n^3)\).
3. LU Factorization
3.1 From Gaussian Elimination to LU Factorization
From
we obtain
Define
Then \(L\) is unit lower triangular, and hence
Moreover, the structure of the Gauss transformations gives
Thus the strict lower triangular part of \(L\) stores exactly the elimination multipliers, while \(U\) stores the upper triangular result of elimination.
3.2 Existence and Uniqueness of the LU Factorization
Let \(A_k=A(1:k,1:k)\) denote the \(k\)th leading principal submatrix of \(A\).
Theorem 3.1 (LU Factorization)
If
then there exist unique matrices \(L\) and \(U\), with \(L\) unit lower triangular and \(U\) upper triangular, such that
Moreover,
Proof of Theorem 3.1 (click to expand)
We use induction on the order of the matrix. The result is immediate for \(n=1\). Assume it holds for matrices of order \(n-1\), and partition \(A\) as
By assumption, all leading principal minors of \(A_1\) are nonzero, so there is a unique factorization
Therefore,
This proves existence.
If also
then
The left-hand side is unit lower triangular, whereas the right-hand side is upper triangular. They can be equal only if both are the identity. Therefore \(L_1=L_2\) and \(U_1=U_2\), proving uniqueness.
Finally, since \(\det(L)=1\),
\(\square\)
Remark on the Condition
Nonzero leading principal minors are a standard sufficient condition for the existence of an LU factorization without pivoting. Equivalently, this factorization can be completed whenever every pivot generated during elimination is nonzero.
3.3 Compact Storage and the Computational Algorithm
Because every diagonal entry of \(L\) equals \(1\), the strict lower triangular part of \(L\) and the upper triangular part of \(U\) can be stored together in the space originally occupied by \(A\):
Algorithm 3.2 (In-Place LU Factorization)
For \(k=1,\ldots,n-1\):
First compute
and then perform the rank-one update
At termination, the strict lower triangular part stores the multipliers of \(L\), and the upper triangular part stores \(U\).
3.4 Solving Linear Systems with LU
Once \(A=LU\) has been computed, the original system is equivalent to
Introducing the intermediate variable \(y=Ux\), first solve by forward substitution
and then solve by backward substitution
Multiple Right-Hand Sides
The LU factorization is computed only once at a cost of \(O(n^3)\). Each additional right-hand side then requires only two triangular solves, with cost \(O(n^2)\).
3.5 The \(LDM^{\mathsf T}\) Factorization
If \(A=LU\) and every diagonal entry of \(U\) is nonzero, define
Then \(M\) is unit lower triangular and
Corollary 3.3 (The \(LDM^{\mathsf T}\) Factorization)
Under the assumptions of Theorem 3.1, \(A\) has a unique factorization
where \(L\) and \(M\) are unit lower triangular and \(D\) is nonsingular and diagonal.
4. Rounding Errors and Pivoting
4.1 Backward Error of LU Factorization
Let \(\widehat{L}\) and \(\widehat{U}\) be the computed floating-point factors. Under the standard rounding model, we can write
with the componentwise error bound
The solution \(\widehat{x}\) obtained from \(\widehat{L}\), \(\widehat{U}\), and two triangular solves satisfies
where
The Danger of a Small Pivot
The error bound depends on \(|\widehat{L}||\widehat{U}|\). If a pivot is very small, the elimination multipliers may become large, causing substantial element growth in \(L\) and \(U\) and amplifying rounding errors.
For example, for
elimination without a row interchange gives
Thus a nonzero but very small pivot can still cause numerical instability.
4.2 Interchange Matrices
The interchange matrix that swaps rows \(i\) and \(j\) can be written as
It satisfies
Left multiplication by \(P_{ij}\) is equivalent to interchanging rows \(i\) and \(j\) of a matrix.
4.3 Partial Pivoting
At step \(k\), choose the entry with the largest absolute value among rows \(k\) through \(n\) of the current \(k\)th column:
Then interchange rows \(k\) and \(p_k\) before performing elimination. Consequently, every multiplier satisfies
Algorithm 4.1 (Gaussian Elimination with Partial Pivoting)
For \(k=1,\ldots,n-1\):
Choose
interchange rows \(k\) and \(p_k\);
compute the multipliers and update the Schur complement:
The product of all row interchanges forms a permutation matrix \(P\), and the final factorization is
To solve \(Ax=b\), solve successively
4.4 Complexity and Stability
Partial pivoting adds approximately \(O(n^2)\) comparisons, while the main elimination work remains \(O(n^3)\). Since \(|l_{ik}|\leq1\), we have
This controls the growth of the elimination multipliers. Although \(U\) can still exhibit large element growth for specially constructed extreme examples, the method is usually stable in practice and is therefore the standard method for solving general dense linear systems.
Complete Pivoting
Complete pivoting selects the entry of largest absolute value in the entire remaining submatrix and interchanges both the corresponding rows and columns. It provides stronger growth control, but the search requires \(O(n^3)\) comparisons, so partial pivoting is usually preferred in practice.
5. Chapter Summary
Key Conclusions
-
A triangular system can be solved by forward or backward substitution in \(O(n^2)\) time.
-
Gauss transformations express elimination as matrix multiplication, and the vectors in their inverses record exactly the elimination multipliers.
-
If all elimination pivots are nonzero, then \(A=LU\); with the unit lower triangular normalization, this factorization is unique.
-
LU factorization costs \(O(n^3)\), but each new right-hand side requires only \(O(n^2)\) work in triangular solves.
-
To avoid zero or excessively small pivots, practical computations usually use partial pivoting and obtain \(PA=LU\).