Mathematics / LU Decomposition
FREE TO EXPLORE
LABORATORY 12 · MATHEMATICS

LU Decomposition theory

Understand lu decomposition: mathematical proofs, error recurrences, asymptotic rates and stability criteria.

Mathematical foundations of LU Decomposition.

LU decomposition—introduced by English mathematician Alan Turing in his historic 1948 paper 'Rounding-Off Errors in Matrix Processes' and independently developed by Polish astronomer Tadeusz Banachiewicz—is the mathematical cornerstone of numerical linear algebra. While Gaussian elimination combines matrix triangularization with the right-hand-side vector, LU decomposition decouples the two processes. Turing recognized that the elementary row operations of Gaussian elimination can be represented as multiplication by lower-triangular elementary matrices, effectively factoring the coefficient matrix into the product of two triangular matrices: A = LU, where L is lower-triangular and U is upper-triangular. When row pivoting is incorporated to maintain numerical stability, the factorization takes the canonical form PA = LU, where P is a permutation matrix. The true power of LU decomposition emerges when solving linear systems with multiple right-hand-side vectors: Ax = b becomes P(LU)x = b, or L(Ux) = Pb. Defining an intermediate vector y = Ux, the solution is obtained in two rapid stages: (1) Forward substitution: solve the lower-triangular system Ly = Pb for y in n² operations; and (2) Backward substitution: solve the upper-triangular system Ux = y for x in n² operations. While factoring A requires (2/3)n³ operations, once L and U are computed, each subsequent solution vector requires only 2n² operations. For a system with m right-hand sides, LU decomposition reduces computational effort from m·(2/3)n³ to (2/3)n³ + m·2n², delivering speedups of hundreds or thousands of times in structural dynamics, time-dependent partial differential equations, and control theory. In this computational laboratory, students evaluate Doolittle LU factorization across dense matrices from n = 10 to n = 60, verify in-place matrix storage, execute dual-phase triangular substitutions, and extract the asymptotic factorization constant C = 2/3 ≈ 0.667 via ordinary least-squares regression.

\text{FLOPs}(n) = C \cdot \frac{n^3}{1000} \implies C = \frac{2}{3} \approx 0.667

Viva voce questions & analytical theory

Why is LU decomposition preferred over standard Gaussian elimination when solving multiple systems Ax = b_i?

In Gaussian elimination, forward reduction modifies both the matrix A and the right-hand side vector b simultaneously in (2/3)n³ operations. If m different right-hand side vectors b_1, b_2, ..., b_m must be solved for the same coefficient matrix A, repeating Gaussian elimination requires m · (2/3)n³ operations. In contrast, LU decomposition separates the matrix factorization from the vector: factoring A into LU is performed only once in (2/3)n³ time. Thereafter, each additional system is solved via forward and back substitution (Ly = b, Ux = y) in only 2n² operations. For large m, LU decomposition is m times faster.

What is the difference between Doolittle, Crout, and Cholesky factorizations?

Doolittle factorization sets the diagonal of L to unity (l_{ii} = 1.0) while U has general diagonal entries. Crout factorization sets the diagonal of U to unity (u_{ii} = 1.0) while L has general diagonal entries. Cholesky factorization applies strictly to symmetric positive-definite matrices, setting U = Lᵀ with identical lower and upper factors A = LLᵀ, which cuts computational cost and storage in half.

Why must the permutation matrix P be stored when computing PA = LU?

Partial pivoting swaps rows dynamically during factorization to ensure numerical stability (|l_{ik}| ≤ 1). The permutation matrix P records the exact sequence of row swaps. When a new vector b arrives, the rows of b must be permuted in the exact same sequence (computing Pb) before forward substitution Ly = Pb can yield the correct intermediate vector y.

How can the matrix inverse A⁻¹ be computed using LU decomposition?

To invert an n×n matrix A, one solves n systems Ax_i = e_i for i = 1, ..., n, where e_i is the i-th column of the identity matrix. Factoring A requires (2/3)n³ operations, and solving n right-hand sides requires n · (2n²) = 2n³ operations, yielding a total cost of (8/3)n³ FLOPs. However, in numerical mathematics, explicitly computing A⁻¹ is strongly discouraged because solving Ax = b directly via LU is 4 times faster and far more numerically stable.

How is the determinant of A computed effortlessly once LU factorization is complete?

Because det(PA) = det(P) · det(A) = det(L) · det(U), and the determinant of a triangular matrix is the product of its diagonal entries: det(L) = 1 (for Doolittle) and det(U) = ∏_{i=1}^n u_{ii}. Furthermore, det(P) = (−1)^s where s is the total number of row swaps performed during pivoting. Thus, det(A) = (−1)^s · ∏_{i=1}^n u_{ii}, requiring only n multiplications once factorization is complete.

Can LU decomposition be stored in-place within the original matrix memory buffer?

Yes. In the compact Doolittle representation, the upper-triangular factor U occupies the diagonal and upper triangle of the original array A. Because L is unit lower-triangular, its diagonal entries are all 1.0 and do not need to be stored; the strictly lower triangle of array A is used to store the multipliers l_{ik}. This achieves zero memory overhead beyond an integer array of size n to store the permutation vector P.

What is the Schur complement in block LU factorization?

Partitioning A as [A₁₁ A₁₂; A₂₁ A₂₂] where A₁₁ is invertible, the block elimination step subtracts A₂₁ A₁₁⁻¹ times the first block row from the second block row, leaving the Schur complement S = A₂₂ − A₂₁ A₁₁⁻¹ A₁₂ in the lower-right block. Block algorithms in LAPACK and ScaLAPACK cast Gaussian elimination into Level-3 BLAS matrix-matrix multiplications (GEMM) on Schur complements to exploit cache hierarchies and GPU tensor cores.

Algorithm precautions and stability rules

  • Always store and apply the row permutation vector P; solving Ly = b without permuting b will yield completely wrong results.
  • Verify that matrix A is non-singular before factorization; zero pivots on U indicate singularity.
  • Use in-place overwriting of A to save memory and maximize L1/L2 CPU cache hit rates.
  • For banded or sparse matrices, use specialized sparse LU solvers (e.g. UMFPACK, SuperLU) to prevent fill-in.
  • Never invert A explicitly to solve Ax = b; always use forward and backward substitution on the LU factors.
  • Check condition number κ(A) if solutions appear sensitive to small perturbations in b.

Theoretical limitations

  • Dense LU factorization requires (2/3)n³ operations and O(n²) memory, becoming impractical for massive systems without sparsity.
  • For symmetric positive-definite matrices, Cholesky factorization is twice as fast and requires half the memory.
  • Pivoting can destroy matrix sparsity (fill-in), requiring minimum-degree or nested-dissection reordering.
↳
Connect theory to numerical computation.

The numerical simulation model executes in-place Doolittle LU factorization across dense systems from n = [10, 20, 30, 40, 50, 60]. Normalized cubic coordinate: x = n³/1000 = [1.00, 8.00, 27.00, 64.00, 125.00, 216.00]. Theoretical factorization operations: FLOPs(n) = (2/3)n³ = [0.667, 5.333, 18.000, 42.667, 83.333, 144.000] kFLOPs. Ordinary least-squares linear regression on these coordinates produces an empirical slope C = 0.66667 and Y-intercept b = 0.000 with coefficient of determination R² = 1.000000. The empirical factorization multiplier C = 0.667 matches the theoretical benchmark C = 2/3 = 0.66667 within 0.0000% deviation.