Introduction
Gaussian elimination does two jobs at once: it transforms the matrix and it transforms the right-hand side. LU decomposition separates them. It records elimination once as , a lower triangular matrix times an upper triangular one, and then solves for any number of right-hand sides with two cheap triangular solves. The tasks are to find the factors of a small matrix, a particular entry of or , the conditions under which the factorisation exists, or the cost of solving.
Prerequisites
- Systems of Linear Equations and Rank: Gaussian elimination, pivots, back substitution.
- Matrices and Matrix Operations: triangular matrices and their products.
Core concepts
The factorisation
For a square matrix , an LU decomposition is with lower triangular and upper triangular. Since entries of cannot fix the entries of and , a normalisation is chosen:
| Name | Normalisation | Notes |
|---|---|---|
| Doolittle | has 1s on the diagonal | is upper triangular (also row-echelon in nonsingular no-swap elimination); stores the multipliers |
| Crout | has 1s on the diagonal | carries the pivots |
| LDU | both and unit triangular, diagonal | holds the pivots |
| Cholesky | , with positive diagonal | only for symmetric positive definite |
Factorisation convention. "LU" means Doolittle unless a question says otherwise.
Where and come from
Run elimination without row swaps. To clear entry below the pivot , subtract times row from row (with the current entries). Then
- = the final upper triangular matrix;
- = unit lower triangular, with placed at position .
The multipliers go into with the same sign as they were used for subtraction. Equivalently, the Doolittle formulas compute row of and column of in turn:
Solving
With , write . Then:
- Forward substitution: solve from the top row down.
- Back substitution: solve from the bottom row up.

Cost. Factorising an matrix takes about multiplications (and as many additions), that is . Each triangular solve takes about multiplications, so each additional right-hand side costs only . This is why LU is preferred over computing when the same appears with many .
Determinant for free. for Doolittle (and with row swaps, multiply by ).
Existence and pivoting
- Sufficient: if every leading principal minor (top-left block), , is non-zero, then has an LU decomposition with unit ; if additionally is invertible, the Doolittle factorisation is unique. The pivots are (with ).
- Necessary for invertible : if an invertible has , then all leading principal minors are non-zero. So for invertible matrices the condition is necessary and sufficient.
- For an invertible matrix at an active elimination pivot, a zero pivot requires a row exchange. A singular matrix may instead have a zero column to skip or reveal singularity; a useful exchange need not exist. With a permutation matrix , every invertible satisfies . Partial pivoting chooses the largest available pivot in absolute value for numerical stability.
- Classes that never need pivoting: symmetric positive definite matrices (and they admit Cholesky), and strictly diagonally dominant matrices.
Cholesky
If is symmetric positive definite ( for all ; equivalently all eigenvalues positive; equivalently all leading principal minors positive), then with a unique lower triangular having positive diagonal. It needs about half the work of LU.
Worked examples
Example 1: Doolittle factorisation and solve
, .
Column 1: multipliers , ; rows become and . Column 2: ; row 3 becomes . So
Forward: , , . Back: , , . So .
Example 2: Doolittle versus Crout
. Doolittle: , . Crout: , . Both multiply back to ; both give .
Example 3: pivoting needed
is invertible, but its first leading minor is 0, so it has no LU decomposition: would force or to be singular. Swapping the rows gives , already upper triangular.
Example 4: a parameter
: , . The factorisation exists for every (the first pivot is 2); is singular exactly when .
Example 5: Cholesky
(leading minors 4 and 16, positive). , , : and .
Example 6: pivots from leading minors
For the matrix of Example 1, the leading principal minors are , and . The pivots are therefore , and , matching the diagonal of without doing any elimination.
Example 7: why factor once
For and 100 right-hand sides, repeating elimination costs about multiplications. Factoring once and doing two triangular solves per right-hand side costs about , roughly 77 times fewer multiplications.
Example 8: a tridiagonal matrix
. Elimination gives , , , :
The pivots are the ratios of consecutive leading minors, and . Here all required pivots are nonzero. Under that condition both factors are bidiagonal, so for an tridiagonal matrix factorisation and each solve take operations instead of and (the Thomas algorithm). If a required pivot vanishes, use an appropriate pivoted banded solver rather than dividing by zero.
Example 9: a singular matrix with many factorisations
has a zero first leading minor, yet for every number , and give . So for singular matrices a zero leading minor does not rule out an LU factorisation, and the factorisation need not be unique; the clean "exists uniquely if and only if the leading minors are non-zero" statement is for invertible matrices.
Important properties and observations
- The inverse of a unit lower triangular matrix is unit lower triangular; products of lower triangular matrices are lower triangular. This is why the elimination steps combine into one .
- from Doolittle is upper triangular; in nonsingular elimination without swaps it is also row-echelon. Singular upper triangular factors need not be row-echelon.
- In elimination without row swaps, pivots are ratios of consecutive leading principal minors when the denominator minor (the product of prior pivots) is nonzero.
- LU does not change the cost of one solve; it makes repeated solves .
GATE examination perspective
- Compute or (or one entry) for a or matrix, in the Doolittle convention used here.
- Forward and back substitution to finish a solve.
- Existence: leading principal minors, need for pivoting.
- Cost: factorisation, per right-hand side.
- Trap: sign errors when copying multipliers into .
- Trap: mixing Doolittle and Crout normalisations.
- Banded matrices. If all required elimination pivots are nonzero, tridiagonal gives bidiagonal with work (Example 8); otherwise use an appropriate pivoted banded solver.
- Trap: applying the leading-minor test to a singular matrix as if it were invertible (Example 9).
Summary
Sources
- G. Strang, Introduction to Linear Algebra, 5th ed., Wellesley-Cambridge Press, 2016: Sections 2.6 (Elimination = Factorization: A = LU) and 2.7 (Transposes and Permutations).
- E. Kreyszig, Advanced Engineering Mathematics, 10th ed., Wiley, 2011: Chapter 20 (Numeric Linear Algebra).