Steply

Solve x - y = 2, 2x + y = 7 by gaussian elimination

Step by step, with the reason for every step · Gaussian elimination · Algebra 2

Step by step

The question

Question: solve x − y = 2 and 2x + y = 7 by Gaussian elimination.

x − y = 2①

We want the x and y that make both true.

2x + y = 7②

We will use three moves on the rows.

Swap two rows.

Times a row by a number that is not 0.

Add a multiple of one row to another.

Each move keeps the equations true, like in elimination.

swap two rows
× a row by a number (not 0)
add a multiple of one row to another

1 Write the augmented matrix

Each row is one equation: the numbers in front of x and y, then the number on the right.

The bar stands for the = signs.

This is called an augmented matrix.

= [1, −1, 2; 2, 1, 7]

We call the rows R 1 and R 2.

Our goal: 1s down the diagonal, and 0s under them.

This shape is called row-echelon form.

Then we go back up, one letter at a time.

goal: 1s down the diagonal, 0s under them

2 Get 0s under the 1 in column 1

→ [1, −1, 2; 0, 3, 3]

Careful!

A row move works on the whole row, the number after the bar too.

That number is the right side of the equation.

Careful: the whole row, after the bar too

3 Get a 1 in row 2

→ [1, −1, 2; 0, 1, 1]

4 Back substitution

Start at the bottom.

Each row is an equation again.

Row 2 is 1y = 1, with 0 for the other letters.

So y = 1.

y = 1

Row 1 is the equation x − y = 2.

x − y = 2

We know y = 1.

We put it in.

x − 1 = 2

Work it out: x − 1 = 2.

x − 1 = 2

To remove the − 1, we add 1 on both sides.

x − 1 + 1 = 2 + 1

So x = 3.

x = 3

We write it as (3, 1).

(x, y) = (3, 1)

5 Check

Let's check in every equation.

We put x = 3, y = 1 into ①.

① 3 − 1 = 2

We get 2, the same as the right side.

Now ②.

② 2(3) + 1 = 6 + 1 = 7

We get 7, the same as the right side.

Both work.

So the answer is right!

Let's look back.

First: write the augmented matrix.

Then: get 0s under the 1 in column 1.

Then: get a 1 in row 2.

Then: back substitution.

Last: check.

Answer
(x, y) = (3, 1)

Your turn

Try this one yourself, then check:

Solve x − y = 1, 3x + y = 7
Show the answer
(x, y) = (2, 1)

More from Gaussian elimination

The whole lesson: Gaussian elimination →