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)
Result: A = L x U
Step-by-Step Derivation (Doolittle's Method)
Doolittle's Method recurrence:
U row k: $u_{kj} = a_{kj} - \displaystyle\sum_{p=1}^{k-1} l_{kp}\, u_{pj}$ for $j \geq k$
L col k: $l_{ik} = \dfrac{1}{u_{kk}}\!\left(a_{ik} - \displaystyle\sum_{p=1}^{k-1} l_{ip}\, u_{pk}\right)$ for $i > k$
Diagonal of L: $l_{ii} = 1$
Solving Ax = b via LU
Verification: L x U = A
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