Solution (source code)

= Solution

Gaussian elimination uses first-column multipliers $-2,2,-3$, second-column multiplier $2$ in the last row, and third-column multiplier $1$ there. Recording these in a unit lower-triangular matrix gives the <LU decomposition>
$$
\boxed{L=\begin{pmatrix}1&0&0&0\\-2&1&0&0\\2&0&1&0\\-3&2&1&1\end{pmatrix},\qquad
U=\begin{pmatrix}2&-1&3&2\\0&1&2&2\\0&0&-3&2\\0&0&0&1\end{pmatrix},\qquad A=LU.}
$$
Forward substitution in $Ly=b$ gives $y=(-2,-2,8,1)^T$. Back substitution gives $x_4=1$, $-3x_3+2x_4=8$, $x_2+2x_3+2x_4=-2$, and $2x_1-x_2+3x_3+2x_4=-2$. Hence \b[the solution is]
$$
\boxed{x=(1,0,-2,1)^T.}
$$