LU Decomposition Calculator
Decompose a square matrix into lower (L) and upper (U) triangular matrices.
Select Matrix Size
Results
Original Matrix:
Lower Triangular Matrix (L):
Upper Triangular Matrix (U):
Verification (L × U):
Step-by-Step Solution
How LU Decomposition Works
LU decomposition factors a square matrix A into:
\[ A = LU \]
where:
- L is a lower triangular matrix with ones on the diagonal
- U is an upper triangular matrix
Properties:
- L has ones on the diagonal and zeros above
- U has zeros below the diagonal
- Not all matrices have an LU decomposition
- If A is invertible, the decomposition is unique
Applications:
- Solving systems of linear equations
- Matrix inversion
- Determinant calculation
- Eigenvalue computation
Algorithm Steps:
- Initialize L as identity matrix and U as copy of A
- For each column j:
- For each row i > j:
- Calculate multiplier: L[i][j] = U[i][j] / U[j][j]
- Subtract L[i][j] × row j from row i in U
- For each row i > j: