LU decomposition by hand Can someone show me a step by step solution to calculate the $LU$ decompisition of the following matrix:
$A =  \begin{bmatrix}
      5 & 5 & 10 \\
      2 & 8 & 6  \\
      3 & 6 & -9
      \end{bmatrix}$
I am getting the correct U by I am having difficult getting the correct L. 
Here is the correct Answer
 A: $A =  \begin{pmatrix}
      5 & 5 & 10 \\
      2 & 8 & 6  \\
      3 & 6 & -9
      \end{pmatrix}$
First step (working on the first column):
a) Multiply the first row with $l_{21}= \frac{2}{5}$ and subtract it from row 2
b) Multiply the first row with $l_{31}= \frac{3}{5}$ and subtract it from row 2
This leads to
$U^{(1)} = \begin{pmatrix}
           5 & 5 & 10 \\
           0 & 6 & 2  \\
           0 & 3 & -15
           \end{pmatrix}$
Second step (working on the second column):
c) Multiply row 2 with $l_{32} = \frac{1}{2}$ and subtract it from row 3.  This gives 
$U = U^{(2)} = \begin{pmatrix}
               5 & 5 & 10 \\
               0 & 6 & 2  \\
               0 & 0 & -16
               \end{pmatrix}$
And we have 
$L = \begin{pmatrix}
     1 & 0 & 0 \\
     l_{21} & 1 & 0 \\
     l_{31} & l_{32} & 1
     \end{pmatrix}
  = \begin{pmatrix}
     1 & 0 & 0 \\
     \frac{2}{5} & 1 & 0 \\
     \frac{3}{5} & \frac{1}{2} & 1
     \end{pmatrix}
$
So note that $l_{ij}$ was used to create a zero in the $i$-th row and $j$-th column by multiplying (in the $j$-th step) the $j$-th row with $l_{ij}$ and subtract the result from the $i$-th row.
A: First you want to form $U$, i.e. find some $M$ such that $MA = U$. Now recall that $A = LU$, which means that $L = AU^{-1}=A(MA)^{-1}=AA^{-1}M^{-1}=M^{-1}$. 
So you now have computed both $L$ and $U$.
