Skip to content

LU Decomposition

Definition

An LU decomposition factors a matrix, after possible row permutations, as PA=LU\boldsymbol{P}\boldsymbol{A}=\boldsymbol{L}\boldsymbol{U}, where P\boldsymbol{P} is a permutation matrix, L\boldsymbol{L} is lower triangular, and U\boldsymbol{U} is upper triangular.


Interpretation

LU decomposition records the forward phase of Gaussian elimination (row reduction to row echelon form) as a matrix factorization: U\boldsymbol{U} is the echelon form that elimination produces, and L\boldsymbol{L} stores the multipliers used to get there.

A 3 by 3 matrix A written as the product of a lower triangular matrix L, holding the elimination multipliers, and an upper triangular matrix U, its echelon form.

The figure factors

A=(211433−213).\boldsymbol{A}=\begin{pmatrix}2&1&1\\4&3&3\\-2&1&3\end{pmatrix}.

Subtracting 22 times row 1 from row 2, adding row 1 to row 3 (multiplier −1-1), and then subtracting 22 times the new row 2 from row 3 leaves U\boldsymbol{U}; the multipliers 22, −1-1, 22 fill L\boldsymbol{L} below its diagonal of ones.

Multiplying LU\boldsymbol{L}\boldsymbol{U} undoes the elimination and rebuilds A\boldsymbol{A} row by row. For instance, row 3 of A\boldsymbol{A} is −1-1 times row 1 of U\boldsymbol{U}, plus 22 times row 2, plus row 3: −(2,1,1)+2(0,1,1)+(0,0,2)=(−2,1,3)-(2,1,1)+2(0,1,1)+(0,0,2)=(-2,1,3). Since L\boldsymbol{L} and U\boldsymbol{U} are triangular, the factorization also gives the determinant: det⁡A=det⁡Ldet⁡U=2⋅1⋅2=4\det\boldsymbol{A}=\det\boldsymbol{L}\det\boldsymbol{U}=2\cdot1\cdot2=4.

To solve Ax=b\boldsymbol{A}\boldsymbol{x}=\boldsymbol{b}, first solve Ly=Pb\boldsymbol{L}\boldsymbol{y}=\boldsymbol{P}\boldsymbol{b} by forward substitution, then Ux=y\boldsymbol{U}\boldsymbol{x}=\boldsymbol{y} by back substitution. The elimination is done once, so each further right-hand side costs only these two triangular solves. Row swaps are needed when a zero appears in a pivot position: (0110)\begin{pmatrix}0&1\\1&0\end{pmatrix} has no decomposition A=LU\boldsymbol{A}=\boldsymbol{L}\boldsymbol{U}, since its first pivot would be 00, but swapping its rows gives PA=I=II\boldsymbol{P}\boldsymbol{A}=\boldsymbol{I}=\boldsymbol{I}\boldsymbol{I}. When no row swaps are needed, P=I\boldsymbol{P}=\boldsymbol{I}.

A common slip concerns the signs in L\boldsymbol{L}. Its entries are the multipliers mm in "subtract mm times row jj from row ii", so adding row 1 to row 3 enters L\boldsymbol{L} as −1-1, not +1+1.


Key Results

  • If no row interchanges are needed, the factorization is A=LU\boldsymbol{A}=\boldsymbol{L}\boldsymbol{U}.
  • LU decomposition helps solve Ax=b\boldsymbol{A}\boldsymbol{x}=\boldsymbol{b} efficiently by forward and back substitution.

Examples

  • For A=(1112483927)\boldsymbol{A}=\begin{pmatrix}1&1&1\\2&4&8\\3&9&27\end{pmatrix}, subtract 22 and 33 times row 1 from rows 2 and 3, then 33 times the new row 2 from row 3. This gives U=(111026006)\boldsymbol{U}=\begin{pmatrix}1&1&1\\0&2&6\\0&0&6\end{pmatrix}, the multipliers fill L=(100210331)\boldsymbol{L}=\begin{pmatrix}1&0&0\\2&1&0\\3&3&1\end{pmatrix}, and A=LU\boldsymbol{A}=\boldsymbol{L}\boldsymbol{U}.
  • PA=LU\boldsymbol{P}\boldsymbol{A}=\boldsymbol{L}\boldsymbol{U} includes pivoting through the permutation matrix P\boldsymbol{P}.

Prerequisites

Sources

Aliases: LU factorization, LU factorisation, PLU decomposition

Last updated: 20 October 2026 03:02