# 3x+y=4 and x-2y=6 in matrix form

*print*Print*list*Cite

### 1 Answer

Suppose we are asked to solve the system `3x+y=4,x-2y=6` using matrices:

(1) **One method is to form the augmented matrix consisting of the coefficients and the constants. Then use Gauss-Jordan row reduction to solve the system:**

The augmented matrix is `([3,1,4],[1,-2,6])` . We can use elementary row operations to put the matrix in row-echelon or reduced row-echelon form. The operations are multiplying a row by a non-zero constant, adding a multiple of one row to a multiple of another row, and swapping rows.

`([3,1,4],[1,-2,6])->([1,-2,6],[3,1,4])` Now the "1" in the upper left corner is the pivot: we want to make the rest of the elements in the first column zero. So add -3 times row 1 to row 2:

`->([1,-2,6],[0,7,-14])->([1,-2,6],[0,1,-2])` (After multiplying row 2 by `1/7` )

This matrix is in row-echelon form. We can find the solution from here: y=-2 and x-2y=6 ==> x+4=6 so x=2.

However, we could continue with the matrix and put it in reduced row-echelon form:

Now the "1" in row 2 is the pivot; again we want to make the other entries in that column zero. So we add 2 times row 2 to row 1:

`->([1,0,2],[0,1,-2])` so x=2 and y=-2 is the solution.

(2) **Another method is to use inverse matrices:**

`([3,1],[1,-2])([x],[y])=([4],[6])` If AX=B then `A^(-1)AX=X=A^(-1)B`

The inverse of a 2x2 matrix `([a,b],[c,d])` is `1/((ad-bc))([d,-b],[-c,a])`

So the inverse of `([3,1],[1,-2])` is `1/(-7)([-2,-1],[-1,3])=([2/7,1/7],[1/7,-3/7])`

Then `([x],[y])=([2/7,1/7],[1/7,-3/7])([4],[6])=([14/7],[-14/7])=([2],[-2])` so x=2,y=-2 is the solution.

(3) **A third method using matrices is to apply Cramer's rule:**

In the case of a 2x2 system with coefficient matrix `([a,b],[c,d])` and constant matrix `([e],[f])` the solution is given by:

`x=|[e,b],[f,d]|/|[a,b],[c,d]|` and `y=|[a,e],[c,f]| / |[a,b],[c,d]|` where |A| is the determinant of the matrix.

Then `x=|[4,1],[6,-2]|/|[3,1],[1,-2]|=(-14)/-7=2` and

`y=|[3,4],[1,6]|/|[3,1],[1,-2]|=14/-7=-2`