Gaussian Elimination
Swap two rows, scale a row by a nonzero number, add a multiple of one row to another — none of these changes the solution set. March to echelon form (each leading entry, the pivot, strictly right of the one above). Each pivot pins a variable; each column without a pivot leaves a free variable. Unique solution, infinitely many, or none: the pivots decide.
Each move can be undone by another move of the same kind, and any solution of the old equations satisfies the new ones, since every new equation is built from old ones. So nothing is gained or lost. In the row picture, replacing in the system , by , that is , swaps a slanted line for the horizontal line — a different line through the same crossing point . Elimination turns lines into ones that are easier to read without moving the solution.
The rank is the number of pivots — the true dimension of what the matrix can reach. For an matrix, (free variables) : a homogeneous system of rank always has a -parameter family of solutions.
Why the count works: after elimination, every column either holds a pivot or it does not. Pivot columns correspond to variables that back-substitution determines; the other columns correspond to variables you may choose freely. Each free choice is one independent direction of solutions of , so the columns split exactly as "determined" plus "free": .
and : the left sides are proportional, so either (same line — infinitely many solutions) or (parallel lines — none). Elimination makes the dichotomy mechanical.
In the row picture the left sides and describe parallel lines, since the second is twice the first. Elimination says the same thing: turns the second row into , which reads . At that row is empty and one line is left (infinitely many solutions); at any other , for instance , it is the false statement and the lines never meet.
Every engineering simulation, circuit solver, weather model, and structural analysis ends in a huge linear system, and Gaussian elimination (with clever pivoting) is how they are all solved. Its cost — about operations — is a number every computational scientist knows by heart.
A system reduces to the echelon rows , , . For which is it consistent, and what is the solution then?
Show the answerHide the answer
The last row says , that is . If that is false, so there is no solution at all. If the row is empty and drops out, leaving two pivots for two variables — no free variable, so exactly one solution. Back-substitute from the bottom: gives ; then gives . So the system is consistent only for , with the unique solution . One look at the echelon form settles existence, uniqueness, and the answer.
Reduced Echelon Form and Free Variables
Keep going past echelon form: scale each pivot to and clear the entries above it too. The result is the reduced row echelon form (RREF), and it is unique. Each nonzero row then reads "one pivot variable a number minus a combination of free variables." Setting the free variables to parameters writes every solution as
a particular solution plus a combination of null-space vectors.
The shape of the answer follows from linearity. If and , then ; conversely, two solutions of differ by a solution of . So the full solution set is one solution shifted by the whole null space, and the free variables are exactly the coordinates on that null space — one parameter per pivotless column.
Solve , . Clear below the first pivot with : the second row becomes . The -column got no pivot, so is free.
Row 2 now says , so . Row 1 says . Name the free variable :
Check in the original equations: ✓ and ✓ for every . Geometrically, two planes in that are not parallel meet in a line, and this is that line: through in the direction .
Solve the system with augmented matrix . Clear column 1: and both give . Then gives a zero row.
The RREF is : pivots in columns 1 and 3, so and are free. Read each row as "pivot variable …": and . So
The zero row was the third equation repeating information (row 3 row 2 row 1 in the original), so it constrains nothing. Audit: rank and nullity add to the columns, as rank–nullity demands.
For which does , , have exactly one solution? Eliminate: gives and gives ; then gives .
If , the last row has a nonzero pivot , so there are three pivots and a unique solution: gives , then , then . Check in the third equation: ✓. If , the last row is all zeros — becomes free and there are infinitely many solutions. There is no value of with no solution, because the right-hand entry of that row is for every . The case split is not optional: dividing by without asking whether it is zero would miss the whole line of solutions at .
In the first example it is tempting to set the free variable to and report "the solution ." That is one solution, not the answer: also works ( and ), and so does every point . A pivotless column means infinitely many solutions, and the answer must carry the parameter.
Solve , and write every solution as a particular solution plus a multiple of a null-space vector.
Show the answerHide the answer
Eliminate: gives , so . The -column has no pivot, so is free. Row 1 gives . So
Check: ✓ and ✓. The null-space direction solves the homogeneous system: and .
Elimination as a Factorization: A = LU
When elimination needs no row swaps, it factors : is the echelon form (upper triangular) and is lower triangular with s on the diagonal and, below it, the multipliers used — the entry is the number in the step . To solve , solve from the top down, then from the bottom up.
Each step is undone by adding back, so running the steps in reverse rebuilds from , and the reverse steps assemble into with the multipliers sitting in place, signs unchanged. The payoff is reuse: elimination costs about operations, but once and are stored, each new right-hand side costs only two triangular solves, about operations. That is why software factors a matrix once and then solves many systems with it.
Factor and solve . One step clears the first column: , multiplier , leaving and .
Check: ✓. Forward solve : , then gives . Back solve : gives , then gives . Check in the original: ✓ and ✓. In the row picture, the second equation became — a horizontal line through the same point.
Factor . Column 1: gives and gives — multipliers and .
Column 2: gives — multiplier . So
each multiplier stored where it created a zero. Check the bottom row of : against the columns of gives ✓. A bonus: , the product of the pivots.
The step subtracts, so it is tempting to store in . But undoes the elimination, so it adds the multiple back: with the product , not . And when a pivot is — as in — no multiplier can clear below it; a row swap is needed first, and the factorization becomes .
Factor as and use the factors to solve .
Show the answerHide the answer
One step: turns into , so and (the multiplier goes below the diagonal). Check: ✓. Forward: and give . Back: gives , and gives . Check: and ✓.
Proofs & Why It Matters
Row reduce (, rank ): pivot columns and free columns. Each free variable can be set to with the others , and back-substitution fills in the pivot variables — producing solutions of that are independent (each has a where the others have ).
Conversely every homogeneous solution is determined by its free-variable values, so these span: the null space has dimension exactly .
In echelon form, a row with reads : no solution. Otherwise, if every column has a pivot, back-substitution determines each variable uniquely: exactly one solution. Otherwise some column is pivot-free: its variable is free, and each of its infinitely many values extends to a solution. No fourth case exists.
Going Deeper: Explanations & Worked Problems
The method is fully mechanical. (1) Find the leftmost column with a nonzero entry; swap that entry's row to the top — it is the first pivot. (2) Subtract multiples of the pivot row from every row below, zeroing that column beneath the pivot. (3) Ignore the pivot row and repeat on the remaining rows.
The result is echelon form: pivots marching down and right, zeros below each. Then read off the verdict: a row , , means inconsistent; otherwise count pivots — every column with a pivot pins a variable, every column without one donates a free parameter. Back-substitution finishes: solve the last pivot equation, substitute upward. The whole of solvability theory — unique/infinite/none, rank, dimension of the solution space — is a bookkeeping layer on this one procedure.
Solve , , .
Step 1 — clear column 1 below the pivot: : ; : .
Step 2 — clear column 2 below the new pivot: : .
Step 3 — echelon form reached with three pivots (): a unique solution exists.
Step 4 — back-substitute: from row 3, ; from row 2, so ; from row 1, .
Step 5 — verify in the original equations: ✓, ✓, ✓. The verification step costs ten seconds and catches nearly every slip.
Reduce .
Step 1: — row 2 was twice row 1, and elimination exposes the dependence as a zero row. Step 2: . Echelon form: pivots in columns 1 and 2, none in column 3: rank .
Step 3 — the homogeneous solutions: is free; row 2 gives ; row 1 gives . So the null space is the line of multiples of , dimension — and rank–nullity checks: columns (rank) (nullity) ✓. Rank counts surviving information; nullity counts what the matrix destroys.