Matrix:

LU Decomposition Result:

Lower Triangular Matrix (L):

Upper Triangular Matrix (U):

Steps to Perform LU Decomposition:

  1. Start with a square matrix (A) (n x n).
  2. Initialize an identity matrix (L) for the lower triangular matrix and a zero matrix (U) for the upper triangular matrix.
  3. For each pivot element in matrix (A), apply Gaussian elimination to eliminate the elements below the pivot, updating (L) and (U) accordingly.
  4. The diagonal elements of (U) remain as pivots, and (L) contains the multipliers used during elimination.
  5. Resulting matrices satisfy ( A = L * U ) .