Skip to content
Mathematics

System of Linear Equations in Three Variables

Find a triple that satisfies three equations at once. Learn elimination, interpret the geometry, and explore what changes when equations repeat or contradict one another.

Three unknowns, shared constraints

A linear equation in three variables has the form below. The coefficients and right-hand side are real numbers; each variable appears only to the first power. There are no products of variables.

ax+by+cz=dax+by+cz=d

A system puts several such equations together. A solution is an ordered triple (x,y,z)(x,y,z) that makes every equation true at the same time. In this example:

{x+y+z=62x−y+z=3x+2y−z=2\begin{cases}x+y+z=6\\2x-y+z=3\\x+2y-z=2\end{cases}

The triple (1,2,3)(1,2,3) works in all three equations. A triple that works in only one or two equations is not a solution to the system.

Think of intersecting planes

When at least one variable coefficient is nonzero, an equation describes a plane in three-dimensional space. Solving the system means finding the intersection shared by all three planes. Three equations do not automatically guarantee one solution.

One solution

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

Three independent constraints determine one point. Each variable has a pivot after elimination.

Infinitely many solutions

0=00=0

The equations are consistent but leave at least one variable free. The common set can be a line or a plane.

No solution

0=10=1

Elimination exposes a contradiction. There is no point that satisfies all three equations.

A zero row such as 0=00=0 carries no new information; it does not by itself prove inconsistency. A row such as 0=10=1 is impossible. If every equation is an identity, the solution set is all of three-dimensional space.

Solve the example by elimination

Elimination combines equations to remove one variable, leaving a simpler system. Call the equations R1R_1, R2R_2, and R3R_3 in their original order.

Remove the first variable

Subtract twice the first equation from the second. Subtract the first equation from the third. The first variable disappears from both new equations.

R2−2R1:−3y−z=−9R_2-2R_1:\quad-3y-z=-9
R3−R1:y−2z=−4R_3-R_1:\quad y-2z=-4

Reduce to one variable

Add the first reduced equation to three times the second reduced equation. Their terms in yy cancel.

(−3y−z)+3(y−2z)=−9+3(−4)(-3y-z)+3(y-2z)=-9+3(-4)
−7z=−21⟹z=3-7z=-21\quad\Longrightarrow\quad z=3

Substitute back and check

Substitute into the reduced equation to find yy, then use the original first equation to find xx.

y−2(3)=−4⟹y=2y-2(3)=-4\quad\Longrightarrow\quad y=2
x+2+3=6⟹x=1x+2+3=6\quad\Longrightarrow\quad x=1

Check against every original equation, including any equation you did not use at the last step.

1+2+3=62(1)−2+3=31+2(2)−3=2\begin{aligned}1+2+3&=6\\2(1)-2+3&=3\\1+2(2)-3&=2\end{aligned}

Keep the work organized with a matrix

An augmented matrix stores the coefficients in the order x,y,zx,y,z, with the constants after the divider. Include a zero wherever a variable is missing.

[11162−11312−12]\left[\begin{array}{ccc|c}1&1&1&6\\2&-1&1&3\\1&2&-1&2\end{array}\right]

You can swap two rows, multiply a row by a nonzero number, or add a multiple of one row to another. These operations preserve the solution set. Apply each operation to the entire row, including the constant.

A pivot is the leading nonzero entry of a row after reduction. Gaussian elimination makes a staircase of pivots, then uses back-substitution. The explorer continues to reduced row-echelon form: each pivot is one, and its column is zero in every other row, so the answers can be read directly.

Explore a system, one operation at a time

Choose an example or edit the coefficients. Follow the row operations to see why the system has its solution type.

Example systems

Use integers from −20-20 to 2020. A zero coefficient leaves that variable out of the equation.

Equation 1
Equation 2
Equation 3

The last column is the right-hand side. If all three variable coefficients vanish, the equation is an identity or a contradiction rather than a plane.

{x+y+z=62x−y+z=3x+2y−z=2\begin{cases}x+y+z=6\\2x-y+z=3\\x+2y-z=2\end{cases}

Step 1 of 9

Initial augmented matrix\text{Initial augmented matrix}
[11162−11312−12]\left[\begin{array}{ccc|c}1&1&1&6\\2&-1&1&3\\1&2&-1&2\end{array}\right]

One solution

Every variable has a pivot. The three planes meet at exactly one point.

x=1y=2z=3\begin{aligned}x&=1\\y&=2\\z&=3\end{aligned}

Results and row operations use exact fractions. Every displayed matrix has the same solutions as the original system.

Read the final rows

Three pivots give a unique solution. If there is no contradiction but fewer than three pivots, at least one variable is free. Give each free variable a real parameter and express the other variables in terms of it.

{x+y+z=62x−y+z=33x+2z=9\begin{cases}x+y+z=6\\2x-y+z=3\\3x+2z=9\end{cases}

Here the third equation is the sum of the first two, so it adds no independent constraint. Set z=tz=t. Elimination gives this whole family:

x=3−23ty=3−13tz=tt∈R\begin{aligned}x&=3-\frac23t\\y&=3-\frac13t\\z&=t\end{aligned}\qquad t\in\mathbb{R}

Choosing t=3t=3 gives (1,2,3)(1,2,3) again, but many other choices also work. One successful triple does not prove a solution is unique. If the third right-hand side were 88 instead of 99, subtracting the first two equations from it would give the contradiction 0=−10=-1.

Turn a story into three equations

A group buys six tickets for ten currency units. Adult tickets cost three units, student tickets two, and child tickets one. The group buys one more student ticket than adult ticket. Let xx, yy, and zz count adult, student, and child tickets.

x+y+z=6(total tickets)3x+2y+z=10(total cost)−x+y=1(ticket difference)\begin{aligned}x+y+z&=6&&\text{(total tickets)}\\3x+2y+z&=10&&\text{(total cost)}\\-x+y&=1&&\text{(ticket difference)}\end{aligned}

The solution is (x,y,z)=(1,2,3)(x,y,z)=(1,2,3). Check the counts, the cost, and the difference. Counts must also be nonnegative integers; the context can impose restrictions beyond the equations.

Try it yourself

Solve or classify each system before revealing the explanation.

  1. 1. Solve by substitution or elimination.

    {x+y+z=6x−y=0z=2\begin{cases}x+y+z=6\\x-y=0\\z=2\end{cases}
    Show explanation
    x=y=2,z=2x=y=2,\qquad z=2

    The last equation fixes the third variable. The second makes the first two equal, and the first then gives twice either of them as four.

  2. 2. Find a family of solutions, not just one point.

    {x+y+z=42x+2y+2z=8x−y=0\begin{cases}x+y+z=4\\2x+2y+2z=8\\x-y=0\end{cases}
    Show explanation
    x=ty=tz=4−2tt∈R\begin{aligned}x&=t\\y&=t\\z&=4-2t\end{aligned}\qquad t\in\mathbb{R}

    The second equation repeats the first. The third makes the first two variables equal. Choose their common value freely and use the first equation to find the third.

  3. 3. Decide whether the system is consistent.

    {x+y+z=42x+2y+2z=9x−y+z=1\begin{cases}x+y+z=4\\2x+2y+2z=9\\x-y+z=1\end{cases}
    Show explanation
    R2−2R1:0=1R_2-2R_1:\quad0=1

    Twice the first equation would give a right-hand side of eight, but the second says nine. That contradiction is enough to rule out every possible solution.