LU Decomposition — Definition, Formula & Examples
LU Decomposition is a way of breaking a square matrix into the product of a lower triangular matrix and an upper triangular matrix , so that . This factorization makes solving systems of linear equations faster, especially when you need to solve multiple systems with the same coefficient matrix.
Given a square matrix , an LU decomposition (when it exists) expresses as the product , where is a lower triangular matrix with ones on its diagonal (unit lower triangular) and is an upper triangular matrix. The entries of and are determined by Gaussian elimination without row swaps; if row swaps are needed, a permutation matrix is introduced so that .
Key Formula
Where:
- = The original square matrix being decomposed
- = Lower triangular matrix (1s on the diagonal)
- = Upper triangular matrix (the row-echelon form of A)
How It Works
You perform Gaussian elimination on to reach an upper triangular form . Each multiplier used to eliminate an entry below the pivot is stored in the corresponding position of , and the diagonal of is set to 1. To solve , you first solve by forward substitution, then solve by back substitution. Because and are triangular, each substitution step is fast — instead of .
Worked Example
Problem: Find the LU decomposition of A = [[2, 1], [6, 4]].
Step 1: Eliminate the entry below the pivot in column 1. The multiplier is 6/2 = 3. Subtract 3 times row 1 from row 2.
Step 2: The upper triangular matrix U is the result of elimination, and L stores the multiplier 3 below the diagonal.
Step 3: Verify by multiplying L and U.
Answer: L = [[1, 0], [3, 1]] and U = [[2, 1], [0, 1]].
Why It Matters
LU Decomposition is essential in numerical linear algebra and scientific computing. Engineers and physicists use it to solve large systems of equations efficiently — for instance, in finite element analysis or circuit simulation, where the same coefficient matrix appears with many different right-hand sides.
Common Mistakes
Mistake: Assuming every square matrix has an LU decomposition without row swaps.
Correction: If a zero pivot is encountered during elimination, you must introduce a permutation matrix P so that PA = LU. Not every matrix can be factored as A = LU directly.
