Row reduction, step by step

Pick an example or type your own three equations in x, y and z. Then press Next step to let the demo choose a row operation, or use the three operations yourself. The aim is zeros in the bottom-left corner, so the system becomes a staircase. Once it is, the demo climbs back up to find z, then y, then x. Fractions stay exact.

Your equations (each row is ▢x + ▢y + ▢z = ▢)

The system now

Or do a row operation yourself

Swap R and R Multiply R by Add × R to R

Steps so far

    What's going on

    Each row is one equation, with the numbers after the bar on the right-hand side. Three things can be done to a system without changing its solutions: swap two equations, multiply an equation by a number that is not zero, and add a multiple of one equation to another. Every step here is one of those three.

    The plan is to use row 1 to remove x from rows 2 and 3, then use row 2 to remove y from row 3. The shaded zeros show the staircase forming, and the orange cells are the pivots, the first non-zero number in each row. The last row then has only z in it, so it can be solved at once. Put that z into row 2 to get y, then both into row 1 to get x. That is back-substitution.

    Two things can go wrong, and both show up in the last row. If it becomes 0 = 5 (or any non-zero number), the equations contradict each other and there is no solution. If it becomes 0 = 0 (and no other row says 0 = a non-zero number), one equation was a combination of the others and told you nothing new, so there are infinitely many solutions: at least one unknown is free and the others follow from the free ones.

    A computer solving thousands of equations uses the same three operations, one row at a time.

    Sheet: Three equations, three unknowns.