LU Decomposition University of Massachusetts Amherst
LU decomposition factors A = L U \mathcal{A} = \mathcal{L}\mathcal{U} A = L U where
L \mathcal{L} L is lower triangular and U \mathcal{U} U is upper triangular. Once
computed, we can solve A x = b \mathcal{A}\mathbf{x} = \mathbf{b} A x = b for any
b \mathbf{b} b cheaply using two triangular solves.
The Factorization ¶ Given an invertible matrix A \mathcal{A} A , we seek:
A = L U \mathcal{A} = \mathcal{L}\mathcal{U} A = L U where L \mathcal{L} L is lower triangular with ones on the diagonal and
U \mathcal{U} U is upper triangular.
Solving Linear Systems with LU ¶ To solve A x = b \mathcal{A}\mathbf{x} = \mathbf{b} A x = b :
Decompose: compute A = L U \mathcal{A} = \mathcal{L}\mathcal{U} A = L U
(cost: 2 3 n 3 \frac{2}{3}n^3 3 2 n 3 )
Forward solve: solve L y = b \mathcal{L}\mathbf{y} = \mathbf{b} L y = b for
y \mathbf{y} y (cost: n 2 n^2 n 2 )
Back solve: solve U x = y \mathcal{U}\mathbf{x} = \mathbf{y} U x = y for
x \mathbf{x} x (cost: n 2 n^2 n 2 )
The expensive decomposition is done only once. Solving for additional
right-hand sides costs only O ( n 2 ) \mathcal{O}(n^2) O ( n 2 ) each.
Connection to Gaussian Elimination ¶ Gaussian elimination implicitly computes the LU decomposition:
L = ( 1 l 21 1 l 31 l 32 1 ⋮ ⋱ ⋱ l n 1 l n 2 ⋯ l n , n − 1 1 ) \mathcal{L} = \begin{pmatrix} 1 & & & \\ l_{21} & 1 & & \\ l_{31} & l_{32} & 1 & \\ \vdots & & \ddots & \ddots \\ l_{n1} & l_{n2} & \cdots & l_{n,n-1} & 1 \end{pmatrix} L = ⎝ ⎛ 1 l 21 l 31 ⋮ l n 1 1 l 32 l n 2 1 ⋱ ⋯ ⋱ l n , n − 1 1 ⎠ ⎞ For A = ( 2 1 3 4 4 7 2 5 9 ) \mathcal{A} = \begin{pmatrix} 2 & 1 & 3 \\ 4 & 4 & 7 \\ 2 & 5 & 9 \end{pmatrix} A = ⎝ ⎛ 2 4 2 1 4 5 3 7 9 ⎠ ⎞ ,
the Gaussian elimination from Example 1 gives multipliers
l 21 = 2 l_{21} = 2 l 21 = 2 , l 31 = 1 l_{31} = 1 l 31 = 1 , l 32 = 2 l_{32} = 2 l 32 = 2 , so:
L = ( 1 0 0 2 1 0 1 2 1 ) , U = ( 2 1 3 0 2 1 0 0 4 ) \mathcal{L} = \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 1 & 2 & 1 \end{pmatrix}, \quad
\mathcal{U} = \begin{pmatrix} 2 & 1 & 3 \\ 0 & 2 & 1 \\ 0 & 0 & 4 \end{pmatrix} L = ⎝ ⎛ 1 2 1 0 1 2 0 0 1 ⎠ ⎞ , U = ⎝ ⎛ 2 0 0 1 2 0 3 1 4 ⎠ ⎞ One can verify that L U = A \mathcal{L}\mathcal{U} = \mathcal{A} L U = A .
When Does LU Exist? ¶ If all leading principal minors of A \mathcal{A} A are nonzero (i.e.,
det ( A 1 : k , 1 : k ) ≠ 0 \det(\mathcal{A}_{1:k,1:k}) \neq 0 det ( A 1 : k , 1 : k ) = 0 for k = 1 , … , n k = 1, \ldots, n k = 1 , … , n ), then the LU
decomposition exists and is unique.
When this condition fails, we need pivoting to proceed.