LU Decomposition Calculator
Enter a square matrix to factor it into lower and upper triangular matrices.
A square matrix from 2 by 2 to 5 by 5, rows separated by semicolons.
Result
You entered
Show the work
LU decomposition
Write the matrix as a product of a lower-triangular matrix (with 1s on its diagonal) and an upper-triangular matrix . A pivot of 0 cannot be used to clear the column below it, so rows are swapped, and the swaps are recorded in a permutation matrix .
Using
Row swaps for a zero pivot
A zero in the pivot position cannot be used, so the row is swapped with a lower row that has a non-zero entry in that column. 1 swap was needed.
Multipliers for one column
Each multiplier is the entry to clear divided by the pivot in column 1. Subtracting that multiple of the pivot row from row makes the entry 0, and is stored in .
Using
Check by multiplying back
Multiplying by should give .
Result
So .