Linear systems and consistency

Before you solve a system of linear equations, ask a sharper question first: does a solution even exist, and if it does, is there exactly one or infinitely many? Guessing by trial-and-error, or blindly running an elimination algorithm and hoping for the best, wastes time and hides what is actually going on. The Rouché–Capelli theorem answers this cleanly, using nothing more than the rank of two matrices — the coefficient matrix AA and the augmented matrix [A ∣ b][A\,|\,\mathbf b]. Comparing their ranks tells you, before you do a single back-substitution, whether the system is inconsistent, uniquely solvable, or has an infinite family of solutions. This article builds that criterion from matrix algebra and rank, works it through two contrasting 3×33\times3 examples — one consistent, one not — and sets up the numerical solvers (Gauss elimination, Gauss–Jordan, Gauss–Seidel) that come next: you must know whether a system is solvable before you spend effort finding what the solution is.

The core insight

A linear system Ax=bA\mathbf x=\mathbf b is consistent exactly when rank⁡(A)=rank⁡([A ∣ b])\operatorname{rank}(A)=\operatorname{rank}([A\,|\,\mathbf b]), and that common rank rr against the number of unknowns nn then decides whether the solution is unique (r=nr=n) or an (n−r)(n-r)-parameter infinite family (r<nr<n).

The core idea

Setting up the problem. A system of mm linear equations in nn unknowns is written in matrix form as Ax=bA\mathbf x=\mathbf b, where AA is an m×nm\times n coefficient matrix, x=(x1,…,xn)T\mathbf x=(x_1,\dots,x_n)^T is the unknown vector, and b∈Rm\mathbf b\in\mathbb R^m collects the right-hand sides. The augmented matrix [A ∣ b][A\,|\,\mathbf b] is formed by tacking b\mathbf b on as one extra column; row-reducing this single matrix reveals everything about both AA and the system at once.

The consistency criterion. The Rouché–Capelli theorem compares rank⁡(A)\operatorname{rank}(A) with rank⁡([A ∣ b])\operatorname{rank}([A\,|\,\mathbf b]):

rank⁡(A)=rank⁡([A ∣ b])  ⟺  Ax=b is consistent.\operatorname{rank}(A)=\operatorname{rank}([A\,|\,\mathbf b]) \iff A\mathbf x=\mathbf b \text{ is consistent.}

where: rank⁡(A)\operatorname{rank}(A) is the number of linearly independent rows (equivalently columns) of AA, obtained by counting nonzero rows after row-reducing AA to echelon form, and rank⁡([A ∣ b])\operatorname{rank}([A\,|\,\mathbf b]) is the same count for the augmented matrix. Appending a column can only keep the rank the same or increase it by exactly one; it increases by one precisely when b\mathbf b is not expressible using the row structure already present in AA, which shows up in row-reduced form as a row reading 0=c0=c for some nonzero constant cc — an equation no values of x1,…,xnx_1,\dots,x_n can satisfy.

Reading off the solution count. Once consistency holds, let r=rank⁡(A)=rank⁡([A ∣ b])r=\operatorname{rank}(A)=\operatorname{rank}([A\,|\,\mathbf b]). If r=nr=n (the number of unknowns), every unknown is pinned down by a leading entry in the reduced system, so the solution is unique. If r<nr<n, there are n−rn-r unknowns left free to take any value, and the solution set is an (n−r)(n-r)-parameter family — a line, plane, or higher-dimensional flat, depending on n−rn-r.

Square systems as a shortcut. When m=nm=n, the determinant gives a fast route to the same conclusion. If det⁡A≠0\det A\neq0, then rank⁡(A)=n\operatorname{rank}(A)=n automatically, the system is consistent for every b\mathbf b, and the unique solution is x=A−1b\mathbf x=A^{-1}\mathbf b. If det⁡A=0\det A=0, the determinant alone cannot tell you whether the system is inconsistent or has infinitely many solutions — you must fall back on comparing the two ranks directly.

Non-square systems. The picture below makes concrete why shape matters: rank tells the whole story, but the number of equations versus unknowns sets a ceiling on what is even possible. When m<nm<n (fewer equations than unknowns), rank⁡(A)≤m<n\operatorname{rank}(A)\le m<n automatically, so a consistent system can never have a unique solution — it is always an infinite family. When m>nm>n (an overdetermined system), consistency becomes the tight constraint: the extra equations generically conflict, and the system is inconsistent unless the extra rows are combinations of the others.

