LU decomposition is the matrix form of Gaussian elimination. Once A = LU is known, any system Ax = b is solved quickly by forward and back substitution – ideal when solving with many right-hand sides.
How to use the LU Decomposition Calculator
- Choose the matrix size – the matching grid of fields appears.
- Enter the entries row by row (a₁ b₁ c₁ is the first row, a₂ b₂ c₂ the second, and so on).
- Read the result; integer matrices give exact fractions.
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Doolittle’s algorithm computes the rows of U and the columns of L in turn. If a zero pivot appears, rows are swapped and the permutation is reported.
Formula
A = L·U (or P·A = L·U with a permutation matrix P)
Worked example
Inputs — Matrix size: 3 × 3; a₁: 4; b₁: 1; c₁: 2; a₂: 1; b₂: 3; c₂: 0; a₃: 2; b₃: 0; c₃: 5.
Results — Result = A = L·U; L (lower triangular) = ⎡ 1 0 0 ⎤
⎢ 1/4 1 0 ⎥
⎣ 1/2 −2/11 1 ⎦; U (upper triangular) = ⎡ 4 1 2 ⎤
⎢ 0 11/4 −1/2 ⎥
⎣ 0 0 43/11 ⎦.
Key terms
- Triangular matrix
- A matrix with zeros above (lower) or below (upper) the diagonal.
Frequently asked questions
Does every matrix have an LU decomposition?
Every invertible matrix has a PA = LU decomposition; without row swaps it may not exist.
What is the determinant from LU?
The product of U's diagonal (times ±1 for swaps).
How do I solve Ax = b with LU?
Solve Ly = Pb, then Ux = y.
What is Doolittle vs Crout?
Doolittle puts ones on L's diagonal, Crout on U's.