Skip to main content

Systems of Linear Equations

A single linear equation like 2x+3y=12 2x + 3y = 12 describes an infinite line of possibilities. But real problems rarely come one equation at a time — they arrive in bundles that must all be true simultaneously. A system of linear equations is exactly that: several linear constraints that must hold at once, and the job is to find the values that satisfy every one of them. This is one of the oldest and most practical problems in all of mathematics, and the machinery built to solve it — matrices and Gaussian elimination — sits underneath everything from GPS navigation to the way search engines rank pages.

The beautiful thing is that no matter how large or messy a system looks, there is a completely mechanical procedure that will solve it, tell you it has infinitely many answers, or prove it has none at all. Once you internalize that procedure, systems stop being puzzles and become bookkeeping.

Learning Objectives

  • Recognize what a system of linear equations is and what "solving" it means geometrically and algebraically.
  • Represent any system as a coefficient matrix and an augmented matrix.
  • Perform the three elementary row operations and carry a system to row echelon form.
  • Solve systems by Gaussian elimination and back-substitution.
  • Classify a system as consistent (unique or infinite solutions) or inconsistent (no solution).
  • Describe an infinite solution set using free variables and parametric form.

Quick Answer

A system of linear equations is a collection of linear equations in the same variables, and a solution is an assignment of values that satisfies all of them at once. We encode the system compactly as an augmented matrix and solve it with Gaussian elimination: use row operations to create a staircase of leading entries (row echelon form), then back-substitute. A system is consistent if it has at least one solution and inconsistent if it has none. Consistent systems have either exactly one solution or infinitely many; an infinite family is described with free variables. A row like 0=1 0 = 1 signals inconsistency; a variable with no leading entry (a "pivot") signals a free variable and infinitely many solutions.

Where It Came From

The need to solve simultaneous linear conditions is ancient — it grows naturally out of trade, taxation, and land measurement, where you know several totals and must recover the individual quantities behind them. The single most important early source is the Chinese classic "The Nine Chapters on the Mathematical Art" (Jiuzhang Suanshu), compiled roughly around 200 BCE to 100 CE. Its eighth chapter, Fangcheng ("rectangular arrays"), poses problems about mixing grades of grain and, remarkably, solves them by laying the coefficients out in a rectangular grid of counting rods and eliminating entries column by column. This is essentially matrix elimination — the same idea we teach today — written down nearly two thousand years before matrices had a name. The Chinese scholars were driven by concrete accounting problems: given the combined yield of several bundles of different crops, determine the yield of each.

The method was rediscovered and formalized in the West much later. Carl Friedrich Gauss (1777–1855) used systematic elimination in the early 1800s while solving the least-squares systems that arose from astronomical observations — specifically, computing the orbit of the asteroid Ceres from a handful of noisy telescope readings. The overdetermined, error-laden data forced him to develop a reliable, repeatable elimination procedure. The name "Gaussian elimination" stuck, and Wilhelm Jordan later popularized the fully-reduced variant now called Gauss–Jordan elimination. The unifying language of matrices came from Arthur Cayley and James Sylvester in the mid-1800s, which is why we now say "linear algebra" rather than "the art of rectangular arrays."

Representing a System as a Matrix

Consider three equations in three unknowns:

2x+yz=8 2x + y - z = 8 3xy+2z=11 -3x - y + 2z = -11 2x+y+2z=3 -2x + y + 2z = -3

Every piece of information here is either a coefficient or a right-hand-side constant. We strip away the variable letters and the plus signs and record only the numbers, in order, in a grid. The coefficient matrix holds the numbers multiplying the variables:

A=[211312212] A = \begin{bmatrix} 2 & 1 & -1 \\ -3 & -1 & 2 \\ -2 & 1 & 2 \end{bmatrix}

Attaching the constants on the right, separated by a bar, gives the augmented matrix, which contains the entire system:

[Ab]=[2118312112123] [A \mid b] = \left[\begin{array}{ccc|c} 2 & 1 & -1 & 8 \\ -3 & -1 & 2 & -11 \\ -2 & 1 & 2 & -3 \end{array}\right]

In compact matrix form the whole system is written Ax=bAx = b, where xx is the column vector of unknowns. This is not just shorthand — the augmented matrix is what we actually manipulate, because operations on rows correspond exactly to legal manipulations of the equations.

The Three Elementary Row Operations

Solving a system means transforming it into an easier system that has the same solutions. Three operations are guaranteed to preserve the solution set:

  1. Swap two rows (reorder the equations).
  2. Scale a row by a nonzero constant (multiply an equation through).
  3. Replace a row by itself plus a multiple of another row (add equations).

Each is reversible, which is why no solutions are ever gained or lost. Our goal is row echelon form: a staircase where each row's first nonzero entry (its pivot) sits to the right of the pivot above it, and any all-zero rows are at the bottom.

Worked Example: Gaussian Elimination

