Skip to main content

Solving Linear Systems

Every method, explained with full worked examples.

📖 7 min read · Updated May 2026 · Reviewed by our math editorial team

What Is a Linear System?

A linear system (or system of linear equations) is a collection of equations, each linear in the same set of unknowns. "Linear" means each variable appears only to the first power, with no products of variables, no powers above 1, and no trigonometric or exponential terms.

3x + 2y = 12
x - y  = 1

Every linear system has exactly one of three outcomes: one solution (consistent, independent), infinitely many solutions (consistent, dependent), or no solution (inconsistent). The goal of all methods is to determine which case applies and, if solutions exist, to find them.

Method 1: Substitution

Solve for one variable in one equation, then substitute into the others. Best for small systems (2 equations, 2 unknowns) where one equation is already simple.

Example: 3x + 2y = 12 and x − y = 1.

From the second equation: x = 1 + y. Substitute into the first: 3(1 + y) + 2y = 12 → 3 + 3y + 2y = 12 → 5y = 9 → y = 9/5. Then x = 1 + 9/5 = 14/5.

Solution: x = 14/5, y = 9/5. Check: 3(14/5) + 2(9/5) = 42/5 + 18/5 = 60/5 = 12 ✓, 14/5 − 9/5 = 5/5 = 1 ✓.

Substitution becomes unwieldy for systems with more than 2 or 3 variables. For larger systems, Gauss-Jordan elimination is far more systematic.

Method 2: Elimination (by Hand)

Add or subtract multiples of equations to eliminate variables one at a time. This is Gaussian elimination in informal notation.

x + 2y + 3z = 14
2x + 5y + 2z = 18
3x + y  + 5z = 20

R₂ → R₂ − 2R₁: −y − 4z = −10. R₃ → R₃ − 3R₁: −5y − 4z = −22. Then R₃ → R₃ − 5R₂: 16z = 28, so z = 7/4. Back-substitute: y = 10 − 4(7/4) = 3. Then x = 14 − 2(3) − 3(7/4) = 14 − 6 − 21/4 = 32/4 − 21/4 = 11/4.

Solution: x = 11/4, y = 3, z = 7/4. The RREF calculator handles this automatically, including all fraction bookkeeping.

Method 3: Gauss-Jordan Elimination (RREF)

Write the augmented matrix [A|b] and reduce to RREF using elementary row operations. This is the most systematic method for any size system and is what computers use.

[ 1  2  3 | 14 ]      [ 1  0  0 | 11/4 ]
[ 2  5  2 | 18 ]  →   [ 0  1  0 |  3   ]
[ 3  1  5 | 20 ]      [ 0  0  1 |  7/4 ]

In RREF, solutions are read directly from the last column. No back-substitution needed. Try it with the RREF calculator.

Gauss-Jordan is preferred when: you need RREF anyway (for rank/null space), the system has many variables, or you want a single algorithm that handles all three cases (unique/infinite/no solution).

Method 4: Matrix Inverse

If A is square and invertible, solve Ax = b as x = A⁻¹b. This is elegant but computationally expensive (inverting a matrix takes more work than solving one system). It is useful when you need to solve Ax = b for many different b vectors with the same A — you invert once and multiply repeatedly.

Ax = b   →   x = A⁻¹b

For a 2×2 system: if A = [[a,b],[c,d]] and det(A) = ad − bc ≠ 0, then A⁻¹ = (1/det)[[d,−b],[−c,a]]. Try the matrix inverse calculator.

Recognizing the Three Solution Types

Unique solution (consistent, independent). In RREF: every variable column has a pivot, and no contradiction row [0 0 ... 0 | c≠0] appears. The solution is x₁ = c₁, x₂ = c₂, etc., read directly from RREF. Geometrically: two planes in 3D intersect at exactly one point.

Infinitely many solutions (consistent, dependent). In RREF: at least one variable column has no pivot (a free variable). The solution is parameterized by the free variables. Geometrically: the system describes a line or plane of solutions.

[ 1  0  2 | 5 ]   →   x₁ = 5 - 2t
[ 0  1  3 | 7 ]   →   x₂ = 7 - 3t   (t = x₃ is free)
[ 0  0  0 | 0 ]   →   x₃ = t

No solution (inconsistent). In RREF: a row [0 0 ... 0 | c] with c ≠ 0 appears. This represents "0 = c", which is impossible. Geometrically: two planes in 3D are parallel and do not intersect.

[ 1  2 | 3 ]
[ 0  0 | 7 ]   →   0 = 7   (impossible — no solution)

Homogeneous Systems

A homogeneous system has b = 0: Ax = 0. It always has at least the trivial solution x = 0. If rank(A) < n (number of unknowns), it has infinitely many solutions — the null space of A is non-trivial.

Homogeneous systems arise in finding null spaces, eigenvectors (Av = λv rearranges to (A − λI)v = 0), and determining linear independence (are the vectors v₁, ..., vₖ independent? Solve c₁v₁ + ... + cₖvₖ = 0).

Cramer's Rule

For an n×n system Ax = b with det(A) ≠ 0, Cramer's rule gives each solution component as a ratio of determinants:

xᵢ = det(Aᵢ) / det(A)

