# Solving Linear Equations using Matrix

Let the equations be:

${{a}_{1}}x+{{a}_{2}}y+{{a}_{3}}z={{d}_{1}}$ ${{b}_{1}}x+{{b}_{2}}y+{{b}_{3}}z={{d}_{2}}$ ${{c}_{1}}x+{{c}_{2}}y+{{c}_{3}}z={{d}_{3}}$

We write the above equations in the matrix form as follows

$\left[ \begin{matrix} {{a}_{1}}x+{{a}_{2}}y+{{a}_{3}}z \\ {{b}_{1}}x+{{b}_{2}}y+{{b}_{3}}z \\ {{c}_{1}}x+{{c}_{2}}y+{{c}_{3}}z \\ \end{matrix} \right]=\left[ \begin{matrix} {{d}_{1}} \\ {{d}_{2}} \\ {{d}_{3}} \\ \end{matrix} \right]\Rightarrow \left[ \begin{matrix} {{a}_{1}} & {{a}_{2}} & {{a}_{3}} \\ {{b}_{1}} & {{b}_{2}} & {{b}_{3}} \\ {{c}_{1}} & {{c}_{2}} & {{c}_{3}} \\ \end{matrix} \right]\left[ \begin{matrix} x \\ y \\ z \\ \end{matrix} \right]=\left[ \begin{matrix} {{d}_{1}} \\ {{d}_{2}} \\ {{d}_{3}} \\ \end{matrix} \right]\,\,\Rightarrow AX=B$

… (i)

Where, A = $=\left[ \begin{matrix} {{a}_{1}} & {{a}_{2}} & {{a}_{3}} \\ {{b}_{1}} & {{b}_{2}} & {{b}_{3}} \\ {{c}_{1}} & {{c}_{2}} & {{c}_{3}} \\ \end{matrix} \right]$, $X=\left[ \begin{matrix} x \\ y \\ z \\ \end{matrix} \right]$, $B=\left[ \begin{matrix} {{d}_{1}} \\ {{d}_{2}} \\ {{d}_{3}} \\ \end{matrix} \right]$.

Multiplying (i) by A-1 we get ${{A}^{-1}}AX={{A}^{-1}}B\Rightarrow I.X={{A}^{-1}}B\Rightarrow X={{A}^{-1}}B$

## Solution to a System of Equations

A set of values of x, y, z which simultaneously satisfy all the equations is called a solution to the system of equations.

Consider, x+y+z=9 2x-y+z=5 4x+y-z=7

Here, the set of values – x=2,y=3,z=4, is a solution to the system of linear equations.

Because, 2+3+4=9 4-3+4=5 8+3-4=7

### Consistent Equations

If the system of equations has one or more solution, then it is said to be a consistent system of equations, otherwise it is an inconsistent system of equations. For example, the system of linear equations x + 3y = 5 x – y = 1 is consistent, because x = 2, y = 1 is a solution to it. However, the system of linear equations x + 3y = 5 2x + 6y = 8 is inconsistent, because there is no set of values of x and y which may satisfy the two equations simultaneously.

Condition for consistency of a system of linear equation AX = B

(a) If |A| ≠ 0, then the system is consistent and has a unique solution, given by X = ${{A}^{-1}}B$

(b) If |A| = 0, and (Adj A) B ≠ 0 then the system is inconsistent.

(c) If |A| = 0, and (Adj A) B = 0, then the system is consistent and has infinitely many solutions.

Note, AX = 0 is known as homogeneous system of linear equations, here B = 0. A system of homogeneous equations is always consistent.

The system has non-trivial solution (non-zero solution), if | A | = 0

Theorem 1: Let AX = B be a system of linear equations, where A is the coefficient matrix. If A is invertible then the system has a unique solution, given by X = A-1 B

Proof: AX = B; Multiplying both sides by A-1Since A-1 exists $\Rightarrow \left| A \right|\ne 0$ $\Rightarrow \,\,{{A}^{-1}}AX={{A}^{-1}}B \;\;\;\;\;\;\; \Rightarrow \,\,IX={{A}^{-1}}B \;\;\;\;\;\;\;\;\; \Rightarrow \,\,X={{A}^{-1}}B$

Thus, the system of equations AX = B has a solution given by X = ${{A}^{-1}}B$

