LU Decomposition Calculator
Decompose a square matrix into lower (L) and upper (U) triangular factors with partial pivoting (PA=LU), showing determinant and permutation.
Input
Enter one matrix row per line, separating entries with spaces or commas (square matrices only).
Result
Determinant det(A)
-36
Size
3 × 3
Determinant
-36
Permutation (row order)
2, 3, 1
Lower triangular matrix L
All diagonal entries are 1.
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0.667 | 0.2 | 1 |
Upper triangular matrix U
The product of the diagonal entries gives the determinant.
| 6 | 3 | 0 |
| 0 | 5 | 6 |
| 0 | 0 | -1.2 |
How it works
- LU decomposition factors a square matrix A into a lower-triangular matrix L (with ones on the diagonal) and an upper-triangular matrix U. For numerical stability, partial pivoting is used, so the result is expressed as PA=LU where P is the row permutation.
- The computation uses Gaussian elimination (the Doolittle method). In each column the entry with the largest absolute value is chosen as the pivot, and the rows below it are eliminated. The multipliers used for elimination become the corresponding entries of L.
- The determinant equals the product of U's diagonal entries times a sign of (-1) raised to the number of row swaps. If a pivot becomes zero, the matrix is singular and cannot be decomposed.
- Enter one matrix row per line, separating the entries with spaces or commas. Only square matrices with an equal number of rows and columns are supported.
- Displayed values are rounded to three decimal places, so the product of the shown factors may differ slightly from the original matrix due to rounding.
Reviews
Tell us what you think of this calculator.
Write a review
- Home
LU Decomposition Calculator