LU Decomposition Calculator
LU decomposition factors a square matrix into a lower triangular matrix L and an upper triangular matrix U such that PA = LU, and this calculator shows both factors. Shows the lower triangular L, upper triangular U, and permutation matrix P with full elimination steps.
LU Decomposition (Doolittle)
PA = LU with partial pivoting
LU Decomposition
LU decomposition factors a square matrix A as a product of a lower triangular matrix L and an upper triangular matrix U: A = LU (or PA = LU with partial pivoting for numerical stability).
Structure
- L: Lower triangular with 1s on diagonal — stores the elimination multipliers
- U: Upper triangular — the result of Gaussian elimination
- P: Permutation matrix — records row swaps for partial pivoting
Applications
- Solving Ax = b efficiently (forward/backward substitution)
- Computing determinants: det(A) = det(L)×det(U) = product of diagonal of U
- Computing matrix inverse for multiple right-hand sides
Worked Example (2×2)
For A = [[4,3],[6,3]]: L = [[1,0],[1.5,1]] and U = [[4,3],[0,-1.5]]. Multiplying L by U gives back the original matrix A, confirming the decomposition is correct.
Why Use LU Instead of Solving Directly?
Once you have L and U for a matrix, you can solve Ax = b for many different values of b very quickly, without redoing the full elimination process each time — useful when the same system needs solving repeatedly with different inputs.
Frequently Asked Questions
Related Calculators
- Determinant Calculator — the determinant can be read from U's diagonal
- Linear System Solver — LU makes solving repeated systems faster