A system of linear equations is a collection of equations that share the same set of unknowns (variables), where every term is either a constant or a constant times one variable — no squares, products of variables, or other nonlinear terms. Solving the system means finding the values of every unknown that satisfy all equations simultaneously.
4x − y = 10
A system with n unknowns generally needs n independent equations to have exactly one solution.
Substitution
Solve one equation for one variable, then substitute that expression into the other equations. Best for small systems (2 unknowns) or when one equation is already simple.
Elimination
Add or subtract multiples of equations to cancel out one variable at a time, reducing the system step by step. Works well for 2–3 unknowns.
Gaussian Elimination (Matrix Method)
Write the system as an augmented matrix and use row operations to reach row-echelon form, then back-substitute. Scales cleanly to 3 or 4 unknowns.
4x − y = 10 (2)
2x + 12x − 30 = 12
14x = 42
x = 3
Solution: x = 3, y = 2
x − y = 2 (2)
x = 6
y = 4
Solution: x = 6, y = 4
2y + 5z = −4 (2)
2x + 5y − z = 27 (3)
3y − 3z = 15
3y − 3z = 15 → y − z = 5
7z = −14
z = −2, y = 3
Solution: x = 5, y = 3, z = −2
With 4 unknowns the process is identical to the 3-unknown case — eliminate one variable at a time until you're down to a single equation, then back-substitute. There's just one more round of elimination.
2x − y + z − w = −2 (2)
x + 2y − z + 2w = 15 (3)
3x + y + 2z − w = 7 (4)
(3) − 1×(1): y − 2z + w = 5 (3′)
(4) − 3×(1): −2y − z − 4w = −23 (4′)
(4′) + 2×(3′): −5z − 2w = −13 (4″)
−2w = −8 → w = 4
Solution: x = 2, y = 3, z = 1, w = 4
Notice the pattern: each elimination round shrinks the system by one equation and one unknown — 4 equations → 3 → 2 → 1 — and then back-substitution rebuilds the answers in reverse order. This is exactly why Gaussian elimination, rather than substitution, is the practical choice once you have 3 or more unknowns: substitution's expressions get unwieldy fast, while elimination just adds one more clean round.
Any linear system can be written compactly as an augmented matrix — coefficients on the left, constants on the right of a vertical bar. Gaussian elimination uses three row operations (swap two rows, scale a row, add a multiple of one row to another) to reach a triangular form, then solves by back-substitution. This same process extends directly to 4 unknowns with no new ideas — just more rows.
[ 0 2 5 | −4 ]
[ 2 5 −1 | 27 ]
[ 2 −1 1 −1 | −2 ]
[ 1 2 −1 2 | 15 ]
[ 3 1 2 −1 | 7 ]
- Take your computed values for every unknown.
- Substitute them back into each original equation — not just the last one you used.
- If every equation balances, your solution is correct. If even one doesn't, recheck your steps.