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

Toolbox:
• If the value of the determinant of a $3\times 3$ matrix is not equal to zero,then it is a non-singular matrix.
• If it is a non-singular matrix,then inverse exists.
• $A^{-1}=\frac{1}{|A|}$adjoint of A
• $A^{-1}B=X$
Step 1:
The given system of equation is of the form AX=B.
(i.e)$\begin{bmatrix}2 & 1& 1\\1 &3 & -1\\3 & 1 & -2\end{bmatrix}\begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}2\\5\\6\end{bmatrix}$
Where $A=\begin{bmatrix}2 & 1&1\\1 & 3 & -1\\3 & 1 &-2\end{bmatrix},X=\begin{bmatrix}x\\y\\z\end{bmatrix}$ and $B=\begin{bmatrix}2\\5\\6\end{bmatrix}$
Let us now find the determinant value of A
$|A|=2(3\times -2-1\times -1)-1(1\times -2-3\times 1)+1(1\times 1-3\times 3)$
$\;\;=-10-1-8=-19\neq 0.$
Hence $A^{-1}$ exists.
Step 2:
Now let us find the cofactor of the elements of matrix A
$A_{11}=(-1)_{1+1}\begin{vmatrix}3 & -1\\1 & -2\end{vmatrix}$=-6+1=-5.
$A_{12}=(-1)_{1+2}\begin{vmatrix}1 & -1\\3 & -2\end{vmatrix}$=-(-2+3)=-1.
$A_{13}=(-1)_{1+3}\begin{vmatrix}1 & 3\\3 & 1\end{vmatrix}$=1-9=-8.
$A_{21}=(-1)_{2+1}\begin{vmatrix}1 & 1\\1 & -2\end{vmatrix}$=-(-2-1)=3.
$A_{22}=(-1)_{2+2}\begin{vmatrix}2 & 1\\3 & -2\end{vmatrix}$=-4-3=-7.
$A_{23}=(-1)_{2+3}\begin{vmatrix}2 & 1\\3 & 1\end{vmatrix}$=-(2-3)=1.
$A_{31}=(-1)_{3+1}\begin{vmatrix}1 & 1\\3 & -1\end{vmatrix}$=-1-3=-4.
$A_{32}=(-1)_{1+1}\begin{vmatrix}2 & 1\\1 & -1\end{vmatrix}$=-(-2-1)=3.
$A_{33}=(-1)_{3+3}\begin{vmatrix}2 & 1\\1 & 3\end{vmatrix}$=6-1=5.
Hence the adjoint of A is $\begin{bmatrix}A_{11} & A_{21} & A_{31}\\A_{12} & A_{22} & A_{32}\\A_{13} & A_{23} & A_{33}\end{bmatrix}$
$\qquad\qquad\qquad\qquad=\begin{bmatrix}-5 & 3 & -4\\1 & -7 & 3\\-8& 1& 5\end{bmatrix}$
$A^{-1}=\frac{1}{|A|}adj(A)$,we know |A|=-19.
$A^{-1}=\frac{1}{-19}\begin{bmatrix}-5 & 3 & 4\\-1 & -7 & 3\\-8 & 1 & 5\end{bmatrix}$
Step 3:
$A^{-1}B=X$,substituting for $A^{-1}$,B and X we get
$\begin{bmatrix}x\\y\\z\end{bmatrix}=\frac{1}{-19}\begin{bmatrix}-5 & 3& 4\\-1 &-7 & 3\\-8 & 1 & 5\end{bmatrix}\begin{bmatrix}2\\5\\6\end{bmatrix}$
$\begin{bmatrix}x\\y\\z\end{bmatrix}=\frac{-1}{19}\begin{bmatrix}-10+15-24\\-2-35+18\\-16+5+30\end{bmatrix}=\begin{bmatrix}\frac{-19}{-19}\\\frac{-19}{-19}\\\frac{19}{-19}\end{bmatrix}$
$\begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}1\\1\\-1\end{bmatrix}$
x=1,y=1 and z=-1.