Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Big Idea

LU decomposition factors A=LU\mathcal{A} = \mathcal{L}\mathcal{U} where L\mathcal{L} is lower triangular and U\mathcal{U} is upper triangular. Once computed, we can solve Ax=b\mathcal{A}\mathbf{x} = \mathbf{b} for any b\mathbf{b} cheaply using two triangular solves.

The Factorization

Given an invertible matrix A\mathcal{A}, we seek:

A=LU\mathcal{A} = \mathcal{L}\mathcal{U}

where L\mathcal{L} is lower triangular with ones on the diagonal and U\mathcal{U} is upper triangular.

Solving Linear Systems with LU

To solve Ax=b\mathcal{A}\mathbf{x} = \mathbf{b}:

  1. Decompose: compute A=LU\mathcal{A} = \mathcal{L}\mathcal{U} (cost: 23n3\frac{2}{3}n^3)

  2. Forward solve: solve Ly=b\mathcal{L}\mathbf{y} = \mathbf{b} for y\mathbf{y} (cost: n2n^2)

  3. Back solve: solve Ux=y\mathcal{U}\mathbf{x} = \mathbf{y} for x\mathbf{x} (cost: n2n^2)

The expensive decomposition is done only once. Solving for additional right-hand sides costs only O(n2)\mathcal{O}(n^2) each.

Connection to Gaussian Elimination

Gaussian elimination implicitly computes the LU decomposition:

L=(1l211l31l321ln1ln2ln,n11)\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}

Example 1 (LU Decomposition)

For A=(213447259)\mathcal{A} = \begin{pmatrix} 2 & 1 & 3 \\ 4 & 4 & 7 \\ 2 & 5 & 9 \end{pmatrix}, the Gaussian elimination from Example 1 gives multipliers l21=2l_{21} = 2, l31=1l_{31} = 1, l32=2l_{32} = 2, so:

L=(100210121),U=(213021004)\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}

One can verify that LU=A\mathcal{L}\mathcal{U} = \mathcal{A}.

When Does LU Exist?

Theorem 1 (LU Existence and Uniqueness)

If all leading principal minors of A\mathcal{A} are nonzero (i.e., det(A1:k,1:k)0\det(\mathcal{A}_{1:k,1:k}) \neq 0 for k=1,,nk = 1, \ldots, n), then the LU decomposition exists and is unique.

When this condition fails, we need pivoting to proceed.