The algorithm is that(1)you should reduce A to rref from Uwithoutrow interchanges, keeping track of the multipliers you used to introduce leading 1's. And multipliers you used to get zeros below the leading 1's.(2)In each position along the main diagonal of L, place the reciprocal of the multiplier that introduced the leading 1 in that position in U.(3)In each position below the main diagonal of L, place the negative of the multiplier used to introduce the zero in that position in U. Now you can form the decomposition A=LU, have you tried following this algorithm?