Question:
$x+y=1$
$x+z=-6$
$x-y-2 z=3$
Solution:
These equations can be written as
$x+y+0 z=1$
$x+0 y+z=-6$
$x-y-2 z=3$
$D=\left|\begin{array}{ccc}1 & 1 & 0 \\ 1 & 0 & 1 \\ 1 & -1 & -2\end{array}\right|$
$=1(0+1)-1(-2-1)+0(-1-0)$
$=4$
$D_{1}=\left|\begin{array}{ccc}1 & 1 & 0 \\ -6 & 0 & 1 \\ 3 & -1 & -2\end{array}\right|$
$=1(0+1)-1(12-3)+0(6-0)$
$=-8$
$D_{2}=\left|\begin{array}{ccc}1 & 1 & 0 \\ 1 & -6 & 1 \\ 1 & 3 & -2\end{array}\right|$
$=1(12-3)-1(-2-1)+0(3+6)$
$=12$
$D_{3}=\left|\begin{array}{ccc}1 & 1 & 1 \\ 1 & 0 & -6 \\ 1 & -1 & 3\end{array}\right|$
$=1(0-6)-1(3+6)+1(-1-0)$
Now,
$x=\frac{D_{1}}{D}=\frac{-8}{4}=-2$
$y=\frac{D_{2}}{D}=\frac{12}{4}=3$
$z=\frac{D_{3}}{D}=\frac{-16}{4}=-4$
$\therefore x=-2, y=3$ and $z=-4$