# Using matrices, solve the following system of linear equations: $$x + y + z = 4$$ $$2x - y + z = -1$$ $$2x + y - 3z = -9$$

Toolbox:
• If the value of determinant of a $3 \times 3$ square matrix is not equal to zero, then it is a non-singular matrix
• If it is a nonsingular matrix, then inverse exists
• $A^{-1}=\frac{1}{|A|} adj (A)$
• $A^{-1}B=X$
Step 1:
Given $x+y+z=4,2x-y+z=-1,2x+y-3z=-9$
The above system of the equation is of the form $AX=B$
$(ie)\begin{bmatrix} 1 & 1 & 1 \\ 2 & -1 & 1 \\ 2 & 1 & -3 \end{bmatrix}\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\begin{bmatrix} 4 \\ -1 \\ -9 \end{bmatrix}$
where $A=\begin{bmatrix} 1 & 1 & 1 \\ 2 & -1 & -1 \\ 2 & 1 & -3 \end{bmatrix}\qquad X=\begin{bmatrix} x \\ y \\ z \end{bmatrix}\;and \; B=\begin{bmatrix} 4 \\ -1 \\ -9 \end{bmatrix}$
Let us first find the determinant of A
$|A|=1(-1 \times -3 - 1 \times 1)-1(2 \times -3-2 \times 1)+1(2 \times 1- 2 \times 1)$
$=2+8+4$
$=14 \neq 0$
Hence this is a non singular matrix and $A^{-1}$ exists
Step 2:
let us now find the adjoint of A
$A_{11}=(-1)^{1+1} \begin{vmatrix} -1 & 1 \\ 1 & -3 \end{vmatrix}=3-1=2$
$A_{12}=(-1)^{1+2} \begin{vmatrix} 2 & 1 \\ 2 & -3 \end{vmatrix}=-(-6-2)=8$
$A_{13}=(-1)^{1+3} \begin{vmatrix} 2 & -1 \\ 2 & 1 \end{vmatrix}=2+2=4$
$A_{21}=(-1)^{2+1} \begin{vmatrix} 1 & 1 \\ 1 & -3 \end{vmatrix}=-(-3-1)=4$
$A_{22}=(-1)^{2+2} \begin{vmatrix} 1 & 1 \\ 2 & -3 \end{vmatrix}=-3-2=-5$
$A_{23}=(-1)^{2+3} \begin{vmatrix} 1 & 1 \\ -1 & 1 \end{vmatrix}=-(1-2)=1$
$A_{31}=(-1)^{3+1} \begin{vmatrix} 1 & 1 \\ -1 & 1 \end{vmatrix}=1+1=2$
$A_{32}=(-1)^{3+2} \begin{vmatrix} 1 & 1 \\ 2 & 1 \end{vmatrix}=-(1-2)=1$
$A_{33}=(-1)^{3+3} \begin{vmatrix} 1 & 1 \\ 2 & -1 \end{vmatrix}=-1-2=-3$
Adj $A=\begin{bmatrix} A_{11} & A_{21} & A_{31} \\ A_{12} & A_{22} & A_{32} \\ A_{13} & A_{23} & A_{33} \end{bmatrix}$
$=\begin{bmatrix} 2 & 4 & 2 \\ 8 & -1 & 1 \\ 4 & 1 & -3 \end{bmatrix}$
step 3:
Therefore $AX=B => X=A^{-1}B$
$A^{-1}=\frac{1}{|A|} adj (A),$ we know $|A|=12$
Hence $A^{-1}=\frac{1}{12}\begin{bmatrix} 2 & 4 & 2 \\ 8 & -1 & 1 \\ 4 & 1 & -3 \end{bmatrix}$
$AX=B \qquad => X=A^{-1}B$
Now Substituting for $X, A^{-1}$ and B we get
$\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\frac{1}{14}\begin{bmatrix} 2 & 4 & 2 \\ 8 & -5 & 1 \\ 4 & 1 & -3 \end{bmatrix} \begin{bmatrix} 4 \\ -1 \\ -9 \end{bmatrix}$
$\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\frac{1}{14}\begin{bmatrix} 8-4-18 \\ 32+5-9 \\ 16-1+27 \end{bmatrix}=\begin{bmatrix} -\frac{14}{14} \\ \frac{28}{14} \\ \frac{42}{14} \end{bmatrix}$
$\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\begin{bmatrix} -1 \\ 2 \\ 3 \end{bmatrix}$
Therefore $x=-1,y=2,z=3$