Uniqueness: If AX = B has two sets of solutions X1 and X2, then

$A{{X}_{1}}=B$ and $A{{X}_{2}}=B$ (Each equal to B) $\Rightarrow \,\,A{{X}_{1}}=A{{X}_{2}}$

By cancellation law, A being invertible $\Rightarrow {{X}_{1}}={{X}_{2}}$

Hence, the given system AX = B has a unique solution.

Note: A homogeneous system of equations is always consistent.

### Problems on Solving Linear Equations using Matrix Method

Illustration: Let A = $\left[ \begin{matrix} x+y & y \\ 2x & x-y \\ \end{matrix} \right]$, $B=\left[ \begin{matrix} 2 \\ -1 \\ \end{matrix} \right]$, and $\left[ \begin{matrix} 3 \\ 2 \\ \end{matrix} \right]$. If AB = C. Then find the matrix A2

Solution:

By solving AB = C we get the values of x and y. Then by substituting these values in A we obtain A2

Here $\left[ \begin{matrix} x+y & y \\ 2x & x-y \\ \end{matrix} \right]\left[ \begin{matrix} 2 \\ -1 \\ \end{matrix} \right]=\left[ \begin{matrix} 3 \\ 2 \\ \end{matrix} \right]\Rightarrow \left[ \begin{matrix} 2\left( x+y \right)-y \\ 2x.2-\left( x-y \right) \\ \end{matrix} \right]=\left[ \begin{matrix} 3 \\ 2 \\ \end{matrix} \right]\Rightarrow 2\left( x+y \right)-y=3 and 4x-\left( x-y \right)=2$ $\Rightarrow \,\,2x+y=3\;\;\;\;and\;\;\;\;3x+y=2$ Subtracting the two equations, we get, x = -1 So, y = 5 .

∴ $\,\,A=\left[ \begin{matrix} -1+5 & 5 \\ 2\left( -1 \right) & -1-5 \\ \end{matrix} \right]=\left[ \begin{matrix} 4 & 5 \\ -2 & -6 \\ \end{matrix} \right]$

∴${{A}^{2}}=\left[ \begin{matrix} 4 & 5 \\ -2 & -6 \\ \end{matrix} \right]=\left[ \begin{matrix} 4 & 5 \\ -2 & -6 \\ \end{matrix} \right]$ $=\left[ \begin{matrix} 4\times 4+5\left( -2 \right) & 4\times 5+5\left( -6 \right) \\ -2\times 4+\left( -6 \right)\left( -2 \right) & -2\times 5+\left( -6 \right)\left( -6 \right) \\ \end{matrix} \right]=\left[ \begin{matrix} 6 & -10 \\ 4 & 26 \\ \end{matrix} \right]$

Illustration: Solve the following equations by matrix inversion

2x+y+2z=0 2x-y+z=10 x+3y-z=5

Solution:

The given equation can be written in a matrix form as AX = D and then by obtaining A-1 and multiplying it on both sides we can solve the given problem.

$\left[ \begin{matrix} 2 & 1 & 2 \\ 2 & -1 & 1 \\ 1 & 3 & -1 \\ \end{matrix} \right]\left[ \begin{matrix} x \\ y \\ z \\ \end{matrix} \right]=\left[ \begin{matrix} 0 \\ 10 \\ 5 \\ \end{matrix} \right]$

AX = D where A $=\left[ \begin{matrix} 2 & 1 & 2 \\ 2 & -1 & 1 \\ 1 & 3 & -1 \\ \end{matrix} \right],X=\left[ \begin{matrix} x \\ y \\ z \\ \end{matrix} \right],D=\left[ \begin{matrix} 0 \\ 10 \\ 5 \\ \end{matrix} \right]$ $\Rightarrow \,\,{{A}^{-1}}\left( AX \right)={{A}^{-1}}D\Rightarrow \left( {{A}^{-1}}A \right)X={{A}^{-1}}D \;\;\;\;\;\Rightarrow IX={{A}^{-1}}D\Rightarrow x={{A}^{-1}}D$ … (i)

