# Solve by matrix method : $x+y+z=20, \: 2x+y-z=23, \: 3x+y+z=46$

Toolbox:
• If the value of a 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|} (adjoint A)$
• $A^{-1}B=X$
Step 1:
Given $x+y+z=20, \: 2x+y-z=23, \: 3x+y+z=46$
This system of the equation is of the form $AX=B$
$(ie)\begin{bmatrix} 1 & 1 & 1 \\ 2 & 1 & -1 \\ 3 & 1 & 1 \end{bmatrix}\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\begin{bmatrix} 20 \\ 23 \\ 46 \end{bmatrix}$
where $A=\begin{bmatrix} 1 & 1 & 1 \\ 2 & 1 & -1 \\ 3 & 1 & 1 \end{bmatrix}\qquad X=\begin{bmatrix} x \\ y \\ z \end{bmatrix}\;and \; B=\begin{bmatrix} 20 \\ 23 \\ 46 \end{bmatrix}$
Let us first find the determinant value of A,by expanding along $R_1$
$|A|=1(1 \times 1 - 1 \times -1)-1(2 \times 1-3 \times -1)+1(2 \times 1-3\times 1)$
$=2-5-1$
$=-4$
$|A| \neq 0$
Hence it is a non singular matrix and inverse exists
Step 2:
Next let us find the adjoint of A
$A_{11}=(-1)^{1+1} \begin{vmatrix} 1 & -1 \\ 1 & 1 \end{vmatrix}=1+1=2$
$A_{12}=(-1)^{1+2} \begin{vmatrix} 2 & -1 \\ 3 & 1 \end{vmatrix}=-(2+3)=-5$
$A_{13}=(-1)^{1+3} \begin{vmatrix} 2 & 1 \\ 3 & 1 \end{vmatrix}=2-3=-1$
$A_{21}=(-1)^{2+1} \begin{vmatrix} 1 & 1 \\ 1 & 1 \end{vmatrix}=0$
$A_{22}=(-1)^{2+2} \begin{vmatrix} 1 & 1 \\ 3 & 1 \end{vmatrix}=1-3=-2$
$A_{23}=(-1)^{2+3} \begin{vmatrix} 1 & 1 \\ 3 & 1 \end{vmatrix}=-(1-3)=2$
$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)=3$
$A_{33}=(-1)^{3+3} \begin{vmatrix} 1 & 1 \\ 2 & 1 \end{vmatrix}=1-2=-1$
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 & 0 & -2 \\ -5 & -2 & 3 \\ -1 & 2 & -1 \end{bmatrix}$
Step 3:
$A^{-1}=\frac{1}{|A|} adj (A),$
we know $|A|=-4$
Hence $A^{-1}=\large\frac{1}{-4}\begin{bmatrix} 2 & 0 & -2 \\ -5 & -2 & 3 \\ -1 & 2 & -1 \end{bmatrix}$
$AX=B \qquad => X=A^{-1}B$
$\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\large\frac{1}{-4}\begin{bmatrix} 2 & 0 & -2 \\ -5 & -2 & 3 \\ -1 & 2 & -1 \end{bmatrix} \begin{bmatrix} 20 \\ 23 \\ 46 \end{bmatrix}$
$\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\large\frac{1}{-4}\begin{bmatrix} 40+0+-92 \\ -100-46+138 \\ -20+46-46 \end{bmatrix}=\begin{bmatrix} \frac{-52}{-4} \\ \frac{-8}{-4} \\ \frac{-20}{-4} \end{bmatrix}$
$\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\begin{bmatrix} 13 \\ 2 \\ 5 \end{bmatrix}$
Therefore $x=13,y=2,and \; z=5$