LU Decomposition Calculator — 3×3 Matrix
Enter a 3×3 matrix to find its LU decomposition: L (lower triangular with unit diagonal) and U (upper triangular). The calculator performs Doolittle elimination step by step and also computes the determinant as the product of U's diagonal entries.
det(A) = u₁₁ × u₂₂ × u₃₃ (product of U diagonal)
Factor for row 2 (eliminate column 1)
Update row 2: R₂ ← R₂ − l₂₁ × R₁
Factor for row 3 (eliminate column 1)
Update row 3 step 1: R₃ ← R₃ − l₃₁ × R₁
Factor for row 3 (eliminate column 2)
Update row 3 step 2: R₃ ← R₃ − l₃₂ × R₂
Lower triangular L (unit diagonal)
Upper triangular U
- 1
First pivot u₁₁
u₁₁ = a₁₁ = 2The first pivot is the top-left entry of A — no elimination needed for row 1. - 2
Second pivot u₂₂ (after eliminating column 1)
u₂₂ = a₂₂ − l₂₁ × a₁₂ = 1 - 3
Third pivot u₃₃ (after eliminating columns 1 and 2)
u₃₃ = 2 - 4
Determinant = product of U diagonal
u₁₁ × u₂₂ × u₃₃ = 2 × 1 × 2 = 4
How does this calculator work?
LU decomposition (Doolittle) converts a 3×3 matrix A into L (lower triangular, unit diagonal) × U (upper triangular) by Gaussian elimination, recording multipliers in L and the reduced rows in U. det(A) = u₁₁ × u₂₂ × u₃₃. Fails without row swapping when any diagonal pivot equals zero.
Formula
How this is calculated
LU decomposition factors a square matrix A into a product L × U, where L is lower triangular (zeros above the diagonal) and U is upper triangular (zeros below the diagonal). In the Doolittle variant, L has 1s on its main diagonal. The decomposition is found by Gaussian elimination: for each column j from left to right, the multiplier l_ij = U[i][j] / U[j][j] is recorded and used to zero out entries below the pivot, updating the remaining rows accordingly. After all columns are processed, the multipliers fill the below-diagonal entries of L while the modified matrix becomes U.
The key application is solving linear systems Ax = b efficiently: once A = LU, first solve Ly = b by forward substitution (O(n²)), then solve Ux = y by back substitution (O(n²)), avoiding the O(n³) cost of re-factoring for each right-hand side. The determinant follows for free as the product of U's diagonal since det(L) = 1 (unit diagonal) and det(A) = det(L) × det(U).
This calculator uses Doolittle elimination without partial pivoting, which fails when a diagonal element of U becomes exactly zero. Partial pivoting (reordering rows to put the largest pivot on the diagonal) is numerically more stable and is used in production numerical libraries like LAPACK. For matrices that trigger the zero-pivot error, try reordering the rows manually, or interpret the result as "the matrix is singular or nearly so."
Frequently asked questions
Primarily to solve systems of linear equations Ax = b efficiently when the same matrix A is used with multiple right-hand sides (e.g. in iterative refinement, finite-element analysis, or circuit simulation). Factoring once (O(n³)) then solving repeatedly (O(n²) each) is much faster than Gaussian elimination for every new b. It also gives the determinant and the inverse of A cheaply.
Doolittle elimination fails when a diagonal (pivot) element of U becomes zero during elimination, making the next multiplier undefined. This occurs for singular matrices (det = 0) but also for some non-singular matrices where the algorithm happens to produce a zero intermediate pivot. Partial pivoting — swapping rows to bring the largest available element onto the diagonal — avoids this and is used in practice.
Multiply L × U and compare with the original matrix A. Each entry should match to within floating-point rounding (differences of order 1e-10 or smaller are acceptable). The determinant of A should also equal the product of the diagonal entries of U.
Also known as
TG we-Calculate Editorial Team. (2026). LU Decomposition Calculator — 3×3 Matrix [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/lu-decomposition-calculator
TG we-Calculate Editorial Team. "LU Decomposition Calculator — 3×3 Matrix." TG we-Calculate. 2026. https://we-calculate.com/calculator/lu-decomposition-calculator.
TG we-Calculate Editorial Team, "LU Decomposition Calculator — 3×3 Matrix," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/lu-decomposition-calculator
@misc{wecalculate_lu_decomposition_calculator, title = {LU Decomposition Calculator — 3×3 Matrix}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/lu-decomposition-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
