The main idea of the LU decomposition is to record the steps used in Gaussian elimination on A in the places where the zero is produced. Consider the matrix
\begin{equation*}
A = \left(\begin{array}{ccc}1 & -2 & 3 \\ 2 & -5 & 12 \\ 0 & 2 & -10\end{array}\right)\text{.}
\end{equation*}
The first step of Gaussian elimination is to subtract \(2\) times the first row from the second row. In order to record what we have done, we will put the multiplier, \(2\text{,}\) into the place it was used to make a zero, i.e. the second row, first column. In order to make it clear that it is a record of the step and not an element of \(A\text{,}\) we will put it in parentheses. This leads to
\begin{equation*}
\left(\begin{array}{ccc}1 & -2 & 3 \\ (2) & -1 & 6 \\ 0 & 2 & -10\end{array}\right)\text{.}
\end{equation*}
There is already a zero in the lower left corner, so we don’t need to eliminate anything there. We record this fact with a \((0)\text{.}\) To eliminate the third row, second column, we need to subtract \(-2\) times the second row from the third row. Recording the \(-2\) in the spot it was used we have
\begin{equation*}
\left(\begin{array}{ccc}1 & -2 & 3 \\ (2) & -1 & 6 \\ (0) & (-2) & 2\end{array}\right)\text{.}
\end{equation*}
Let \(U\) be the upper triangular matrix produced, and let \(L\) be the lower triangular matrix with the records and ones on the diagonal, i.e.
\begin{equation*}
L = \left(\begin{array}{ccc}1 & 0 & 0 \\ 2 & 1 & 0 \\ 0 & -2 & 1\end{array}\right) \quad\text{and}\quad U = \left(\begin{array}{ccc}1 & -2 & 3 \\ 0 & -1 & 6 \\ 0 & 0 & 2\end{array}\right)\text{,}
\end{equation*}
then we have the following wonderful property:
\begin{equation*}
LU = \left(\begin{array}{ccc}1 & 0 & 0 \\ 2 & 1 & 0 \\ 0 & -2 & 1\end{array}\right) \left(\begin{array}{ccc}1 & -2 & 3 \\ 0 & -1 & 6 \\ 0 & 0 & 2\end{array}\right) = \left(\begin{array}{ccc}1 & -2 & 3 \\ 2 & -5 & 12 \\ 0 & 2 & -10\end{array}\right) = A\text{.}
\end{equation*}
Thus we see that \(A\) is actually the product of \(L\) and \(U\text{.}\) Here \(L\) is lower triangular and \(U\) is upper triangular. When a matrix can be written as a product of simpler matrices, we call that a decomposition of \(A\) and this one we call the LU decomposition.