Gaussian Elimination Example By Abel Barraza

A simple example of Gaussian Elimination:

x2 + 2x3 = 0
4x1 + x2 = 1
x1 + 2x2 + 3x3 = 0

The Augmented matrix form is

0 1 2 0
4 1 0 1
1 2 3 0
Swapping row2 with row1
4 1 0 1
0 1 2 0
1 2 3 0

Divide row1 by 4
1 1/4 0 1/4
0 1 2 0
1 2 3 0

Add (-1 * row1) to row3
1 1/4 0 1/4
0 1 2 0
0 7/4 3 -1/4

Add (-7/4 * row2) to row3
1 1/4 0 1/4
0 1 2 0
0 0 -1/2 -1/4

Divide row3 by -1/2
1 1/4 0 1/4
0 1 2 0
0 0 1 1/2

Add (-2 * row3) to row2
1 1/4 0 1/4
0 1 0 -1
0 0 1 1/2

Add (-1/4 * row2) to row1
1 0 0 1/2
0 1 0 -1
0 0 1 1/2

your answer should be
x1 = 0.5
x2 = -1
x3 = 0.5
to check it, use MatlaB function:
rref()
let A=[0,1,2,0;4,1,0,1;1,2,3,0]
then
rref(A)
the just press enter and you should get these values
x1 = 0.5
x2 = -1
x3 = 0.5

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License