LU decomposition of $$$\left[\begin{array}{cccc}1 & 2 & 0 & 1\\2 & 4 & 1 & 4\\3 & 6 & 3 & 9\end{array}\right]$$$
Related calculator: QR Factorization Calculator
Your Input
Find the LU decomposition of $$$\left[\begin{array}{cccc}1 & 2 & 0 & 1\\2 & 4 & 1 & 4\\3 & 6 & 3 & 9\end{array}\right]$$$.
Solution
Start from the identity matrix $$$L = \left[\begin{array}{ccc}1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end{array}\right]$$$.
Subtract row $$$1$$$ multiplied by $$$2$$$ from row $$$2$$$: $$$R_{2} = R_{2} - 2 R_{1}$$$.
$$$\left[\begin{array}{cccc}1 & 2 & 0 & 1\\0 & 0 & 1 & 2\\3 & 6 & 3 & 9\end{array}\right]$$$
Write the coefficient $$$2$$$ in the matrix $$$L$$$ at row $$$2$$$, column $$$1$$$:
$$$L = \left[\begin{array}{ccc}1 & 0 & 0\\2 & 1 & 0\\0 & 0 & 1\end{array}\right]$$$
Subtract row $$$1$$$ multiplied by $$$3$$$ from row $$$3$$$: $$$R_{3} = R_{3} - 3 R_{1}$$$.
$$$\left[\begin{array}{cccc}1 & 2 & 0 & 1\\0 & 0 & 1 & 2\\0 & 0 & 3 & 6\end{array}\right]$$$
Write the coefficient $$$3$$$ in the matrix $$$L$$$ at row $$$3$$$, column $$$1$$$:
$$$L = \left[\begin{array}{ccc}1 & 0 & 0\\2 & 1 & 0\\3 & 0 & 1\end{array}\right]$$$
Since the element at row $$$2$$$ and column $$$2$$$ (pivot element) equals $$$0$$$, we need to swap the rows.
Find the first nonzero element in column $$$2$$$ under the pivot entry.
As can be seen, there are no such entries. This means that we are done.
The obtained matrix is the matrix $$$U$$$.
Answer
$$$L = \left[\begin{array}{ccc}1 & 0 & 0\\2 & 1 & 0\\3 & 0 & 1\end{array}\right]$$$A
$$$U = \left[\begin{array}{cccc}1 & 2 & 0 & 1\\0 & 0 & 1 & 2\\0 & 0 & 3 & 6\end{array}\right]$$$A