LU Factorization

Summary

LU factorization writes a nonsingular matrix as A=LU with L unit lower triangular and U upper triangular. Solving Ax=b becomes Ly=b then Ux=y . With row exchanges, the stable form is PA=LU .

Prerequisites

Problem Type

Factor A once, then solve one or many systems with different right-hand sides.

Method Definition

Without pivoting (Doolittle form): run Gaussian elimination on A , store multipliers mij in the strict lower part of L (unit diagonal), and store the resulting upper matrix in U .[1]

With partial pivoting: apply row swaps, track them in a permutation matrix P , and obtain PA=LU .

Assumptions / Requirements

Algorithm (no pivoting)

  1. Set UA , LI .
  2. For k=1,,n1 :
    • For i=k+1,,n :
      • ikuik/ukk
      • Row i of U row iik row k
  3. Solve Ly=b , then Ux=y .

Algorithm (partial pivoting)

At stage k , swap for the largest |uik| with ik , record the swap in P , then eliminate as above (also swap the already-computed part of L consistently). Result: PA=LU .

Worked Example

A=(23147761822)

Stage k=1 : multipliers 21=2 , 31=3 .

U(2310150919)

Stage k=2 : multiplier 32=9/1=9 .

U(2310150026),L=(100210391)

Check LU=A :

LU=(23147761822)=A.

Solve Ax=b with b=(1,2,3) . First Ly=b :

y1=1,y2=221=0,y3=33190=0.

Then Ux=y : x3=0 , x2=0 , x1=1/2 . Check: A(1/2,0,0) is half the first column of A , namely (1,2,3)=b , so the residual is zero.

Convergence

Direct O(n3) factorization; each subsequent solve is O(n2) .

Error / Accuracy

Verify LUA (or PALU ) and the residual of Ax=b . Prefer pivoting when pivots are small.

Common Failure Modes

Connections

References


  1. Burden & Faires, Numerical Analysis, LU factorization; NIST DLMF Ch. 3, https://dlmf.nist.gov/3 ↩︎