Skip to content

LU Decomposition

A square-matrix factorization into lower- and upper-triangular factors, with permutations when needed.

Version
v1 · 2026-10-03 · History
Domain-specific #
13406
Aliases
Lu Factorization, Lower Upper Factorization

Core Idea

LU decomposition, in this entry's strict square-matrix sense, expresses an \(n\times n\) matrix using same-shape lower-triangular \(L\) and upper-triangular \(U\) factors, with row or column permutations when needed. An unpivoted form is \(A=LU\). LAPACK's row-pivoted convention writes \(A=P_LLU\); a square sparse solver may instead use \(P_S A Q_S^T=LU\). Rectangular LAPACK routines have trapezoidal factors and are a qualified extension outside this strict triangular scope.[1][2]

How would you explain it like I'm…

Two Triangle Puzzles

Some math puzzles have lots of numbers mixed together and are hard to solve all at once. LU decomposition splits the puzzle's number grid into two special triangle-shaped grids, each one easy to solve step by step. You do that splitting work once, then use it again and again to solve lots of similar puzzles fast.

Splitting into Triangle Grids

In math, you sometimes have several equations with several unknowns, and you can write their numbers in a grid called a matrix. LU decomposition breaks that grid into two simpler grids: L, which only has numbers on and below its diagonal, and U, which only has numbers on and above it. Triangle-shaped grids are easy to solve one row at a time. Sometimes you also have to swap rows first. Once the breaking-up is done, you can solve the equations again with new right-hand-side numbers very quickly.

Lower-Upper Triangular Factorization

LU decomposition writes a square matrix A as a product of a lower-triangular matrix L (zeros above the diagonal) and an upper-triangular matrix U (zeros below it): A = LU. It records the work of Gaussian elimination. Often rows must be swapped for the process to work or be numerically stable, so a permutation matrix P is included, for example A = PLU in the LAPACK library's convention; some sparse solvers also reorder columns. Since different sources put P in different places, you must state which product equals A. The main use: once A is factored, solving Ax = b for many different b vectors only needs a permutation, a forward solve with L and a back solve with U, which is cheap. But the factorization can exist even for a singular matrix, where U has a zero on its diagonal and there's no unique solution.

 

LU decomposition, in the square-matrix sense, represents an n×n matrix by a lower-triangular L and an upper-triangular U, possibly with row and column permutations. Unpivoted, A = LU. LAPACK's partial-pivoting routine writes A = P_L·L·U with P_L a permutation matrix, equivalently P_L⁻¹A = LU, while a sparse solver may use P_S·A·Q_Sᵀ = LU with row and column reorderings. The symbols are convention-specific, so one must state which product equals the actual A before solving or comparing factors. LAPACK also factors rectangular matrices into trapezoidal factors, a qualified extension of the strictly triangular square case. The factorization stores elimination work so that a fixed nonsingular coefficient matrix can serve many right-hand sides: each Ax = b becomes a permutation of b, a forward (lower-triangular) solve, a back (upper-triangular) solve, and any inverse column permutation. That use is not the definition: LAPACK can complete LU on a singular matrix and report a zero diagonal entry in U, in which case a unique solve or inverse is unavailable.

Scope of Application

For a fixed nonsingular coefficient matrix, the factors support repeated \(Ax=b\) solves: transform \(b\) according to the permutation, solve the lower and upper triangular systems, and undo any variable permutation. LAPACK separates factorization from solves with multiple right-hand sides. Sparse solvers add fill-reducing ordering and symbolic analysis, while preserving the lower/upper product idea. If \(A\) changes, its numeric factors generally need recomputation.[3][4]

Clarity

LU is the recorded product, not merely Gaussian elimination's transient row operations. Pivoting may be needed even for nonsingular \(A\): the matrix \(\begin{bmatrix}0&2\\1&3\end{bmatrix}\) has a zero first pivot in its given order, but swapping rows yields an upper-triangular matrix. A singular matrix may still have LU factors with a zero diagonal of \(U\); that does not provide a unique solution or inverse.[1]

Manages Complexity

Factoring once makes repeated right-hand sides cheaper than re-eliminating the same dense matrix. For sparse matrices, ordering can reduce fill, but numerical pivot needs may change the order and cost. The method keeps these choices separate from the central question: do the stated lower/upper factors and permutations multiply back to the original matrix?[4][2]

Abstract Reasoning

In Li's sparse convention, check \(P_S A Q_S^T=LU\). For \(Ax=b\), solve \(Ly=P_Sb\) and \(Uz=y\), then recover \(x=Q_S^Tz\). This demonstrates why a row/column permutation is not cosmetic: using the wrong convention gives the wrong system even when both triangular solves are performed accurately.[2]

Knowledge Transfer

The same factor–solve split works for dense and sparse linear systems, but a dense row-only pivot record and a sparse row-and-column ordering cannot be interchanged blindly. Block LU and Crout-style normalization are narrower realizations of the lower/upper identity. The fact that a singular matrix can be factored must remain separate from the stronger claim that it can be inverted.[1][2]

Relationships to Other Abstractions

Local relationship map for LU DecompositionParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.LU DecompositionDOMAINPrime abstraction: Factorization — is a kind ofFactorizationPRIME

Current abstraction LU Decomposition Domain-specific

Parents (1) — outgoing typed relations

  • LU Decomposition is a kind of Factorization Prime

    Square-matrix LU expresses a matrix as a product of same-shape lower- and upper-triangular factors.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

LU Decomposition sits in a sparse region of the domain-specific corpus (77th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Matrix Structures & Matroids (11 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

References

[1] LAPACK DGETRF documentation, directly checked. registry ↩a ↩b ↩c

[2] Xiaoye S. Li, Sparse Gaussian Elimination on High Performance Computers, University of California, Berkeley dissertation (1996), ch. 3 §3.1, directly checked. registry ↩a ↩b ↩c ↩d

[3] LAPACK DGETRS documentation, directly checked. registry ↩

[4] Netlib Templates, “Direct Solvers for Sparse Matrices”, directly checked. registry ↩a ↩b