Figure
A diagram comparing three rank configurations for a system with n unknowns showing unique solution when rank A equals rank augmented equals n infinite solutions when the two ranks are equal but less than n and no solution when rank A is less than rank augmented
Rouché-Capelli at a glance: compare rank(A) with rank([A|b]) rank(A) = rank([A|b]) = n unique solution one point in space rank(A) = rank([A|b]) = r less than n infinitely many solutions n minus r free parameters rank(A) less than rank([A|b]) no solution a row reads 0 equals nonzero
Derivation ATesting a square system by rank comparison and back-substitution

The goal is to establish, for a system of three equations in three unknowns given as plain algebra, whether the Rouché–Capelli ranks agree, and if they do, to recover the unique numerical solution by row reduction followed by back-substitution — this is the exact procedure every subsequent numerical method (Gauss elimination in particular) automates.

Step 1. Write the system in matrix form Ax=bA\mathbf x=\mathbf b and build the augmented matrix [A ∣ b][A\,|\,\mathbf b] by appending b\mathbf b as a fourth column beside the three columns of AA. This single object carries all the information needed for both the rank test and the eventual solution.

Step 2. Row-reduce the augmented matrix using elementary row operations — replacing a row by itself minus a multiple of another row, which never changes the solution set. Track the coefficient columns and the augmented column together throughout; do not row-reduce AA alone and [A ∣ b][A\,|\,\mathbf b] separately, since consistency depends on how the two are entangled.

Step 3. Count the nonzero rows in the reduced coefficient part to get rank⁡(A)\operatorname{rank}(A), and count the nonzero rows of the full reduced augmented matrix to get rank⁡([A ∣ b])\operatorname{rank}([A\,|\,\mathbf b]). If a row has reduced to all zeros in the coefficient columns but a nonzero entry in the last column, that row reads 0=c0=c with c≠0c\neq0 — an immediate certificate of inconsistency, and the ranks will differ by exactly one.

Step 4. If the ranks agree and equal nn (three unknowns here), the system is consistent with a unique solution. Recover it by back-substitution: solve the last (simplest) equation for the last variable, substitute into the equation above it to get the next variable, and continue upward until all unknowns are found. Verified against Worked example 1 below: the reduced system gives z=3z=3, then y=2y=2, then x=1x=1, matching (x,y,z)=(1,2,3)(x,y,z)=(1,2,3).

Worked example

Determine consistency and solve, if possible:

x+y+z=6,2x+y−z=1,x+2y+3z=14.x+y+z=6,\qquad 2x+y-z=1,\qquad x+2y+3z=14.

Step 1. Write A=(11121−1123)A=\begin{pmatrix}1&1&1\\2&1&-1\\1&2&3\end{pmatrix} and b=(6114)\mathbf b=\begin{pmatrix}6\\1\\14\end{pmatrix}, and form the augmented matrix [A ∣ b][A\,|\,\mathbf b].

Step 2. Eliminate below the first pivot: R2→R2−2R1R_2\to R_2-2R_1 gives (0,−1,−3 ∣ −11)(0,-1,-3\,|\,-11), and R3→R3−R1R_3\to R_3-R_1 gives (0,1,2 ∣ 8)(0,1,2\,|\,8), leaving

[11160−1−3−110128].\left[\begin{array}{ccc|c}1&1&1&6\\0&-1&-3&-11\\0&1&2&8\end{array}\right].

Step 3. Eliminate below the second pivot: R3→R3+R2R_3\to R_3+R_2 gives (0,0,−1 ∣ −3)(0,0,-1\,|\,-3), so

[11160−1−3−1100−1−3].\left[\begin{array}{ccc|c}1&1&1&6\\0&-1&-3&-11\\0&0&-1&-3\end{array}\right].

Both AA and [A ∣ b][A\,|\,\mathbf b] now have three nonzero rows, so rank⁡(A)=rank⁡([A ∣ b])=3=n\operatorname{rank}(A)=\operatorname{rank}([A\,|\,\mathbf b])=3=n: the system is consistent with a unique solution.