Now ${{A}^{-1}}=\frac{adj\,\,A}{\left| A \right|}; \;\;\;\;\;\;\left| A \right|=\left| \begin{matrix} 2 & 1 & 2 \\ 2 & -1 & 1 \\ 1 & 3 & -1 \\ \end{matrix} \right|=2\left( 1-3 \right)-1\left( -2-1 \right)+2\left( 6+1 \right)=13$

The matrix of co-factors of $\left| A \right|\;\; is \;\;\left[ \begin{matrix} -2 & 3 & 7 \\ 7 & -4 & -5 \\ 3 & 2 & -4 \\ \end{matrix} \right].\;\;So, \;\;adj\;\; A \;\;\;\;=\left[ \begin{matrix} -2 & 7 & 3 \\ 3 & -4 & 2 \\ 7 & -5 & -4 \\ \end{matrix} \right]$

∴ $\,\,{{A}^{-1}}=\frac{1}{13}\left[ \begin{matrix} -2 & 7 & 3 \\ 3 & -4 & 2 \\ 7 & -5 & -4 \\ \end{matrix} \right]$

⇒ from (i), $X=\frac{1}{3}\left[ \begin{matrix} -2 & 7 & 3 \\ 3 & -4 & 2 \\ 7 & -5 & -4 \\ \end{matrix} \right]\left[ \begin{matrix} 0 \\ 10 \\ 5 \\ \end{matrix} \right]$ $=\frac{1}{13}\left[ \begin{matrix} 0+70+15 \\ 0-40+10 \\ 0-50-20 \\ \end{matrix} \right]=\left[ \begin{matrix} 85/13 \\ -30/13 \\ -70/13 \\ \end{matrix} \right]$

∴ $\left[ \begin{matrix} x \\ y \\ z \\ \end{matrix} \right]=\left[ \begin{matrix} 85/13 \\ -30/13 \\ -70/13 \\ \end{matrix} \right]\Rightarrow \,\,x=\frac{85}{13},y=\frac{-30}{13},z=\frac{-70}{13}$

Illustration: If $\left[ \begin{matrix} 2 & 1 \\ 7 & 4 \\ \end{matrix} \right]A\left[ \begin{matrix} -3 & 2 \\ 5 & -3 \\ \end{matrix} \right]=\left[ \begin{matrix} 1 & 0 \\ 0 & 1 \\ \end{matrix} \right],$

then matrix A equals:

$(a) \left[ \begin{matrix} 7 & 5 \\ -11 & -8 \\ \end{matrix} \right] \;\;\;\;\;(b) \left[ \begin{matrix} 2 & 1 \\ 5 & 3 \\ \end{matrix} \right] \;\;\;\;\;\; (c)\left[ \begin{matrix} 7 & 1 \\ 34 & 5 \\ \end{matrix} \right] \;\;\;\;\;\; (d) \left[ \begin{matrix} 5 & 3 \\ 13 & 8 \\ \end{matrix} \right]$

Solution:

(a) We know that if XAY = I, then A $={{X}^{-1}}{{Y}^{-1}}={{\left( YX \right)}^{-1}}.$

In this case $YX=\left[ \begin{matrix} -3 & 2 \\ 5 & -3 \\ \end{matrix} \right]\left[ \begin{matrix} 2 & 1 \\ 7 & 4 \\ \end{matrix} \right]=\left[ \begin{matrix} 8 & 5 \\ -11 & -7 \\ \end{matrix} \right]$

∴ $A={{\left[ \begin{matrix} 8 & 5 \\ -11 & -7 \\ \end{matrix} \right]}^{-1}}=\left[ \begin{matrix} 7 & 5 \\ -11 & -8 \\ \end{matrix} \right]$

Illustration: The system of equations $\left( \begin{matrix} 3 & -2 & 1 \\ 5 & -8 & 9 \\ 2 & 1 & a \\ \end{matrix} \right)\left( \begin{matrix} x \\ y \\ z \\ \end{matrix} \right)=\left( \begin{matrix} b \\ 3 \\ -1 \\ \end{matrix} \right)$

has no solution if a and b are

$(a) a=-3,b\ne 1/3\;\;\;\; (b) a=2/3,b\ne 1/3 \;\;\;(c)a\ne 1/4,b=1/3 \;\;\;\;(d) a\ne -3,b\ne 1/3$

Solution:

By applying row operation in the given matrices and comparing them we can obtain the required result.