where Aᵢ is the matrix A with column i replaced by b. Cramer's rule is important theoretically and elegant for 2×2 systems, but computationally expensive for n ≥ 4 — computing n+1 determinants each of size n×n. For large n, Gauss-Jordan is vastly more efficient.

Practical Tips for Solving by Hand

  • Always write the augmented matrix [A|b] first — it keeps the bookkeeping organized.
  • Work column by column, left to right. Don't skip ahead.
  • Keep fractions exact — decimal approximations accumulate rounding errors.
  • If a row becomes all zeros (on the left), it means the equations were dependent — leave the row and move on.
  • After finding RREF, check your solution by substituting back into the original equations.
  • The pivot columns of RREF tell you the basic variables; non-pivot columns are free variables.

Common Mistakes

  • Arithmetic errors with fractions. The main advantage of using the RREF calculator is eliminating these. If solving by hand, double-check every fraction multiplication.
  • Forgetting to eliminate above the pivot. REF only eliminates below; RREF requires eliminating above too. Missing this step leaves you with REF, not RREF.
  • Misidentifying free variables. A column without a pivot is a free variable column — the corresponding variable is free, not the pivot of the row it's in.
  • Declaring "no solution" when there are infinitely many. A zero row [0 0 ... 0 | 0] means infinitely many solutions (or the trivial solution for a homogeneous system), not no solution. The contradiction is [0 0 ... 0 | c≠0].

Back-Substitution vs. RREF: Which Method to Use?

Back-substitution after Gaussian elimination (REF): Forward elimination zeros entries below each pivot, reaching an upper triangular matrix. Then you solve for the last variable from the last row, substitute up, and solve for each preceding variable. Fewer total row operations than RREF for a single system — roughly 30% faster for a square system.

RREF via Gauss-Jordan: Continues the forward pass with a backward pass that zeros entries above each pivot. More operations, but the solution is read directly from the last column with no back-substitution required. RREF is the canonical form — the same result regardless of which sequence of row operations you use.

CriterionBack-Substitution (after REF)RREF (Gauss-Jordan)
Operations for n×n system≈ n³/3 + n²/2≈ n³/2 (more)
Solution readabilityRequires back-substitutionRead directly from RREF
Finding null spaceRequires extra workFree variables visible immediately
Finding matrix inverseLess naturalNatural via [A|I] → [I|A⁻¹]
Uniqueness of resultREF is not uniqueRREF is unique
Best forSpeed on single systemAll other purposes

For most learning contexts, RREF is preferred because the unique canonical result makes it easy to verify work. The Gauss-Jordan vs. Gaussian elimination guide covers this comparison in more depth.

Geometric Interpretation of Linear Systems

Every linear system has a geometric picture that makes the three solution types intuitive.

2 equations in 2 unknowns (2 lines in ℝ²):

  • Unique solution: Two lines intersect at exactly one point. The solution is that intersection point.
  • Infinite solutions: The two equations describe the same line (one is a scalar multiple of the other). Every point on the line is a solution.
  • No solution: Two parallel lines that never intersect. The lines have the same slope but different y-intercepts.

3 equations in 3 unknowns (3 planes in ℝ³):

  • Unique solution: Three planes meet at exactly one point.
  • Infinite solutions (a line): Three planes share a common line. This happens when two equations are independent but the third is a combination of the first two — rank 2, one free variable.
  • Infinite solutions (a plane): All three planes are identical or all pass through the same plane. Rank 1, two free variables.
  • No solution: At least two planes are parallel and non-intersecting (or two planes intersect in a line parallel to the third plane).

The RREF of the augmented matrix always reveals which geometric case applies: count the pivot columns (rank), check for a contradiction row, and count free variables.

Worked Word Problem: Mixture Problem

A chemistry lab mixes three solutions — A (10% acid), B (30% acid), and C (60% acid) — to produce 100 mL of a 25% acid solution. The amount of solution C must equal the amount of solution A. Find how many milliliters of each solution to use.

Set up the system:

  • Total volume: x + y + z = 100
  • Acid content: 0.10x + 0.30y + 0.60z = 25 (25% of 100 mL = 25 mL of acid)
  • Constraint: z = x, equivalently x − z = 0

Augmented matrix [A|b], multiply the second equation through by 10 to clear decimals:

[ 1   1   1 | 100 ]   (total volume)
[ 1   3   6 |  250]   (acid × 10)
[ 1   0  -1 |   0 ]   (z = x)

R₂ → R₂ − R₁, R₃ → R₃ − R₁:

[ 1  1   1 | 100 ]
[ 0  2   5 | 150 ]
[ 0 -1  -2 | -100]

R₃ → R₃ + (1/2)R₂:

[ 1  1   1 | 100 ]
[ 0  2   5 | 150 ]
[ 0  0  1/2| -25 ]

R₃ → 2R₃: z = −50? That gives a negative volume — the system is inconsistent as stated. The constraint z = x combined with the acid requirement cannot be satisfied with exactly 100 mL at 25% using those concentrations. In a real homework problem, the numbers would be chosen to yield a positive solution; the RREF procedure is identical. Enter this augmented matrix into the RREF calculator to verify the contradiction row that appears.