# How do I use Gaussian elimination to solve a system of equations?

Aug 16, 2015

The goals of Gaussian elimination are to get $1$s in the main diagonal and $0$s in every position below the $1$s,

Then you can use back substitution to solve for one variable at a time.

#### Explanation:

EXAMPLE:

Use Gaussian elimination to solve the following system of equations.

$x + 2 y + 3 z = - 7$
$2 x - 3 y - 5 z = 9$
$- 6 z - 8 y + z = - 22$

Solution:

Set up an augmented matrix of the form.

$\left(\begin{matrix}1 & 2 & 3 & | & - 7 \\ 2 & 3 & - 5 & | & 9 \\ - 6 & - 8 & 1 & | & 22\end{matrix}\right)$

Goal 1. Get a 1 in the upper left hand corner.

Goal 2a: Get a zero under the 1 in the first column.

Multiply Row 1 by $- 2$ to get

$\left(\left(- 2 , - 4 , - 6 , | , 14\right)\right)$

Add the result to Row 2 and place the result in Row 2.

We signify the operations as -2R_2+R_1→R_2.

((1,2,3,|,-7),(2,3,-5,|,9),(-6,-8,1,|,22)) stackrel(-2R_1+R_2→R_2)(→) ((1,2,3,|,-7),(0,-7,-11,|,23),(-6,-8,1,|,22))

Goal 2b: Get another zero in the first column.

To do this, we need the operation 6R_1+R_3→R_3.

((1,2,3,|,-7),(0,-7,-11,|,23),(-6,-8,1,|,22)) stackrel(6R_2+R_3→R_3)(→) ((1,2,3,|,-7),(0,-7,-11,|,23),(0,4,19,|,-64))

Goal 2c. Get the remaining zero.

Multiply Row 2 by $- \frac{1}{7}$.

((1,2,3,|,-7),(0,-7,-11,|,23),(0,4,19,|,-64)) stackrel(-(1/7)R_2 → R_2)(→) ((1,2,3,|,-7),(0,1,11/7,|,-23/7),(0,4,19,|,-64))

Now use the operation -4R_2+R_3 →R_3.

((1,2,3,|,-7),(0,1,11/7,|,-23/7),(0,4,19,|,-64)) stackrel(-4R_2+R_3 →R_3)(→) ((1,2,3,|,-7),(0,1,11/7,|,-23/7),(0,0,89/7,|,-356/7))

Multiply the third row by $\frac{7}{89}$.

((1,2,3,|,-7),(0,1,11/7,|,-23/7),(0,0,89/7,|,-356/7)) stackrel(7/89R_3 →R_3)(→) ((1,2,3,|,-7),(0,1,11/7,|,-23/7),(0,0,1,|,-4))

Goal 3. Use back substitution to get the values of $x$, $y$, and $z$.

Goal 3a. Calculate $z$.

$z = - 4$

Goal 3b. Calculate $y$.

$y + \frac{11}{7} z = - \frac{23}{7}$
$y - \frac{44}{7} = - \frac{23}{7}$
$y = \frac{44}{7} - \frac{23}{7} = \frac{21}{7}$

$y = 3$

Goal 3c. Calculate x.

$x + 2 y + 3 z = - 7$
$x + 6 - 12 = - 7$
$x - 6 = - 7$

$x = 1$

The solution is $x = 1 , y = 3 , z = - 4$