# Solve by matrix inversion method following system of linear equation $2x-y+z=7\;,3x+y-5z=13\;,x+y+z=5$

Toolbox:
• Let $A = [ a_{ij} ]$ be a square matrix x. Let $A_{ij}$ be the cofactor of $a_{ij}$. Then $[ A_{ij}]$ is the matrix of cofactors and $adj\: A$ ( or adjoint of the matrix A) is given by $adj\: A=[A_{ij}]^T$
• The inverse of a non-singular square matrix A is given by $A^{-1} = \frac{1}{|A|} adj\: A.$ A non-singular matrix is one whose determinant value is nonzero.
• A system of x linear non-homogeneous equations in x unknowns given by
• $a_{11}x_1 +a_{12}x_2 \dotsc + a_{1n}x_n = b_1$
• $a_{22}x_1 +a_{22}x_2 \dotsc + a_{2n}x_n = b_2$
• $\: \: \: \: \vdots \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \vdots$
• $a_{n1}x_1 +a_{n2}x_2 \dotsc + a_{nn}x_n = b_n$ can be written as $AX = B$ in matrix form where $A = [a_{ij}], x = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix}$ and $B = \begin{bmatrix} b_1 \\ b_2 \\ \vdots \\ b_n \end{bmatrix}$ If A is non-singular $( |A| \neq 0 )$ the inverse $A^{-1}$ exists and the system can be solved by matrix inversion $X = A^{-1}B$
Step 1
The system is written as $AX = B$ in matrix form
$A = \begin{bmatrix} 2 & -1 & 1 \\ 3 & 1 & -5 \\ 1 & 1 & 1 \end{bmatrix}, X = \begin{bmatrix} x \\ y \\ z \end{bmatrix} , B = \begin{bmatrix} 7 \\ 13 \\ 5 \end{bmatrix}$
$|A| = \begin{vmatrix} 2 & -1 & 1 \\ 3 & 1 & -5 \\ 1 & 1 & 1 \end{vmatrix} = 2(1+5)+1(3+5)-1(3-1)$
$= 12+8+2=22 \neq 0$
$A^{-1}$ exists and the system can be solved by matrix inversion. $X =A^{-1}B$
Step 2
To find $A^{-1} = \large\frac{1}{|A|} adj\: A$
$[A_{ij}]$ = cofactor matrix = $\begin{bmatrix} (1+5) & -(3+5) & (3-1) \\ -(-1-1) & (2-1) & -(2+1) \\ (5-1) & -(10-3) & (2+3) \end{bmatrix}$
$= \begin{bmatrix}6 & -8 & 2 \\ 2 & 1 & -3 \\ 4 & 13 & 5 \end{bmatrix}$
$A^{-1} = \large\frac{1}{|A|} adj\: A = \large\frac{1}{|A|} [A_{ij}]^T = \large\frac{1}{22} \begin{bmatrix}6 & 2 & 4 \\ -8 & 1 & 13 \\ 2 & -3 & 5 \end{bmatrix}$
Step 3
$X = A^{-1}B = \large\frac{1}{22} \begin{bmatrix}6 & 2 & 4 \\ -8 & 1 & 13 \\ 2 & -3 & 5 \end{bmatrix} \begin{bmatrix} 7 \\ 13 \\ 5 \end{bmatrix}$
$= \large\frac{1}{22} \begin{bmatrix}42 & +26 & +20 \\ -56 & +13 & +65 \\ 14 & -39 & +25 \end{bmatrix}$
$= \large\frac{1}{22} \begin{bmatrix} 88 \\ 22 \\ 0 \end{bmatrix} = \begin{bmatrix} 4 \\ 1 \\ 0 \end{bmatrix}$
$\therefore x = 4, y = 1, z = 0$

edited May 27, 2013