# Given the following set of linear equations x_1 + 2x_2 + x_3 + x_4 =7 2x_1 + 4x_3 - 2x_4 = -8 ...

## Question:

Given the following set of linear equations

{eq}x_1 + 2x_2 + x_3 + x_4 =7 {/eq}

{eq}2x_1 + 4x_3 - 2x_4 = -8 {/eq}

{eq}x_1 + x_2 + x_4 = 6 {/eq}

{eq}-x_1 + x_2 - x_3 + 2x_4 = 8 {/eq}

a) Write it in the form of Ax = b

b)Use Guass elimination method to find the solution of the linear system

d) Use matrix multiplication to check your answer, i.e. Verify that Ax = b by multiplying matrix A with your answer for b

## Gaussian Elimination

A system of linear equations can be solved using the technique of Gaussian Elimination. First, the system must be translated into an augmented matrix, using the coefficients of the variables and the constant terms. Then, the matrix must be put into reduced row-echelon form by using row operations. Then, the matrix can be translated back into a system of equations, and the result will be the solution to the original system of equations. Gaussian Elimination is equivalent to the technique of elimination generally learned when solving a system of two linear equations in two variables, but standard elimination can get much more difficult with more equations and more variables. Gaussian elimination is equivalent, but cleverly hides the variables by working simply with a matrix.

a)
The matrix A is found using the coefficients of the variables.

{eq}\begin{bmatrix} 1&2&1&1\\ 2&0&4&-2\\ 1&1&0&1\\ -1&1&-1&2 \end{bmatrix} \begin{bmatrix} x_1\\ x_2\\ x_3\\ x_4 \end{bmatrix} = \begin{bmatrix} 7\\ -8\\ 6\\ 8 \end{bmatrix} {/eq}

b) Writing as an augmented matrix,

{eq}\begin{bmatrix} 1&2&1&1&|&7\\ 2&0&4&-2&|&-8\\ 1&1&0&1&|&6\\ -1&1&-1&2&|&8 \end{bmatrix} {/eq}

Using the row operations R2 -> R2+2R4 , R3->R3-R1 , and R4->R4+R1

{eq}\begin{bmatrix} 1&2&1&1&|&7\\ 0&2&2&2&|&8\\ 0&-1&-1&0&|&-1\\ 0&3&0&3&|&15 \end{bmatrix} {/eq}

Using the row operation R2 -> 0.5R2

{eq}\begin{bmatrix} 1&2&1&1&|&7\\ 0&1&1&1&|&4\\ 0&-1&-1&0&|&-1\\ 0&3&0&3&|&15 \end{bmatrix} {/eq}

R1-> R1+2R3, R3-> R3+R2, R4-> R4+3R3

{eq}\begin{bmatrix} 1&0&-1&1&|&5\\ 0&1&1&1&|&4\\ 0&0&0&1&|&3\\ 0&0&-3&3&|&12 \end{bmatrix} {/eq}

R3<-> -1/3 R4

{eq}\begin{bmatrix} 1&0&-1&1&|&5\\ 0&1&1&1&|&4\\ 0&0&1&-1&|&-4\\ 0&0&0&1&|&3 \end{bmatrix} {/eq}

R1->R1+R3, R2->R2-R3

{eq}\begin{bmatrix} 1&0&0&0&|&1\\ 0&1&0&2&|&8\\ 0&0&1&-1&|&-4\\ 0&0&0&1&|&3 \end{bmatrix} {/eq}

R2-> R2-2R4 , R3-> R3+R4

{eq}\begin{bmatrix} 1&0&0&0&|&1\\ 0&1&0&0&|&2\\ 0&0&1&0&|&-1\\ 0&0&0&1&|&3 \end{bmatrix} {/eq}

The solution is {eq}x_1=1 , x_2=2 , x_3=-1 , x_4=3 {/eq}

c) {eq}\begin{bmatrix} 1\\ 2\\ -1\\ 3 \end{bmatrix} {/eq}

d)

{eq}\begin{bmatrix} 1&2&1&1\\ 2&0&4&-2\\ 1&1&0&1\\ -1&1&-1&2 \end{bmatrix} \begin{bmatrix} 1\\ 2\\ -1\\ 3 \end{bmatrix} = \begin{bmatrix} 1+4-1+3\\ 2-4-6\\ 1+2+3\\ -1+2+1+6 \end{bmatrix} = \begin{bmatrix} 7\\ -8\\ 6\\ 8 \end{bmatrix} {/eq} 