Input
What Is LU Decomposition?
LU decomposition factors a square matrix A into the product L U, sometimes with a permutation matrix P when pivoting is required. Here L is lower triangular with ones on the diagonal, and U is upper triangular. The factorization mirrors Gaussian elimination by recording the elimination multipliers inside L while the transformed system becomes U. After computing L and U once, you can solve Ax = b by forward substitution Ly = Pb followed by back substitution Ux = y. This makes LU ideal for repeated solves with the same matrix, sensitivity analysis, and computing determinants or inverses. Pivoting is important for numerical stability because it avoids zero or tiny pivots that would magnify rounding errors. In practice, libraries return P, L, and U such that PA = LU. Determinants are easy to obtain as the product of the diagonals of U times the sign of the permutation. The method underpins many applications including engineering simulation, optimization, signal processing, and machine learning, and provides a clear, step by step view of how elimination transforms matrices. It also aids error analysis.
Results
Enter your matrix and press Compute LU to view P, L, U and detailed elimination steps.