# Homework Help: I really hate matrices sometimes.

1. Apr 17, 2007

### jernobyl

1. The problem statement, all variables and given/known data

Express the following equations in the matrix form AX=B. Determine the inverse of A and hence solve the equations.

$$4x-3y+z=11$$

$$2x+y-4z=-1$$

$$x+2y-2z=1$$

2. Relevant equations

Not really applicable.

3. The attempt at a solution

A bit of background, this is for a piece of coursework when we were just starting to learn about matrices and their uses, which deals with solving groups of equations by changing them into matrix form and solving them that way. So it's not very advanced. It's just annoying.

Basically I've done the entirety of the problem, I come to the end and the answers aren't right. It's a Hellishly long process and I've done it five times now and each time I get a different incorrect answer and it's driving me up the wall. I just KNOW I've got ONE sign wrong somewhere and it's throwing the whole damn thing off. I hope someone can point out where I've gone wrong.

Oh, the answer is meant to come out, $$x = 3, y = 1, z = 2$$; I've been getting weird fractional answers. Anyway.

Right, so changing the equations into AX=B form:

$$\left(\begin{array}{ccc}4&-3&1\\2&1&-4\\1&2&-2\end{array}\right)\left(\begin{array}{c}x\\y\\z\end{array}\right) = \left(\begin{array}{c}11\\-1\\1\end{array}\right)$$

So we know that:

$$X=A^{-1}B$$

So my next aim is to calculate $$A^{-1}$$.

$$A^{-1}=\frac{1}{det(A)}adj(A)$$

$$det(A) = (4)\left|\begin{array}{cc}1&-4\\2&-2\end{array}\right|-(-3)\left|\begin{array}{cc}2&-4\\1&-2\end{array}\right|+(1)\left|\begin{array}{cc}2&1\\1&2\end{array}\right|$$

$$=(4)(6)-(-3)(0)-(1)(3)$$

$$=24-0-3$$

$$=21$$

So that's fair enough. The determinant is 21. God knows if it actually is or not but following my calculations that's what it is. Now, the matrix of cofactors:

$$C = \left(\begin{array}{ccc}\left|\begin{array}{cc}1&-4\\2&-2\end{array}\right|&-\left|\begin{array}{cc}2&-4\\1&-2\end{array}\right|&\left|\begin{array}{cc}2&1\\1&2\end{array}\right|\\\\-\left|\begin{array}{cc}-3&1\\2&-2\end{array}\right|&\left|\begin{array}{cc}4&1\\1&-2\end{array}\right|&-\left|\begin{array}{cc}4&-3\\1&2\end{array}\right|\\\\\left|\begin{array}{cc}-3&1\\1&-4\end{array}\right|&-\left|\begin{array}{cc}4&1\\2&-4\end{array}\right|&\left|\begin{array}{cc}4&-3\\2&1\end{array}\right|\end{array}\right) = \left(\begin{array}{ccc}6&0&3\\-4&-9&-11\\11&18&10\end{array}\right)$$

$$adj(A)=C^T=\left(\begin{array}{ccc}6&-4&11\\0&-9&18\\3&-11&10\end{array}\right)$$

$$A^{-1} = \frac{1}{21}\left(\begin{array}{ccc}6&-4&11\\0&-9&18\\3&-11&10\end{array}\right) = \left(\begin{array}{ccc}\frac{2}{7}&-\frac{4}{21}&\frac{11}{21}\\\\0&-\frac{3}{7}&\frac{6}{7}\\\\\frac{1}{7}&-\frac{11}{21}&\frac{10}{21}\end{array}\right)$$

$$X=A^{-1}B = \left(\begin{array}{ccc}\frac{2}{7}&-\frac{4}{21}&\frac{11}{21}\\\\0&-\frac{3}{7}&\frac{6}{7}\\\\\frac{1}{7}&-\frac{11}{21}&\frac{10}{21}\end{array}\right)\left(\begin{array}{c}11\\-1\\1\end{array}\right)$$

Which actually gives you the answers $$x=\frac{27}{7}, y=\frac{9}{7}, z=\frac{58}{21}$$...none of which are right, obviously.

I know there's a lot of information above but I could really do with someone with a sharper eye than mine (bear in mind it's now nearly 6am and I've been up all night!) to find where I've made my little error leading to a grand finale of chaos! Many thanks to anyone who looks at this! I'm off to my bed for now!

Last edited: Apr 18, 2007
2. Apr 18, 2007

OK, so there's a sign error in the 3rd term when calculating the determinant. It should be 24 - 0 + 3 = 27

3. Apr 18, 2007

### jernobyl

And you know what? That solves the whole thing. I knew it. One sign off. Thanks so much for noticing, I'd never have gotten it! I need to go be dead now. :S

4. Apr 18, 2007

### HallsofIvy

Is that the only way you have learned to solve a system of equations? Row reduction of the augmented matrix is much simpler (in this problem it doesn't involve any fractions!). Hopefully you will learn that soon.

5. Apr 18, 2007

### jernobyl

Hi, um, if "row reduction of the augmented matrix" can also be called "elementary row operations" (as I'm reading in my notes) then yes, we have learned that, but it was kind of forgotten about, being hailed as a long-winded and quite inefficient way of finding the inverses of matrices, and therefore I'm not very confident about how to do it.

6. Apr 18, 2007

### HallsofIvy

"Long winded"! "Difficult"!! How dare you! It is the simplest way to find determinants, inverses, or, for that matter, just solving equations!

In this case, you can write the "augmented" matrix as
$$\left(\begin{array}{cccc}4&-3&1&11\\2&1&-4&-1\\1&2&-2&1\end{array}\right)$$
The first row operation I would use is to swap the first and third rows (that's not necessary but it simplifies the arithmetic):
$$\left(\begin{array}{cccc}1&2&-2&1\\2&1&-4&-1\\4&-3&1&11\end{array}\right)$$
Now, in order to get "1 0 0" as the first column, subtract twice the first row from the second row and four times the first row from the third row:
$$\left(\begin{array}{cccc}1&2&-2&1\\0&-3&0&-3\\0&-11&9&7\end{array}\right)$$
Divide the second row by -3 (to get a 1 at the "pivot"), subtract twice that new second row from the first row and add 11 times the new second row to the third row:
$$\left(\begin{array}{cccc}1&0&-2&-1\\0&1&0&1\\0&0&9&18\end{array}\right)$$
Finally, divide the third row by 9 and add twice the third row to the first row:
$$\left(\begin{array}{cccc}1&0&0&3\\0&1&0&1\\0&0&1&2\end{array}\right)$$
Now you can read off the solution: x= 3, y= 1, z= 2.

We didn't have to find either the inverse matrix nor the determinant to solve that. If we did want to find the inverse matrix, we would replace that fourth column by the identity matrix. The same row operations that change the matrix A into the identity matrix change the identity matrix into A-1.

But even finding the determinant is easy this way: just keep track of the "swaps" and "divisions". We swapped two rows: that will multiply the determinant by -1. We divided one two by -3. To "get it back", we must multiply the determinant by -3. We divided a row by 9. To "get it back", we must multiply the determinant by 9. Since the determinant of the final matrix (the identity matrix) is obviously 1, the original matrix had determinant (-1)(-3)(9)= 27.

7. May 10, 2007