# Using matrices, solve the following system of equations : $x+2y+z=7, x+3z=11 \: and \: 2x-3y=1$

Toolbox:
• If |A| of a matrix A is non zero, then it is a non-singular matrix
• If it is a nonsingular matrix, then inverse exists
• $AX=B => A^{-1}B=X$
The given system of equation is of the form
$x+2y+z=7,x+3z=11,2x-3y=1$
This is of the form
$AX=B$
$(ie)\begin{bmatrix} 1 & 2 & 1 \\ 1 & 0 & 3 \\ 2 & -3 & 0 \end{bmatrix}\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\begin{bmatrix} 7 \\ 11 \\ 1 \end{bmatrix}$
Where $A=\begin{bmatrix} 1 & 2 & 1 \\ 1 & 0 & 3 \\ 2 & -3 & 0 \end{bmatrix}\qquad X=\begin{bmatrix} x \\ y \\ z \end{bmatrix}\;and \; B=\begin{bmatrix} 7 \\ 11 \\ 1 \end{bmatrix}$
Let us first find if matrix A is singular or nonsingular.
Let us find the determinant of A,
$|A|=\begin{bmatrix} 1 & 2 & 1 \\ 1 & 0 & 3 \\ 2 & -3 & 0 \end{bmatrix}$
Let us find its value by expanding along R_1,
$|A|=1(0 \times 0-3 \times -3)-2(1 \times 0-3 \times 2)+1(1 \times -3-0 \times 2)$
$=9+12-3$
$=18 \neq 0$
Hence it is a non singular matrix and inverse exists
Step2:
Now let us find the adjoint of A
$A_{11}=(-1)^{1+1} \begin{vmatrix} 0 & 3 \\ -3 & 0 \end{vmatrix}=0-(-9)=9$
$A_{12}=(-1)^{1+2} \begin{vmatrix} 1 & 3 \\ 2 & 0 \end{vmatrix}=-(0-6)=6$
$A_{13}=(-1)^{1+3} \begin{vmatrix} 1 & 0 \\ 2 & -3 \end{vmatrix}=-3-0=-3$
$A_{21}=(-1)^{2+1} \begin{vmatrix} 2 & 1 \\ -3 & 0 \end{vmatrix}=-(0-(-3))=-3$
$A_{22}=(-1)^{2+2} \begin{vmatrix} 1 & 1 \\ 2 & 0 \end{vmatrix}=0-2=-2$
$A_{23}=(-1)^{2+3} \begin{vmatrix} 1 & 2 \\ 2 & -3 \end{vmatrix}=-(-3-4)=7$
$A_{31}=(-1)^{3+1} \begin{vmatrix} 2 & 1 \\ 0 & 3 \end{vmatrix}=6-0=6$
$A_{32}=(-1)^{3+2} \begin{vmatrix} 1 & 1 \\ 1 & 3 \end{vmatrix}=-(3-1)=-2$
$A_{33}=(-1)^{3+3} \begin{vmatrix} 1 & 2 \\ 1 & 0 \end{vmatrix}=0-2=-2$
Hence the adjoint of $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} 9 & -3 & 6 \\ 6 & -2 & -2 \\ -3 & 7 & -2 \end{bmatrix}$
$A^{-1}=\frac{1}{|A|} adj (A),$ we know $|A|=18$
Therefore $A^{-1}=\frac{1}{18}\begin{bmatrix} 9 & -3 & 6 \\ 6 & -2 & -2 \\ -3 & 7 & -2 \end{bmatrix}$
Step 3:
$AX=B \qquad => X=A^{-1}B$
Substituting for $X, A^{-1}$ and B we get
$\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\frac{1}{18}\begin{bmatrix} 9 & -3 & 6 \\ 6 & -2 & -2 \\ -3 & 7 & -2 \end{bmatrix} \begin{bmatrix} 7 \\ 11 \\ 1 \end{bmatrix}$
$=\frac{1}{18}\begin{bmatrix} 63-33+6 \\ 42-22-2 \\ -21+77-2 \end{bmatrix}=\begin{bmatrix} \frac{36}{18} \\ \frac{18}{18} \\ \frac{54}{18} \end{bmatrix}$
$\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\begin{bmatrix} 2 \\ 1 \\ 3 \end{bmatrix}$
Hence $x=2,y=1,z=3$