Decompositions & applications

LU decomposition

LU decomposition writes a square matrix A as a product A = L*U, where L is lower-triangular (zeros above the diagonal) and U is upper-triangular (zeros below it). It is really just Gaussian elimination written down and remembered: U is the staircase form you reach by eliminating, and L records the multipliers you used to get there.

Why bother remembering it? Because solving A*x = b for one b is easy, but solving it for many different b is wasteful if you redo elimination each time. With L and U in hand, each new b is solved by two quick triangular sweeps (forward then backward substitution) instead of full elimination.

A small caveat for honesty: plain LU can stumble if a pivot lands on zero or something tiny, so practical software uses row swaps (this is called LU with partial pivoting, often written P*A = L*U). It is one of the workhorses behind everyday equation-solving.

[[4,3],[6,3]] = [[1,0],[1.5,1]] * [[4,3],[0,-1.5]] (A = L*U)

L holds the elimination multiplier 1.5; U is the resulting upper-triangular staircase.

Once A = L*U is computed, each extra right-hand side b costs only two cheap triangular solves.

Also called
LU factorizationLU 分解LU 因式分解lower-upper decomposition下三角-上三角分解下三角-上三角分解