We first write the given system of equations in matrix form
(AX=B) and then solve it.
⎡⎢⎣1−1121−3111⎤⎥⎦⎡⎢⎣xyz⎤⎥⎦=⎡⎢⎣402⎤⎥⎦
We reduce the matrix A in identity matrix by performing row operations to determine the variables
R2→R2−2R1 and R3→R3−R1 we get
⎡⎢⎣1−1103−5020⎤⎥⎦⎡⎢⎣xyz⎤⎥⎦=⎡⎢⎣4−8−2⎤⎥⎦
R1→R1+13R2 and R3→R3−23R2, we get
⎡⎢
⎢
⎢⎣10−2303−500103⎤⎥
⎥
⎥⎦⎡⎢⎣xyz⎤⎥⎦=⎡⎢
⎢
⎢⎣43−8103⎤⎥
⎥
⎥⎦
R2→R23 we get
⎡⎢
⎢
⎢⎣10−2301−5300103⎤⎥
⎥
⎥⎦⎡⎢⎣xyz⎤⎥⎦=⎡⎢
⎢
⎢⎣43−83103⎤⎥
⎥
⎥⎦
R1→R1+15R3 and R2→R2+12R3 we get
⎡⎢
⎢⎣10001010103⎤⎥
⎥⎦⎡⎢⎣xyz⎤⎥⎦=⎡⎢
⎢⎣2−1103⎤⎥
⎥⎦
R3→R3×310, we get
⎡⎢⎣100010101⎤⎥⎦⎡⎢⎣xyz⎤⎥⎦=⎡⎢⎣2−11⎤⎥⎦
∴ x=2,y=−1 and z=1