(a) The augmented matrix is given by (A|B) $=\left( \begin{matrix} 3 & -2 & 1 \\ 5 & -8 & 9 \\ 2 & 1 & a \\ \end{matrix}\left| \begin{matrix} b \\ 3 \\ -1 \\ \end{matrix} \right. \right)$

Applying ${{R}_{1}}\to 2{{R}_{1}}-{{R}_{2}},$ we get $\left( A|B \right)\tilde{\ }\left( \begin{matrix} 1 & 4 & -7 \\ 5 & -8 & 9 \\ 2 & 1 & a \\ \end{matrix}\left| \begin{matrix} 2b-3 \\ 3 \\ -1 \\ \end{matrix} \right. \right)$

Applying ${{R}_{2}}\to {{R}_{2}}-5{{R}_{1}},{{R}_{3}}\to 2{{R}_{1}},$ we get $\left( A|B \right)\tilde{\ }\left( \begin{matrix} 1 & 4 & -7 \\ 0 & -28 & 44 \\ 0 & -7 & a+14 \\ \end{matrix}\left| \begin{matrix} 2b-3 \\ 18-10b \\ 5-4b \\ \end{matrix} \right. \right)$

The system of equations will have no solution if $\frac{-28}{-7}=\frac{44}{a+14}\ne \frac{18-10b}{5-4b}$ $\Rightarrow \,\,a+14=11\;\;\;and\;\;\;20-16b\ne 18-10b$

$\Rightarrow \,a=-3 ]and [b\ne -1/3$.

Illustration: Let A = $\left( \begin{matrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 3 & 2 & 1 \\ \end{matrix} \right).$

If u1 and u2 are column matrices such that $A{{u}_{1}}=\left( \begin{matrix} 1 \\ 0 \\ 0 \\ \end{matrix} \right)\;\;\;\;\;and \;\;\;\;\;A{{u}_{2}}=\left( \begin{matrix} 0 \\ 1 \\ 0 \\ \end{matrix} \right), \;\;\;\;then \;\;\;\;\;{{u}_{1}}+{{u}_{2}}$

equals:

$(a) \left( \begin{matrix} -1 \\ 1 \\ -1 \\ \end{matrix} \right) \;\;\;\;\;\;\; (b) \left( \begin{matrix} -1 \\ -1 \\ 0 \\ \end{matrix} \right)\;\;\;\;\;\; (c)\left( \begin{matrix} 1 \\ -1 \\ -1 \\ \end{matrix} \right) \;\;\;\;\;\; (d) \left( \begin{matrix} -1 \\ 1 \\ 0 \\ \end{matrix} \right)$

Solution:

(c) Adding Au1 and Au2 we get $A\left( {{u}_{1}}+{{u}_{2}} \right).$ Then using the invariance method we obtain ${{u}_{1}}+{{u}_{2}}.$

By adding, we have $A\left( {{u}_{1}}+{{u}_{2}} \right)=A{{u}_{1}}+A{{u}_{2}}=\left( \begin{matrix} 1 \\ 0 \\ 0 \\ \end{matrix} \right)+\left( \begin{matrix} 0 \\ 1 \\ 0 \\ \end{matrix} \right)=\left( \begin{matrix} 1 \\ 1 \\ 0 \\ \end{matrix} \right)$

We then solve the above equation for ${{u}_{1}}+{{u}_{2}},$ if we consider the augmented matrix (A|B) = $\left( \begin{matrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 3 & 2 & 1 \\ \end{matrix}\left| \begin{matrix} 1 \\ 1 \\ 0 \\ \end{matrix} \right. \right)$

Applying ${{R}_{3}}\to {{R}_{3}}-2{{R}_{2}}+{{R}_{1}} \;\;and \;\;\;{{R}_{2}} to {{R}_{2}}-2{{R}_{1}}$ we get;

$(A|B)\tilde{\ }\left( \begin{matrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{matrix}\left| \begin{matrix} 1 \\ -1 \\ -1 \\ \end{matrix} \right. \right)$

⇒ ${{u}_{1}}+{{u}_{2}}=\left( \begin{matrix} 1 \\ -1 \\ -1 \\ \end{matrix} \right)$

#### Practise This Question

Identify the method by which chalk and water or even clay and water can be separated.