Step 4. Back-substitute. Row 3 gives −z=−3⇒z=3-z=-3\Rightarrow z=3. Row 2 gives −y−3(3)=−11⇒−y=−2⇒y=2-y-3(3)=-11\Rightarrow -y=-2\Rightarrow y=2. Row 1 gives x+2+3=6⇒x=1x+2+3=6\Rightarrow x=1. The unique solution is (x,y,z)=(1,2,3)(x,y,z)=(1,2,3).

Competitive stretch

Now test a superficially similar system for consistency:

x+2y−z=3,2x+4y−2z=5,x−y+z=1.x+2y-z=3,\qquad 2x+4y-2z=5,\qquad x-y+z=1.

Row reduction gives R2→R2−2R1R_2\to R_2-2R_1: (0,0,0 ∣ −1)(0,0,0\,|\,-1), and R3→R3−R1R_3\to R_3-R_1: (0,−3,2 ∣ −2)(0,-3,2\,|\,-2). The row (0,0,0 ∣ −1)(0,0,0\,|\,-1) already signals trouble: it reads 0=−10=-1, impossible for any x,y,zx,y,z. Here rank⁡(A)=2\operatorname{rank}(A)=2 (the coefficient rows reduce to two independent nonzero rows) but rank⁡([A ∣ b])=3\operatorname{rank}([A\,|\,\mathbf b])=3, so rank⁡(A)≠rank⁡([A ∣ b])\operatorname{rank}(A)\neq\operatorname{rank}([A\,|\,\mathbf b]): the system is inconsistent — no solution exists, even though it looks just as solvable as the first at a glance.

Common traps

  • Checking only det⁡A=0\det A=0 for a non-square or rank-deficient square system and stopping there — you must compare rank⁡(A)\operatorname{rank}(A) with rank⁡([A ∣ b])\operatorname{rank}([A\,|\,\mathbf b]), not just inspect AA alone.
  • Forgetting that a homogeneous system Ax=0A\mathbf x=\mathbf 0 is always consistent (since x=0\mathbf x=\mathbf 0 always works); the real question is whether a non-trivial solution exists, decided by det⁡A=0\det A=0 in the square case or by rank versus nn in general.
  • Miscounting the free parameters in an infinite family: it is n−rn-r where r=rank⁡(A)r=\operatorname{rank}(A), not n−mn-m — the number of equations does not directly enter the count.
  • Arithmetic slips while row-reducing that create a spurious 0=c0=c row (or erase a genuine one) — always double-check a claimed inconsistency by confirming the row truly reads 0=nonzero0=\text{nonzero}, not a miscopied coefficient.

Ask the tutor: Not sure whether your system has one, none, or infinitely many solutions before you even start solving — ask the AI tutor to walk through the rank comparison with you.

Why does comparing two ranks tell you everything about a linear system, rather than just plugging numbers in and hoping?

Rank measures how much independent information the equations actually carry. If rank⁡(A)=rank⁡([A ∣ b])\operatorname{rank}(A)=\operatorname{rank}([A\,|\,\mathbf b]), every equation you added to the system by appending b\mathbf b is compatible with the structure already in AA — no equation demands something the others forbid. If the ranks differ, appending b\mathbf b introduced a genuinely new, unsatisfiable constraint, which always surfaces as a row like 0=c0=c with c≠0c\neq0 after row reduction. Trial-and-error can miss this entirely; the rank comparison catches it every time, before you invest effort in solving.

If det A = 0 for a square system, does that automatically mean no solution?

No — det⁡A=0\det A=0 only tells you the solution is not unique; it does not distinguish between "no solution" and "infinitely many." You must still compare rank⁡(A)\operatorname{rank}(A) with rank⁡([A ∣ b])\operatorname{rank}([A\,|\,\mathbf b]): if they are equal (both less than nn), you get an infinite family; if they differ, the system is inconsistent. Determinant alone is a fast unique-versus-not-unique test, not a full consistency test.

How is the number of free parameters in an infinite solution family actually determined?

It is n−rn-r, where nn is the number of unknowns and r=rank⁡(A)r=\operatorname{rank}(A) is the common rank once you know the system is consistent. Each of the rr independent equations pins down one unknown in terms of the rest; the remaining n−rn-r unknowns can be assigned freely (as parameters), and every other unknown is then expressed in terms of them. It is easy to wrongly use n−mn-m (equations minus unknowns) instead — but redundant or dependent equations do not each remove a degree of freedom, only independent ones do, which is exactly what rank counts.

Before this

Where this leads