How to Solve a System of Three Equations: A Complete Step-by-Step Guide
Learning how to solve a system of three equations is a milestone skill in algebra that opens the door to more advanced mathematics, engineering, economics, and computer science. But a system of three equations with three unknowns may look intimidating at first, but once you understand the core methods, the process becomes logical and repeatable. This guide walks you through the main techniques, including the substitution method, the elimination method, and matrix methods, so you can confidently tackle any three-variable system you encounter.
The official docs gloss over this. That's a mistake.
What Is a System of Three Equations?
A system of three equations is a set of three equations that share the same variables, usually x, y, and z. The goal is to find the values of these variables that satisfy all three equations at the same time. In geometric terms, each linear equation represents a flat plane in three-dimensional space, and the solution is the single point where all three planes intersect.
A typical system looks like this:
- Equation 1: x + y + z = 6
- Equation 2: 2x − y + z = 3
- Equation 3: x + 2y − z = 2
The solution to this system is the ordered triple (x, y, z) that makes every equation true. Not every system has a single solution, though. A system can have one unique solution, infinitely many solutions, or no solution at all, depending on how the planes relate to one another.
Why Solving Three-Variable Systems Matters
Before diving into the mechanics, it helps to understand why this skill is so valuable. Systems of three equations appear everywhere in the real world:
- Engineering: balancing forces acting in three directions
- Economics: finding equilibrium prices across multiple markets
- Chemistry: balancing complex chemical reactions
- Computer graphics: transforming and positioning objects in 3D space
Mastering these systems builds the foundation for linear algebra, a branch of mathematics that powers modern technology from search engines to machine learning.
Method 1: The Substitution Method
The substitution method works by solving one equation for a single variable, then plugging that expression into the other equations. This gradually reduces the number of variables until you can solve for each one.
Here is the step-by-step process using our example system:
-
Solve one equation for one variable. From Equation 1, solve for z: z = 6 − x − y
-
Substitute into the other two equations. Replace z in Equation 2 and Equation 3:
- Equation 2 becomes: 2x − y + (6 − x − y) = 3 → x − 2y = −3
- Equation 3 becomes: x + 2y − (6 − x − y) = 2 → 2x + 3y = 8
-
Solve the resulting two-variable system. You now have two equations with two unknowns:
- x − 2y = −3
- 2x + 3y = 8
From the first, x = 2y − 3. Substitute into the second: 2(2y − 3) + 3y = 8 → 4y − 6 + 3y = 8 → 7y = 14 → y = 2
-
Back-substitute to find the remaining variables.
- x = 2(2) − 3 = 1
- z = 6 − 1 − 2 = 3
The solution is (1, 2, 3). The substitution method is intuitive and reliable, especially when one variable already has a coefficient of 1.
Method 2: The Elimination Method
The elimination method (also called the addition method) removes variables by adding or subtracting equations. It is often faster than substitution when the coefficients line up nicely.
Using the same system:
- Equation 1: x + y + z = 6
- Equation 2: 2x − y + z = 3
- Equation 3: x + 2y − z = 2
Follow these steps:
-
Eliminate one variable from two pairs of equations. Add Equation 1 and Equation 3 to eliminate z: (x + y + z) + (x + 2y − z) = 6 + 2 → 2x + 3y = 8
-
Eliminate the same variable from another pair. Add Equation 2 and Equation 3: (2x − y + z) + (x + 2y − z) = 3 + 2 → 3x + y = 5
-
Solve the two-variable system. You now have:
- 2x + 3y = 8
- 3x + y = 5
From the second equation, y = 5 − 3x. Substitute into the first: 2x + 3(5 − 3x) = 8 → 2x + 15 − 9x = 8 → −7x = −7 → x = 1
-
Finish the remaining variables.
- y = 5 − 3(1) = 2
- Substitute into Equation 1: 1 + 2 + z = 6 → z = 3
Once again, the solution is (1, 2, 3). The elimination method shines when you want to avoid fractions and work with clean integer coefficients.
Method 3: Gaussian Elimination (Matrix Row Reduction)
While substitution and elimination work well by hand for small systems, Gaussian elimination systematizes the elimination process using matrices. This method scales efficiently to larger systems and forms the basis for computer algorithms.
The Augmented Matrix
First, strip the variables away and write the coefficients and constants as an augmented matrix:
$ \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \ 2 & -1 & 1 & 3 \ 1 & 2 & -1 & 2 \end{array}\right] $
The vertical bar separates the coefficients (left) from the constants (right). 3. Swap two rows. On top of that, 2. And the goal is to transform this matrix into row-echelon form (an upper triangular matrix) using three elementary row operations:
- Multiply a row by a non-zero scalar. Add a multiple of one row to another row.
Step-by-Step Reduction
1. Clear the first column below the pivot (Row 1, Column 1).
The pivot is already 1. Eliminate the 2 in Row 2 and the 1 in Row 3.
- $R_2 \leftarrow R_2 - 2R_1$
- $R_3 \leftarrow R_3 - R_1$
$ \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \ 0 & -3 & -1 & -9 \ 0 & 1 & -2 & -4 \end{array}\right] $
2. Establish a pivot in the second row.
It is often cleaner to have a 1 as the pivot. Swap Row 2 and Row 3, then multiply the new Row 2 by -1 to avoid fractions temporarily (or just proceed with the 1).
- Swap $R_2 \leftrightarrow R_3$:
$ \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \ 0 & 1 & -2 & -4 \ 0 & -3 & -1 & -9 \end{array}\right] $
3. Clear the second column below the new pivot.
Eliminate the -3 in Row 3 using Row 2 And it works..
- $R_3 \leftarrow R_3 + 3R_2$
$ \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \ 0 & 1 & -2 & -4 \ 0 & 0 & -7 & -21 \end{array}\right] $
The matrix is now in row-echelon form (upper triangular).
Back Substitution
Translate the bottom row back into an equation: $-7z = -21 \implies \mathbf{z = 3}$
Substitute $z=3$ into Row 2: $y - 2(3) = -4 \implies y - 6 = -4 \implies \mathbf{y = 2}$
Substitute $y=2, z=3$ into Row 1: $x + 2 + 3 = 6 \implies \mathbf{x = 1}$
Solution: (1, 2, 3).
Reduced Row-Echelon Form (Gauss-Jordan)
For a fully automated solution, continue reducing until the left side is the identity matrix. This yields the solution directly without back-substitution:
- Normalize Row 3: $R_3 \leftarrow R_3 / -7 \rightarrow [0, 0, 1 | 3]$
- Clear above pivot 3: $R_2 \leftarrow R_2 + 2R_3$, $R_1 \leftarrow R_1 - R_3$
- Clear above pivot 2: $R_1 \leftarrow R_1 - R_2$
Final matrix: $ \left[\begin{array}{ccc|c} 1 & 0 & 0 & 1 \ 0 & 1 & 0 & 2 \ 0 & 0 & 1 & 3 \end{array}\right] \implies x=1, y=2, z=3 $
Method 4: Cramer’s Rule (Determinants)
Cramer’s Rule provides an explicit formula for the solution using determinants. It is theoretically elegant and useful for symbolic manipulation, though computationally inefficient for large systems compared to Gaussian elimination.
The Determinant of the Coefficient Matrix ($D$)
For the system $A\vec{x} = \vec{b}$, calculate the determinant of the coefficient matrix $A$:
$ A = \begin{bmatrix} 1 & 1 & 1 \ 2 & -1 & 1 \ 1 & 2 & -1 \end{bmatrix} $
$ D = \det(A) = 1\begin{vmatrix}-1 & 1 \ 2 & -1\end{vmatrix} -