Solve a system of three linear equations in three unknowns. Use elimination pairwise to reduce to two equations in two unknowns, solve those, then back-substitute to find all three variables. Check all three originals.

Example

Use elimination to solve for y and z, then back-substitute for x.

highlighted = computed this step

Step 1 — Set up

Set up the expression.

x+y+z=6, xy+z=2, x+yz=0x+y+z= 6 ,\ x-y+z= 2 ,\ x+y-z= 0
Start with three equations and three variables.eq1x + y + z = 6eq2x - y + z = 2eq3x + y - z = 0eq2 - eq1--solve y--eq3 - eq1--solve z--back-substitute--Check: x + y + z = 6 with (1, 2, 3)

Step 2 — Eliminate x and z

Subtract the first equation from the second; the right side is -4.

2y=-4- 2 y= \hl{-4}
Subtract equation 1 from equation 2 to solve for y.eq1x + y + z = 6eq2x - y + z = 2eq3x + y - z = 0eq2 - eq1-2y = -4solve y--eq3 - eq1--solve z--back-substitute--Check: x + y + z = 6 with (1, 2, 3)

Step 3 — Solve y

Solve y: -4 / negative 2 = 2.

y=4/2=2y= -4 /- 2 = \hl{2}
Divide by -2 to find y.eq1x + y + z = 6eq2x - y + z = 2eq3x + y - z = 0eq2 - eq1-2y = -4solve yy = -4 / -2 = 2eq3 - eq1--solve z--back-substitute--Check: x + y + z = 6 with (1, 2, 3)

Step 4 — Eliminate x and y

Subtract the first equation from the third; the right side is -6.

2z=-6- 2 z= \hl{-6}
Subtract equation 1 from equation 3 to solve for z.eq1x + y + z = 6eq2x - y + z = 2eq3x + y - z = 0eq2 - eq1-2y = -4solve yy = -4 / -2 = 2eq3 - eq1-2z = -6solve z--back-substitute--Check: x + y + z = 6 with (1, 2, 3)

Step 5 — Solve z

Solve z: -6 / negative 2 = 3.

z=6/2=3z= -6 /- 2 = \hl{3}
Divide by -2 to find z.eq1x + y + z = 6eq2x - y + z = 2eq3x + y - z = 0eq2 - eq1-2y = -4solve yy = -4 / -2 = 2eq3 - eq1-2z = -6solve zz = -6 / -2 = 3back-substitute--Check: x + y + z = 6 with (1, 2, 3)

Step 6 — Back-substitute

Back-substitute: 6 - 2 - 3 = 1.

x=623=1x= 6 - 2 - 3 = \hl{1}
Use x + y + z = 6 after y and z are known.eq1x + y + z = 6eq2x - y + z = 2eq3x + y - z = 0eq2 - eq1-2y = -4solve yy = -4 / -2 = 2eq3 - eq1-2z = -6solve zz = -6 / -2 = 3back-substitutex = 6 - 2 - 3 = 1Check: x + y + z = 6 with (1, 2, 3)

Step 7 — Solution

Read the final result.

(1,2,3)( 1 , 2 , 3 )
Solution: (1, 2, 3).eq1x + y + z = 6eq2x - y + z = 2eq3x + y - z = 0eq2 - eq1-2y = -4solve yy = -4 / -2 = 2eq3 - eq1-2z = -6solve zz = -6 / -2 = 3back-substitutex = 6 - 2 - 3 = 1(1, 2, 3)x1y2z3Check: x + y + z = 6 with (1, 2, 3)
three-variable Three-variable elimination: pair equations to eliminate one variable at a time. Two rounds of elimination yield each variable. Back-substitute from the last variable found to recover the rest. Verify all three.