Take the system above. Start from the augmented matrix and eliminate the entries below the first pivot (the 2 2 in row 1).

Add 32\tfrac{3}{2} of row 1 to row 2, and add row 1 to row 3:

[21180121210215]\left[\begin{array}{ccc|c} 2 & 1 & -1 & 8 \\ 0 & \tfrac{1}{2} & \tfrac{1}{2} & 1 \\ 0 & 2 & 1 & 5 \end{array}\right]

Now eliminate below the second pivot. Subtract 4 4 times row 2 from row 3:

[21180121210011]\left[\begin{array}{ccc|c} 2 & 1 & -1 & 8 \\ 0 & \tfrac{1}{2} & \tfrac{1}{2} & 1 \\ 0 & 0 & -1 & 1 \end{array}\right]

This is row echelon form. Reading the last row: z=1-z = 1, so z=1z = -1. Back-substitute into row 2: 12y+12(1)=1\tfrac{1}{2}y + \tfrac{1}{2}(-1) = 1, giving 12y=32\tfrac{1}{2}y = \tfrac{3}{2}, so y=3y = 3. Finally row 1: 2x+3(1)=8 2x + 3 - (-1) = 8, so 2x=4 2x = 4 and x=2x = 2.

Solution: (x,y,z)=(2,3,1)(x, y, z) = (2, 3, -1). Check in the original third equation: 2(2)+3+2(1)=4+32=3-2(2) + 3 + 2(-1) = -4 + 3 - 2 = -3. Correct.

Consistent vs. Inconsistent Systems

Geometrically, each equation in three variables is a plane. A unique solution means the three planes meet at a single point. But planes can also fail to share a common point, or share a whole line. Elimination detects every case automatically.

Inconsistent (no solution). Suppose elimination produces a row of the form

[0005]\left[\begin{array}{ccc|c} 0 & 0 & 0 & 5 \end{array}\right]

This reads 0x+0y+0z=5 0x + 0y + 0z = 5, i.e. 0=5 0 = 5, which is impossible. The moment any such row appears, the system is inconsistent and has no solutions. Geometrically the planes have no common intersection (for example, two parallel planes).

Infinitely many solutions. Consider:

x+2y+z=4 x + 2y + z = 4 2x+4y+2z=8 2x + 4y + 2z = 8

The second equation is just twice the first, so it carries no new information. Row-reducing, subtract 2× 2\times row 1 from row 2:

[12140000]\left[\begin{array}{ccc|c} 1 & 2 & 1 & 4 \\ 0 & 0 & 0 & 0 \end{array}\right]

There is a pivot only in the xx column. Both yy and zz are free variables — they can be anything. Let y=sy = s and z=tz = t; then x=42stx = 4 - 2s - t. The solution set is the infinite family

(x,y,z)=(42st,  s,  t),s,tR. (x, y, z) = (4 - 2s - t,\; s,\; t), \quad s, t \in \mathbb{R}.

This is the parametric description of the solution set — here a whole plane of points.

The rule of thumb: after reduction, a consistent system with a pivot in every variable column has one solution; a consistent system with any free variable has infinitely many; a 0=nonzero 0 = \text{nonzero} row means inconsistent.

Real-World Applications

  • Circuit analysis. Kirchhoff's current and voltage laws produce one linear equation per node and per loop; solving the system yields every branch current at once. Engineers set these up as Ax=bAx = b and let a computer row-reduce.
  • Balancing chemical equations. Requiring equal atoms of each element on both sides gives a linear system in the stoichiometric coefficients; the solution set (often with a free variable) gives the smallest whole-number balance.
  • Economics — Leontief input–output models. To find production levels across industries that exactly meet demand, economists solve a large linear system relating each sector's output to every other's.
  • Computer graphics and GPS. Transforming and projecting 3D scenes, and trilaterating your position from satellite distances, both reduce to solving linear systems in real time.
  • Curve fitting and machine learning. The normal equations of least-squares regression — the workhorse behind trend lines and much of statistics — are a linear system, precisely the kind Gauss was solving for Ceres.

Common Mistakes

Mistake 1: Treating a 0=0 0 = 0 row as a contradiction. Students often see an all-zero row and declare "no solution." Wrong — a row of all zeros (including the constant) simply means one equation was redundant. That signals a possible free variable and more solutions, not fewer. Only 0=nonzero 0 = \text{nonzero} is a contradiction. Correction: check the augmented (constant) column specifically before concluding inconsistency.

Mistake 2: Illegal row operations. A common error is multiplying a row by zero, or replacing a row using a multiple of itself ("add 2 2 times row 1 to row 1"). Scaling by zero destroys information and can invent solutions; self-referential replacement isn't one of the three legal moves. Correction: only ever scale by a nonzero number, and only add a multiple of a different row.

Mistake 3: Forgetting free variables when writing the answer. With infinitely many solutions, students sometimes report a single point they stumbled onto. That point is a solution but not the solution set. Correction: assign a parameter to each free variable and express the pivot variables in terms of them, giving the full parametric family.

