Solution (source code)

= Solution

<Gaussian elimination> without pivoting gives
$$
A=LU,
\quad
L=\begin{pmatrix}1&0&0&0\\2&1&0&0\\1&3&1&0\\2&2&2&1\end{pmatrix},
\quad
U=\begin{pmatrix}1&2&1&2\\0&1&3&2\\0&0&3&6\\0&0&0&\lambda-20\end{pmatrix}.
$$
Thus $\det A=3(\lambda-20)$ and the solution is unique exactly when \b[$\lambda\ne20$].

For $\lambda=20$, <forward substitution in a triangular system> in $Ly=b$ gives $y=(1,1,3,\mu-10)^T$. Consistency of $Ux=y$ requires $\boxed{\mu=10}$. <backward substitution in a triangular system> then gives
$$
\boxed{x=(4-8t,\ 4t-2,\ 1-2t,\ t)^T,\qquad t\in\mathbb R.}
$$