Solving Linear Equations using Matrix

Solving linear equations using matrix is done by two prominent methods namely the Matrix method and Row reduction or Gaussian elimination method. In this article, we will look at solving linear equations with matrix and related examples. With the study notes provided below students should develop a clear idea about the topic.

How to Solve Linear Equations using Matrix Method?

Let the equations be:

a1x+a2y+a3z=d1{{a}_{1}}x+{{a}_{2}}y+{{a}_{3}}z={{d}_{1}}

 

b1x+b2y+b3z=d2{{b}_{1}}x+{{b}_{2}}y+{{b}_{3}}z={{d}_{2}}

 

c1x+c2y+c3z=d3{{c}_{1}}x+{{c}_{2}}y+{{c}_{3}}z={{d}_{3}}

 

The first method to find the solution to the system of equations is a matrix method. The steps to be followed are:

  • All the variables in the equations should be written in the appropriate order.
  • The variables, their coefficients and constants are to be written on the respective sides.

Solving a system of linear equations by the method of finding the inverse consists of two new matrices namely

  • Matrix A: which represents the variables
  • Matrix B: which represents the constants

A system of equations can be solved using matrix multiplication.

We write the above equations in the matrix form as follows

[a1x+a2y+a3zb1x+b2y+b3zc1x+c2y+c3z]=[d1d2d3][a1a2a3b1b2b3c1c2c3][xyz]=[d1d2d3]AX=B\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 = =[a1a2a3b1b2b3c1c2c3]=\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=[xyz]X=\left[ \begin{matrix} x \\ y \\ z \\ \end{matrix} \right]B=[d1d2d3]B=\left[ \begin{matrix} {{d}_{1}} \\ {{d}_{2}} \\ {{d}_{3}} \\ \end{matrix} \right].

A is the coefficient matrix, X the variable matrix and B the constant matrix.

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

The second method to find the solution for the system of equations is Row reduction or Gaussian Elimination.

  1. The augmented matrix for the linear equations is written.
  2. Use elementary such that all the elements below the main diagonal are zero. If a zero is obtained on the diagonal, perform the row operation such that a nonzero element is obtained.
  3. Back substitution is used to find the solution.

Related Topics:

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 = A1B{{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 A0\Rightarrow \left| A \right|\ne 0 A1AX=A1B              IX=A1B                  X=A1B\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 = A1B{{A}^{-1}}B

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

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

By cancellation law, A being invertible X1=X2\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 = [x+yy2xxy]\left[ \begin{matrix} x+y & y \\ 2x & x-y \\ \end{matrix} \right]B=[21]B=\left[ \begin{matrix} 2 \\ -1 \\ \end{matrix} \right], and [32]\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 [x+yy2xxy][21]=[32][2(x+y)y2x.2(xy)]=[32]2(x+y)y=3and4x(xy)=2\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 2x+y=3        and        3x+y=2\Rightarrow \,\,2x+y=3\;\;\;\;and\;\;\;\;3x+y=2 Subtracting the two equations, we get, x = -1 So, y = 5 .

A=[1+552(1)15]=[4526]\,\,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]

A2=[4526]=[4526] {{A}^{2}}=\left[ \begin{matrix} 4 & 5 \\ -2 & -6 \\ \end{matrix} \right]=\left[ \begin{matrix} 4 & 5 \\ -2 & -6 \\ \end{matrix} \right] =[4×4+5(2)4×5+5(6)2×4+(6)(2)2×5+(6)(6)]=[610426]=\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.

[212211131][xyz]=[0105]\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 =[212211131],X=[xyz],D=[0105]=\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] A1(AX)=A1D(A1A)X=A1D          IX=A1Dx=A1D\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 A1=adjAA;            A=212211131=2(13)1(21)+2(6+1)=13{{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 A    is    [237745324].    So,    adj    A        =[273342754]\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]

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

⇒ from (i), X=13[273342754][0105] 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] =113[0+70+15040+1005020]=[85/1330/1370/13]=\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]

∴ [xyz]=[85/1330/1370/13]x=8513,y=3013,z=7013\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 [2174]A[3253]=[1001],\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)[75118]          (b)[2153]            (c)[71345]            (d)[53138](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 =X1Y1=(YX)1.={{X}^{-1}}{{Y}^{-1}}={{\left( YX \right)}^{-1}}.

In this case YX=[3253][2174]=[85117]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=[85117]1=[75118]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 (32158921a)(xyz)=(b31)\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,b1/3        (b)a=2/3,b1/3      (c)a1/4,b=1/3        (d)a3,b1/3(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) =(32158921ab31)=\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 R12R1R2,{{R}_{1}}\to 2{{R}_{1}}-{{R}_{2}}, we get (AB) ~(14758921a2b331)\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 R2R25R1,R32R1,{{R}_{2}}\to {{R}_{2}}-5{{R}_{1}},{{R}_{3}}\to 2{{R}_{1}}, we get (AB) ~(1470284407a+142b31810b54b)\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 287=44a+141810b54b\frac{-28}{-7}=\frac{44}{a+14}\ne \frac{18-10b}{5-4b} a+14=11      and      2016b1810b\Rightarrow \,\,a+14=11\;\;\;and\;\;\;20-16b\ne 18-10b

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

 

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

If u1 and u2 are column matrices such that Au1=(100)          and          Au2=(010),        then          u1+u2A{{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)(111)              (b)(110)            (c)(111)            (d)(110)(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(u1+u2).A\left( {{u}_{1}}+{{u}_{2}} \right). Then using the invariance method we obtain u1+u2.{{u}_{1}}+{{u}_{2}}.

By adding, we have A(u1+u2)=Au1+Au2=(100)+(010)=(110)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 u1+u2,{{u}_{1}}+{{u}_{2}}, if we consider the augmented matrix (A|B) = (100210321110)\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 R3R32R2+R1    and      R2toR22R1{{R}_{3}}\to {{R}_{3}}-2{{R}_{2}}+{{R}_{1}} \;\;and \;\;\;{{R}_{2}} to {{R}_{2}}-2{{R}_{1}} we get;

(AB) ~(100010001111)(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)

u1+u2=(111){{u}_{1}}+{{u}_{2}}=\left( \begin{matrix} 1 \\ -1 \\ -1 \\ \end{matrix} \right)

BOOK

Free Class