24.5 Solving Systems Of Equations
We can solve system of equations using matrices by
- (a).
- Using the inverse of the matrix \begin {align*} ax +by + cz & = m\\ dx + ey + fz & = n\\ gx + hy + jz & =p\\ \end {align*}
We set the system as one equation \(AX=B\) where \[A= \begin {pmatrix} a & b & c\\ d & e & f\\ g & h & j\\ \end {pmatrix} ,\quad X= \begin {pmatrix} x\\ y\\ z\\ \end {pmatrix} ,\quad B= \begin {pmatrix} m\\n\\p\\ \end {pmatrix} \]
\begin {align*} AX &=B\\ A^{-1}AX &=A^{-1}B\\ IX & = A^{-1}B\\\\ \implies \quad \begin {pmatrix} x\\ y\\ z\\ \end {pmatrix} & = A^{-1}B.\\ \end {align*}
Solve the system of equations: \begin {align*} 2x+y-z & =5\\ x + y -z & =4\\ -x-2y+3z & = -8\\ \end {align*}
Solution.
\[AX=B\cdots \cdots \cdots (1)\]
\[A= \begin {pmatrix} 2 & 1 & -1\\ 1 & 1 & -1\\ -1 & -2 & 3\\ \end {pmatrix} ,\quad X= \begin {pmatrix} x\\y\\z\\ \end {pmatrix} ,\quad B= \begin {pmatrix} 5\\ 4 \\ -8\\ \end {pmatrix} \]
We find \(A^{-1}\),
\(A^{-1}= \begin {pmatrix} 1 & -1 & 0\\ -2 & 5 & 1\\ -1 & 3 & 1\\ \end {pmatrix} \)
Substitute in equation (1), we find that \begin {align*} AX & =B\\ A^{-1}AX & =A^{-1}B\\ \begin {pmatrix} 1 & -1 & 0\\ -2 & 5 & 1\\ -1 & 3 & 1\\ \end {pmatrix} \begin {pmatrix} 2 & 1 & -1\\ 1 & 1 & -1\\ -1 & -2 & 3\\ \end {pmatrix} \begin {pmatrix} x\\y\\z \end {pmatrix} & = \begin {pmatrix} 1 & -1 & 0\\ -2 & 5 & 1\\ -1 & 3 & 1\\ \end {pmatrix} \begin {pmatrix} 5\\4\\-8\\ \end {pmatrix}\\\\ \begin {pmatrix} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\\ \end {pmatrix} \begin {pmatrix} x\\y\\z\\ \end {pmatrix} &= \begin {pmatrix} 1\\ 2\\ -1\\ \end {pmatrix}\\\\ \begin {pmatrix} x\\y\\z\\ \end {pmatrix} &= \begin {pmatrix} 1\\2\\-1\\ \end {pmatrix} \end {align*}
\[\therefore \quad x=1,\quad y=2,\quad z=-1\]
Note 24.9. Always substitute the answer back into the original equations. Here \[2(1)+2-(-1)=5,\quad 1+2-(-1)=4,\quad -1-2(2)+3(-1)=-8,\] all three checking out. The check costs a few seconds and catches both arithmetic slips in the inverse and misreadings of the question.
Note also why the method works at all: \(A^{-1}\) exists precisely when \(\left |A\right |\neq 0\), and that is exactly the condition for the system to have a unique solution. If \(\left |A\right |=0\) the system has either no solution or infinitely many, and no inverse can distinguish the two — a different method is needed.
(b). Cramer’s Rule
Let the system of equation be \begin {align*} ax+by+cz &=m\\ dx+ey+fz &=n\\ gx+hy+jz &=p\\ \end {align*}Cramer’s rule state that you set \(A= \begin {pmatrix} a & b & c\\ d & e & f\\ g & h & j\\ \end {pmatrix} \) and find \(|A|= \begin {vmatrix} a & b & c\\ d & e & f\\ g & h & j\\ \end {vmatrix} \)
\[A= \begin {pmatrix} a & b & c\\ d & e & f\\ g & h & j\\ \end {pmatrix} , X= \begin {pmatrix} x\\y\\z\\ \end {pmatrix} , B= \begin {pmatrix} m\\ n\\ p\\ \end {pmatrix} \]
Then \[|A_1|= \begin {vmatrix} m & b & c\\ n & e & f\\ p & h & j\\ \end {vmatrix} ,\quad |A_2|= \begin {vmatrix} a & m & c\\ d & n & f\\ g & p & j\\ \end {vmatrix} ,\quad |A_3|= \begin {vmatrix} a & b & m\\ d & e & n\\ g & h & p\\ \end {vmatrix} \]
Then \[x=\frac {|A_1|}{|A|},\quad y=\frac {|A_2|}{|A|},\quad z=\frac {|A_3|}{|A|}\]
Use Cramer’s rule \begin {align*} 2x+3y+z & =6\\ x-2y+3z &=-3\\ 3x+2y-4z & =12\\ \end {align*}
Solution.
\[A= \begin {pmatrix} 2 & 3 & 1\\ 1 & -2 & 3\\ 3 & 2 & -4\\ \end {pmatrix} ,\quad X= \begin {pmatrix} x\\y\\z\\ \end {pmatrix} ,\quad B= \begin {pmatrix} 6\\-3\\12\\ \end {pmatrix} \]
\begin {align*} |A| &=2 \begin {vmatrix} -2 & 3\\ 2 & -4\\ \end {vmatrix} -3 \begin {vmatrix} 1 & 3\\ 3 & 4\\ \end {vmatrix} + \begin {vmatrix} 1 & -2\\ 3 & 2\\ \end {vmatrix}\\ & = 2(8-6)-3(-4-9)+(2+6)\\ & = 4 + 39 +8\\ & = 51\\ \end {align*}
\[|A_1|= \begin {vmatrix} 6 & 3 & 1\\ -3 & -2 & 3\\ 12 & 2 & -4\\ \end {vmatrix} =102\]
\[|A_2|= \begin {vmatrix} 2 & 6 & 1\\ 1 & -3 & 3\\ 3 & 12 & -4\\ \end {vmatrix} =51\]
\[|A_3|= \begin {vmatrix} 2 & 3 & 6\\ 1 & -2 & -3\\ 3 & 2 & 12\\ \end {vmatrix} =-51\]
\[x=\frac {|A_1|}{|A|}=\frac {102}{51}=2,\quad y=\frac {|A_2|}{|A|}=\frac {51}{51}=1,\quad z=\frac {|A_3|}{|A|}=\frac {-51}{51}=-1\]
\[\therefore \quad x=2,\quad y=1,\quad z=-1\]
Sample Questions
- 1.
- Find the determinants of the following matrices \[B= \begin {pmatrix} 1 & -1 & 1\\ 0 & 2 & -1\\ -1 & 3 & 0\\ \end {pmatrix} ,\qquad C= \begin {pmatrix} 3 & 2 & -1\\ 4 & 5 & 5\\ 1 & -3 & 2\\ \end {pmatrix} \]
- 2.
- Solve the following system of equations:
- (a)
- \( \begin {matrix} x & + & 3y & + & 5z & =4\\ -2x & + & 2y & + &4z & =3\\ 5x & + & y & + & 3z & =2\\ \end {matrix} \)
- (b)
- \( \begin {matrix} x & + & 2y & + & 3z & =2\\ & - & 4z & + & 2y & = -6\\ y & - & x & + & 2z & = 2\\ \end {matrix} \)
- 3.
- Use Cramer’s Rule to solve the following:
- (a)
- \( \begin {matrix} x & + & 2y & + & 3z & =11\\ 3x & + & 8y & + & 5z & =27\\ -x & + & y & + & 2z & = 2\\ \end {matrix} \)
- (b)
- \( \begin {matrix} x & - & 2y & + & 3z & = 9\\ 2x & + & 3y & - & z & =4\\ x & + & 5y & - & 4z & =2\\ \end {matrix} \)
- 4.
-
- (a)
- Find the value of \(P\) such that the matrix \(B= \begin {pmatrix} 1 & -1 & 0\\ 0 & P(1 +P^2) & 4\\ 5 & 2 & 1\\ \end {pmatrix} \) is a singular matrix.
- (b)
- Given that \( A= \begin {pmatrix} 3 & 1\\ 0 & 7\\ \end {pmatrix} , \quad B= \begin {pmatrix} 2 & -1 & 0\\ 4 & 6 & -1\\ \end {pmatrix} \), find \(AB\).
- 5.
-
- (a)
- Given that the matrix \(A= \begin {pmatrix} 1 & -1 & 1\\ 3 & -9 & 5\\ 1 & -3 & 3\\ \end {pmatrix} \) evaluate \(A^{-1}\).
- (b)
- Use Cramer’s rule to solve the system of equations
- i.
- \( \begin {matrix} x & - & 2y & + & z & =-1\\ 2x & + & y & - & 3z & = 8\\ && 2y & + & z & =1\\ \end {matrix} \)
- ii.
- \( \begin {matrix} x & - & y & + & 2z & =-5\\ &&-x & + & 3z & =0\\ && 2x & + & y & = 1\\ \end {matrix} \)
- 6.
-
- (a)
- Let \(P= \begin {pmatrix} 6 & a & 1\\ -1 & 4 & b \\ 0 & 1 & c\\ \end {pmatrix} \) and \( Q= \begin {pmatrix} 4\\ 2\\3\\ \end {pmatrix} \).
- i.
- If \(\det P =2\), find the determinant of the \[ \begin {pmatrix} 6 & a & 1\\ 6 & 1+a & 1+c\\ -1 & 4 & b\\ \end {pmatrix} \]
- ii.
- Find \(PQ\).
- (b)
- Find the adjoint of the matrix
\[B= \begin {pmatrix} 3 & 1 & 2\\ -1 & 1 & -1\\ -4 & 3 & 8\\ \end {pmatrix} \]
- 7.
- Given the following matrices \(A= \begin {pmatrix} -1 & 2 & 4\\ 3 & 1 & 3\\ \end {pmatrix} \) and \(B= \begin {pmatrix} 1 & 2 & 3\\ 2 & 1 & 1\\ \end {pmatrix} \).
Find the following:- (a)
- \(2A +3B\)
- (b)
- \(A^tB\)
- (c)
- Inverse of \(B^tA\)
- 8.
- Given the following system of linear equations,
\( \begin {matrix} x & + & z & - & y & = -1\\ 5z & - & 9y & +& 3x & = 8\\ && z & + & 2y & =1\\ \end {matrix} \)
- (a)
- Write the system of linear equation in a matrix form.
- (b)
- Solve the system of linear equations using the inverse method.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.