# Thread: Solving simultaneous equations using matrices (3 unknowns)

1. ## Solving simultaneous equations using matrices (3 unknowns)

Hi, this is my first time posting and am not sure if I am doing this right, however, I am finding this difficult to understand:

(1 -2 k)
(2 1 2) = A
(3 2 1)

(-5 -2+2k -4-k )
(8 -1-3k -2+2k) = B
(1 -8 5 )

(k-n 0 0)
(0 k-n 0) = AB
(0 0 k-n)

x-2y+z=1
2x+y+2z=12
3x+2y-z=3

I know that I need to find the inverse of A however I am not used to doing this with 3*3 matrices (we haven't been taught a rule for this), what we were told was that there is a connection with 'I'. I only really need help finding the inverse of A.

Thank you so much for your help in advance, I really appreciate any time you spend on this!

2. I'm sorry but I really cannot make heads or tails out of what you are doing here! You have matrices A and B, with a "k" in them and then give "AB" that is clearly NOT the product of the previous A and B. Where did that "n" come from?

But what system of equations are you trying to solve? Is it the system you give:
x-2y+z=1, 2x+y+2z=12, 3x+2y-z=3 ? If so its "coefficient matrix" is
$\begin{bmatrix}1 & -2 & 1 \\ 2 & 1 & 2 \\ 3 & 2 & -1\end{bmatrix}$
but that does not have anything to do with the "A" and "B" matrices from before!

Yes, you can do a problem like this by finding the inverse matrix. There are a number of ways of doing that but the simplest is "row reduction". Write the matrix and the identity matrix "side by side".
$\begin{bmatrix}1 & -2 & 1 \\ 2 & 1 & 2 \\ 3 & 2 & -1\end{bmatrix}\begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{bmatrix}$
and use "row operations" to reduce the first matrix to the identity while applying those same row operations to the other matrix, getting the inverse matrix there at the end. There are three kinds of row operations, multiply or divide an entire row by a number, add or subtract a multiple of one row from another, and swap two rows. Work one column at a time.

Our objective is to get a 1 in the first column of the first rwo, the get 0s in the first column of the other two rows. There is already a 1 where we want it so we don't have to do anything to the first row. There is a 2 in the second row of the first column and we need to subtract 2 to get a 0 there. Since we have to use row operations, subtract 2 times the first row from the second row. There is a 3 in the third row of the first column- subtract 3 times the first row from the third row.
$\begin{bmatrix}1 & -2 & 1 \\ 0 & 5 & 0 \\ 0 & 8 & -4\end{bmatrix}\begin{bmatrix}1 & 0 & 0 \\ -2 & 1 & 0 \\ -3 & 0 & 1\end{bmatrix}$

That completes the first column. Now, we have a 5 in the second column of the second row and we want a 1 there- divide the second row by 5. We have a -2 in the second column of the first row and we want a 0 there- add 2 times the new second row (after dividing by 5) to the first row. We have a 8 in the second column of the third row and we want a 0 there- subtract 8 times the new second row from the third row. Now we have
$\begin{bmatrix}1 & 0 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & -4\end{bmatrix}\begin{bmatrix}1/5 & 2/5 & 0 \\ -2/5 & 1/5 & 0 \\ 1/5 & -8/5 & 1\end{bmatrix}$

Finally, we want a 1 in the third column of the third row. There is a -4 there so divide the third row by -4. We want a 0 in the third column of the first row and there is a 1 there- subtract the new third row from the first row. We want a 0 in the third column of the second rwo and there is a 0 there- we don't have to do anything to the second row. That gives
$\begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 0\\ 0 & 0 & 1\end{bmatrix}\begin{bmatrix}1/4 & 0 & 1/4 \\ -2/5 & 1/5 & 0 \\ -1/20 & 2/5 & -1/4\end{bmatrix}$

If I haven't made a mistake, you should be able to multiply that matrix with the original coefficient matrix (in either order) and get the identity matrix. And, of course, the solution to system of equations is given by
$\begin{bmatrix}x \\ y \\ z\end{bmatrix}= \begin{bmatrix}1/4 & 0 & 1/4 \\ -2/5 & 1/5 & 0 \\ -1/20 & 2/5 & -1/4\end{bmatrix}\begin{bmatrix}1 \\ 12 \\ 3\end{bmatrix}$.

Unless you have a large number of problems, all with the same coefficient matrix but different right sides, you don't really need to find the inverse matrix. It is quicker to set up the "augmented matrix", adding the right side of the system as a new column and row reduce
$\begin{bmatrix}1 & -2 & 1 & 1 \\ 2 & 1 & 2 & 12 \\ 3 & 2 & -1 & 3\end{bmatrix}$
to make the first three columns and rows the "identity" matrix. The fourth column will be the x, y, z values.

3. Thank you for such a thorough reply; I understand that it didn't make complete sense- I'm not yet sure how to input the maths clearly as you have done (it will be something that I will read up on). But as part of the question I was looking at, it was necessary to find 'n' and the values of 'k' for which the inverse of A is possible.

What I have done so far: (to find the 'elusive' n)
=>(1*-5)+(-2*8)+(k*1) = k - n
=>k - 21 = k - n
=>n = 21

Now, from this there should be a fairly simple way of finding the inverse of A in terms of 'k'

Then I should be able to solve the equations by pre-multiplying both sides by this inverse.
I'm really sorry that I didn't make this clear at the start, and that I've probably wasted quite some time. I understand your working but I've solved these (not using matrices) and got x= 1, y= 2 and z=4

If you could have a look at finding A-1 in terms of 'k' I would really appreciate it!
I can't thank you enough for what you've done so far, I hope that I can make anything else clearer if you would like me to elaborate on my explanation.