# Solve the system of equations using matrices3x - 2y = 31 3x + 2y = -1 & x = -2y + 6 2x + 2y = 16

*print*Print*list*Cite

(1) Solve the system `3x-2y=31,3x+2y=-1` using matrices:

There are number of ways to use matrices to solve a linear system.

(a) Cramers rule: If Ax+By=C and Dx+Ey=F then the solutions are given by ` ``y=(|[A,C],[D,F]|)/(|[A,B],[D,E]|)` and `x=(|[C,B],[F,E]|)/(|[A,B],[D,E]|)` where the vertical bars indicate that you are to take the determinant of the matrix. `|[a,b],[c,d]|=ad-bc`

So `x=(|[31,-2],[-1,2]|)/(|[3,-2],[3,2]|)=(62-2)/(6-(-6))=5`

`y=(|[3,31],[3,-1]|)/(|[3,-2],[3,2]|)=(-3-93)/(6-(-6))=-8`

**So the solution is (5,-8)**.

(b) Another method is to use inverse matrices:

If `AX=B` then `X=A^(-1)B` where A,B, and X are matrices, `A^(-1)` is the multiplicative inverse of matrix A, and we assume all multiplications are defined and that A has an inverse. (The determinant of square matrix A is nonzero)

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

Write the problem as `([3,-2],[3,2])([x],[y])=([31],[-1])`

Then `([3,-2],[3,2])^(-1)=1/12([2,2],[-3,3])=([1/6,1/6],[-1/4,1/4])` so

`([x],[y])=([1/6,1/6],[-1/4,1/4])([31],[-1])=([31/6-1/6],[-31/4-1/4])=([5],[-8])`

(2) Solve x=-2y+6,2x+2y=16:

Writing both in standard form we get:

x+2y=6

2x+2y=16

Another method is to use gaussian elimination; get the augmented matrix in row echelon form:

`([1,2,|,6],[2,2,|,16])` Add -2 times row 1 to row 2:

`([1,2,|,6],[0,-2,|,4])` Multiply row 2 by -1/2:

`([1,2,|,6],[0,1,|,-2])` so y=-2; using back substitution we get x=10

Or we can continue to reduced row echelon form: add -2 times row 2 to row 1:

`([1,0,|,10],[0,1,|,-2])` so we see that x=10,y=-2

**The solution is (10,-2)**