MathsAdvanced Equations

3-Variable System of Equations
solver.

Row operations on three equations in x, y and z, with every step shown.

How it's worked out

Each equation has the shape below, with its own numbers a, b, c and d. A solution is an ordered triple, one value each for x, y and z that makes all three equations true at once. Each equation is a flat plane in space, so a solution is a point that sits on all three planes.

ax+by+cz\displaystyle a x + b y + c z=d\displaystyle {}= d

Write the numbers as a grid with the right sides in a last column. This grid is the augmented matrix. Three row operations never change the answer: swap two rows, multiply a row by a number that is not 0, and add a multiple of one row to another. The tool uses them to clear each column until the left part reads as 1s down the middle and 0s elsewhere.

In the decimal view, each column starts from the row with the largest entry in it. This is called partial pivoting. A small pivot can cause large round-off errors/03%3A_System_of_Equations/3.03%3A_Partial_Pivoting), so a swap first keeps the decimals honest. The exact view works with whole numbers and fractions instead, so nothing is rounded.

Two numbers decide which case you have. The rank is the number of pivots that elimination finds. Compare the rank of the left part, A, with the rank of the whole grid, [A | b].

The four cases, each solved by the engine
CaseDRank ARank [A | b]
One point−133
A line022
A plane011
None023

When the determinant D is not 0, there is one solution, and Cramer's rule gives each unknown as one determinant over D. When D is 0, Cramer's rule cannot tell you whether there are no solutions or many. Elimination can.

Worked examples

A box office counts three kinds of ticket

A theater sells adult tickets at 12 dollars, child tickets at 8 dollars and senior tickets at 10 dollars. One night it sells 200 tickets for 2,040 dollars, and twice as many adults as seniors. Let x, y and z be the adult, child and senior counts.

x+y+z\displaystyle x + y + z=200\displaystyle {}= 200
12x+8y+10z\displaystyle 12x + 8y + 10z=2,040\displaystyle {}= 2,040
x−2z\displaystyle x − 2z=0\displaystyle {}= 0

The third equation says x − 2z = 0, which is the "twice as many" fact with z moved across. The solver gives 88 adults, 68 children and 44 seniors, and D is 10. Whole numbers are a good sign that the totals were typed right.

If the takings had been 20 dollars higher, the what-if table gives x = 92, y = 62 and z = 46. So one wrong digit in the total changes all three counts, not just one.

Open this example in the tool

Lena fits a curve through three points

Lena wants the parabola that passes through (1, 4), (2, 9) and (3, 16). Its equation is y = ax² + bx + c, so each point gives one linear equation in a, b and c. She types a, b and c into the x, y and z columns.

At x = 1 the equation reads a + b + c = 4. At x = 2 it reads 4a + 2b + c = 9, and at x = 3 it reads 9a + 3b + c = 16.

The answer is a = 1, b = 2 and c = 1, so the curve is y = x² + 2x + 1. D is −2.

Open this example in the tool

Omar finds a line of solutions

Omar's system is x + y + z = 6, x − y + z = 2 and 2x + 2z = 8. Add the first two equations and you get the third, so it brings no new fact. Elimination finds only two pivots, and the z column has none.

So z is free. Call it t, and the answer is x = 4 − t, y = 2, z = t. Each value of t gives one point on the line where the three planes meet. At t = 0 the point is (4, 2, 0); put it back into all three equations and each one holds.

The ranks tell the story: rank A and rank [A | b] are both 2, one short of 3, so there is one free unknown.

Open this example in the tool

Reading your result

One point. The three planes cross at a single spot, and the slice shows three lines meeting there. Put the answer back into each equation as a check; the last step of the working does this for you.

A line or a plane. The planes share a whole line (rank 2) or are all the same plane (rank 1). Your answer is a rule in t, or in t and s. You may see a different but equal form in a textbook, because any free unknown can be picked as the parameter.

No solution. Elimination leaves a row that reads 0 = a number other than 0. For x + 2y + 3z = 4 with 2x + 4y + 6z = 9, the second plane is parallel to the first, so rank [A | b] is 3 while rank A is 2. The same can happen with no two planes parallel: they can meet in pairs along three parallel lines, like the sides of a tent.

Small D, big moves. If D is close to 0, the planes are nearly parallel, and a small change on the right side moves the answer a lot. In the default system D is −1, and the what-if table shows the size of each move.

Common mistakes

  • Leaving a box empty for a missing unknown. If an equation has no y, its y number is 0. Type 0 so every column lines up.
  • Moving a term without its sign. In x = 2z, the z term goes across as −2z, so the row reads 1, 0, −2, 0.
  • Reading D = 0 as "no solution". A zero determinant only says there is not exactly one answer. The ranks decide between none and infinitely many.
  • Stopping at the first pair. OpenStax solves x − 2y + 3z = 9, −x + 3y − z = −6 and 2x − 5y + 5z = 17 to get (1, −1, 2). A triple that fits two equations but not the third is not a solution, so check all three.

Questions people ask

Not always. D = 0 means there is no single answer, which covers two cases: no solution at all, or infinitely many. Row reduce the grid and compare the rank of A with the rank of [A | b]. Equal ranks mean infinitely many, and a higher rank for [A | b] means none.

Sources