Home Blog Tools

LU Decomposition Calculator

Factor any square matrix into A = LU using Doolittle's method — every entry of L and U derived step by step. Optionally solve Ax = b using forward and back substitution.

Matrix Setup
Also solve Ax = b  (toggle to enable)
LU Decomposition -- Theory
What is LU Decomposition?
Any square matrix A (without row swaps needed) can be written as A = LU where L is lower triangular with 1s on the diagonal (Doolittle form) and U is upper triangular.
Why use LU Decomposition?
Solving Ax = b becomes two triangular systems:
1. Forward substitution: Solve Ly = b
2. Back substitution: Solve Ux = y
Determinant shortcut: $\det(A) = \det(L) \cdot \det(U) = 1 \cdot \displaystyle\prod_{i=1}^{n} u_{ii}$

LU decomposition (Doolittle method)

LU decomposition writes A = LU, where L is lower triangular with 1s on the diagonal (Doolittle) and U is upper triangular. To solve Ax = b, solve Ly = b by forward substitution and then Ux = y by back substitution. If a zero pivot appears, rows must be exchanged, giving PA = LU. Without row exchanges, det(A) is the product of the diagonal entries of U.

Common questions

Why use LU decomposition?

Once A is factorised, many right-hand sides b can be solved quickly by two simple substitutions.

Does every matrix have an LU decomposition?

Not always without row exchanges; with a permutation matrix P, PA = LU exists for any invertible matrix.

More tools: all free maths calculators · previous year papers · practice quizzes