Steply

Solve x - y + z = 1, 3x - y + z = 5, 2x + y + z = 9 by Cramer's rule

Step by step, with the reason for every step · Cramer's rule with three equations · Algebra 2

Step by step

The question

Question: solve x − y + z = 1, 3x − y + z = 5, 2x + y + z = 9 by Cramer's rule.

x − y + z = 1①
3x − y + z = 5②

Three equations, three letters: x, y and z.

2x + y + z = 9③

Cramer's rule, like with two equations: x is D x over D, y is D y over D, z is D z over D.

Four determinants, each by the diagonals.

x = DxD, y = DyD, z = DzD

1 Find D

D: the numbers in front of x, y and z, in their places.

D = |1, −1, 1; 3, −1, 1; 2, 1, 1|1, −1; 3, −1; 2, 1

We write the first two columns again, on the right.

Then every diagonal has three numbers.

Down: 1 × (−1) × 1, −1 × 1 × 2, 1 × 3 × 1.

down = 1 × (−1) × 1 + (−1) × 1 × 2 + 1 × 3 × 1

−1, −2, 3.

Together: 0.

= −1 + (−2) + 3 = 0

Up: 2 × (−1) × 1, 1 × 1 × 1, 1 × 3 × (−1).

up = 2 × (−1) × 1 + 1 × 1 × 1 + 1 × 3 × (−1)

−2, 1, −3.

Together: −4.

= −2 + 1 + (−3) = −4

Down minus up: 0 minus (−4) is 4.

So D = 4.

D = 0 − (−4) = 4

2 Find Dx

D x: the x column is replaced by the right sides, 1, 5, 9.

Dx = |1, −1, 1; 5, −1, 1; 9, 1, 1|1, −1; 5, −1; 9, 1

Down: 1 × (−1) × 1, −1 × 1 × 9, 1 × 5 × 1.

down = 1 × (−1) × 1 + (−1) × 1 × 9 + 1 × 5 × 1

−1, −9, 5.

Together: −5.

= −1 + (−9) + 5 = −5

Up: 9 × (−1) × 1, 1 × 1 × 1, 1 × 5 × (−1).

up = 9 × (−1) × 1 + 1 × 1 × 1 + 1 × 5 × (−1)

−9, 1, −5.

Together: −13.

= −9 + 1 + (−5) = −13

Down minus up: −5 minus (−13) is 8.

So D x = 8.

Dx = −5 − (−13) = 8

3 Find Dy

D y: the y column is replaced by the right sides, 1, 5, 9.

Dy = |1, 1, 1; 3, 5, 1; 2, 9, 1|1, 1; 3, 5; 2, 9

Down: 1 × 5 × 1, 1 × 1 × 2, 1 × 3 × 9.

down = 1 × 5 × 1 + 1 × 1 × 2 + 1 × 3 × 9

5, 2, 27.

Together: 34.

= 5 + 2 + 27 = 34

Up: 2 × 5 × 1, 9 × 1 × 1, 1 × 3 × 1.

up = 2 × 5 × 1 + 9 × 1 × 1 + 1 × 3 × 1

10, 9, 3.

Together: 22.

= 10 + 9 + 3 = 22

Down minus up: 34 minus 22 is 12.

So D y = 12.

Dy = 34 − 22 = 12

4 Find Dz

D z: the z column is replaced by the right sides, 1, 5, 9.

Dz = |1, −1, 1; 3, −1, 5; 2, 1, 9|1, −1; 3, −1; 2, 1

Careful!

For D z we replace the z column, the third one.

The other two stay.

Careful: Dz: the third column is replaced

Down: 1 × (−1) × 9, −1 × 5 × 2, 1 × 3 × 1.

down = 1 × (−1) × 9 + (−1) × 5 × 2 + 1 × 3 × 1

−9, −10, 3.

Together: −16.

= −9 + (−10) + 3 = −16

Up: 2 × (−1) × 1, 1 × 5 × 1, 9 × 3 × (−1).

up = 2 × (−1) × 1 + 1 × 5 × 1 + 9 × 3 × (−1)

−2, 5, −27.

Together: −24.

= −2 + 5 + (−27) = −24

Down minus up: −16 minus (−24) is 8.

So D z = 8.

Dz = −16 − (−24) = 8

5 Divide

x is D x over D: 8/4 is 2.

x = DxD = 84 = 2

y is D y over D: 12/4 is 3.

y = DyD = 124 = 3

z is D z over D: 8/4 is 2.

z = DzD = 84 = 2

So the answer is (2, 3, 2).

(x, y, z) = (2, 3, 2)

6 Check

Let's check in every equation.

We put x = 2, y = 3, z = 2 into ①.

① 2 − 3 + 2 = 1

We get 1, the same as the right side.

Now ②.

② 3(2) − 3 + 2 = 6 − 3 + 2 = 5

We get 5, the same as the right side.

Now ③.

③ 2(2) + 3 + 2 = 4 + 3 + 2 = 9

We get 9, the same as the right side.

All of them work.

So the answer is right!

Let's look back.

First: find D.

Then: find Dx.

Then: find Dy.

Then: find Dz.

Then: divide.

Last: check.

Answer
(x, y, z) = (2, 3, 2)

Your turn

Try this one yourself, then check:

Solve 2x − y + z = 2, 2x − y + 2z = 4, x + 2y + z = 12
Show the answer
(x, y, z) = (2, 4, 2)

More from Cramer's rule with three equations

The whole lesson: Cramer's rule with three equations →