Comparison and Connections

Elimination has two common finishing points, and it helps to know the difference.

FeatureRow Echelon Form (REF)Reduced Row Echelon Form (RREF)
PivotsFirst nonzero in each rowEach pivot equals 1 1
Above pivotsMay be nonzeroAll zeros
Finished byBack-substitutionReading off directly
Associated methodGaussian eliminationGauss–Jordan elimination
UniquenessNot uniqueUnique for a given matrix

Systems also connect to broader ideas. The question "does Ax=bAx=b have a solution?" is answered by comparing the rank of AA with the rank of [Ab][A\mid b]: equal ranks mean consistent. When AA is square and invertible, the system has exactly one solution x=A1bx = A^{-1}b, and Cramer's rule expresses it with determinants — elegant for tiny systems but far slower than elimination for large ones. A homogeneous system (b=0b = 0) is always consistent because x=0x = 0 works; the interest there is whether nonzero solutions exist, which ties directly to the null space.

Practice Questions

Recall

Q: What are the three elementary row operations, and what do they all have in common?

A: Swapping two rows, scaling a row by a nonzero constant, and adding a multiple of one row to another. Common feature: each is reversible and preserves the system's solution set.

Understanding

Q: After reduction, a 3×3 3\times 3 system yields a row [0002]\left[\begin{array}{ccc|c} 0 & 0 & 0 & -2 \end{array}\right]. What can you conclude, and why?

A: The system is inconsistent — no solution. That row asserts 0=2 0 = -2, which can never hold, so no assignment of variables satisfies all equations. Geometrically the planes share no common point.

Application

Q: Solve the system x+y=5 x + y = 5 and 3xy=7 3x - y = 7.

A: Augmented matrix [115317]\left[\begin{array}{cc|c} 1 & 1 & 5 \\ 3 & -1 & 7 \end{array}\right]. Subtract 3× 3\times row 1 from row 2: [115048]\left[\begin{array}{cc|c} 1 & 1 & 5 \\ 0 & -4 & -8 \end{array}\right]. So 4y=8y=2-4y = -8 \Rightarrow y = 2, then x=3x = 3. Solution (3,2)(3, 2). Check: 3(3)2=7 3(3) - 2 = 7. Correct.

Analysis

Q: For which value of kk does the system x+2y=3 x + 2y = 3, 2x+4y=k 2x + 4y = k have (a) no solution, (b) infinitely many?

A: Subtract 2× 2\times row 1 from row 2 to get 0=k6 0 = k - 6. If k6k \ne 6, the row reads 0=nonzero 0 = \text{nonzero} — inconsistent, so no solution. If k=6k = 6, the row is 0=0 0 = 0 — redundant, leaving one free variable and infinitely many solutions.

FAQ

Is Gaussian elimination the same as substitution? They give the same answers, but elimination is a systematic, matrix-based procedure that scales to hundreds of variables and is easy to program. Substitution is fine for two or three equations but becomes error-prone and disorganized beyond that.

Do I have to reach RREF, or is REF enough? REF plus back-substitution fully solves any system, so REF is enough for finding solutions. RREF is convenient because you read answers directly and it's essential when computing inverses or clearly identifying free variables, but it costs extra arithmetic.

Why does the order of eliminating matter for arithmetic? It doesn't change the final solution, but choosing which pivot to use affects how ugly the fractions get and how numerical errors accumulate on a computer. That's why real software uses "partial pivoting" — swapping in the largest available pivot for stability.

Can a system have exactly two solutions? No. A linear system has zero, exactly one, or infinitely many solutions — never a finite number greater than one. This is because if two distinct solutions exist, every point on the line between them is also a solution.

What does it mean geometrically when there are infinitely many solutions in three variables? The equations don't pin down a single point. The planes may all intersect in a common line (one free variable) or all coincide as the same plane (two free variables), producing a line's worth or a plane's worth of solutions.

Quick Revision

  • A solution satisfies every equation at once; solving means finding all such assignments.
  • Encode the system as the augmented matrix [Ab][A \mid b] and manipulate its rows.
  • Three legal row operations: swap, scale by nonzero, add a multiple of another row.
  • Goal: row echelon form (staircase of pivots), then back-substitute.
  • Inconsistent if a 0=nonzero 0 = \text{nonzero} row appears; otherwise consistent.
  • Consistent with a pivot in every variable column \Rightarrow unique solution; any free variable \Rightarrow infinitely many.
  • Possible solution counts: zero, one, or infinitely many — never a finite plural.
  • Consistency test: rank(A)=rank([Ab])\text{rank}(A) = \text{rank}([A\mid b]).

Prerequisites

  • Matrices and matrix operations
  • Determinants and Cramer's rule
  • Vector spaces, rank, and the null space

Next Topics

  • Matrix inverses and the equation x=A1bx = A^{-1}b
  • Eigenvalues and eigenvectors
  • Least-squares and linear regression