\ LU Decomposition Steps Calculator

LU Decomposition Steps Calculator

Decompose any square matrix into L, U, and P with guided steps. See elimination steps, pivots, and multipliers at every stage for full clarity. Solve systems using forward substitution and back substitution walkthroughs with explanations. Export CSV and PDF reports instantly for documentation needs.


Example data table

This example is preloaded above. Modify any value to explore behavior.

Example A (3×3):
430
34-1
0-14
Example b:
24
30
-24
Formula used

We factor a square matrix A into lower and upper triangular matrices such that A = L·U (without pivoting) or P·A = L·U (with partial pivoting). Here, L is unit lower triangular (ones on the diagonal) and U is upper triangular.

  • At column k, choose a pivot Ukk. With pivoting, pick the row with maximal |Uik| for i ≥ k.
  • For each i > k, compute the multiplier lik = Uik / Ukk, set Lik = lik, then replace row i by rowi − lik·rowk.
  • Repeat for k = 1…n−1. Swapping rows updates the permutation matrix P and the previously formed part of L.

To solve A·x = b, with pivoting compute P·b, then forward substitution L·y = P·b, followed by back substitution U·x = y.

How to use this calculator
  1. Select matrix size and precision. Optionally enable partial pivoting.
  2. Enter your A values. Optionally check “Solve Ax = b” and enter b.
  3. Click Compute LU to display L, U, P, and step-by-step elimination.
  4. Use Download CSV to export matrices, or Download PDF to capture the results area.
Understanding each LU elimination step

At step k, we select a pivot in column k, form multipliers lik = Uik/Ukk, and apply row updates to zero entries below the pivot. The displayed “U after eliminating column k” shows the matrix after these operations.

  • Multipliers fill column k of L beneath the diagonal.
  • Unit diagonal ensures L has ones along its diagonal.
  • Numerical note: very small pivots can amplify rounding errors.
Permutation matrix, swaps, and stability

Partial pivoting swaps the current row with the row having the largest absolute entry in the active column. This produces a permutation matrix P so that P·A = L·U, improving stability by avoiding tiny pivots.

  • P interpretation: row i of P has a single 1 at column p(i).
  • Determinant sign flips with each row swap; det(P)=±1.
  • When to pivot: always, for robustness on general dense matrices.
Verifying the factorization and solution

After computing L, U (and P if pivoting), you can verify results with residual checks. This tool presents exact arithmetic snapshots, but you may still assess quality numerically.

  1. Factorization residual: compute ‖P·A − L·U‖ to confirm accuracy.
  2. Solution residual: if solving, check ‖A·x − b‖; smaller is better.
  3. Conditioning: ill‑conditioned A can magnify small data errors.
Enter your matrix and press Compute LU to view results and detailed steps.
Meta: Compute LU factorization with clear elimination steps and pivots. Shows pivots, multipliers, and intermediate matrices clearly. Export results to CSV and PDF with one click.

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.