Systems of Linear Equations
Recall prompts
Section titled “Recall prompts”Attempt these from memory before reading.
- What are the three possible outcomes for a linear system?
- What does it mean for a matrix to be in row echelon form? Reduced form?
- What does pivoting protect against, and why is it needed at all?
- State the rank-nullity theorem and say what it predicts for an system.
- When is the least-squares solution the right answer?
Check your answers against the text. Prompt 2 is the practical core: every claim about existence and uniqueness in this page is read off a row echelon form, so knowing what you are allowed to conclude from one is the skill.
Motivation: elimination is a change of basis, not an algorithm
Section titled “Motivation: elimination is a change of basis, not an algorithm”Gaussian elimination is usually taught as a procedure with steps. It is better understood as applying a sequence of invertible row operations, each of which is multiplication by a simple matrix.
Each is invertible, so the product is invertible, and an invertible map does not change the solution set. That is why elimination is allowed to work at all: every row operation produces a system with exactly the same solutions.
Reading the product the other way gives the LU decomposition:
where is lower triangular with the multipliers on its entries. So LU is not a separate technique from elimination — it is the elimination recorded, which is why factoring once and solving many times is cheaper than eliminating from scratch for every right-hand side.
Why pivoting is needed. Dividing by a pivot that is small — or zero — is what breaks elimination. Swapping rows to bring the largest available entry to the pivot position costs nothing and avoids dividing by something tiny. In exact arithmetic it is unnecessary; in floating point it is the difference between an answer and noise, because a tiny pivot amplifies rounding error into every entry below it.
4.1 Gaussian Elimination
Section titled “4.1 Gaussian Elimination”A system of linear equations in unknowns can be written as Where , And .
Gaussian elimination transforms the augmented matrix into row echelon Form (REF) using elementary row operations:
- Swap two rows ().
- Multiply a row by a non-zero scalar ().
- Add a multiple of one row to another ().
A matrix is in REF if:
- All zero rows are at the bottom.
- The leading entry (pivot) of each non-zero row is strictly to the right of the pivot above.
- All entries below a pivot are zero.
Reduced row echelon form (RREF) additionally requires:
- Each pivot is 1.
- Each pivot is the only non-zero entry in its column.
Theorem 4.1. Every matrix has a unique RREF. Two matrices are row-equivalent if and only if they Have the same RREF.
4.2 Existence and Uniqueness
Section titled “4.2 Existence and Uniqueness”Theorem 4.2 (Rouché—Capelli). The system is consistent (has at least one Solution) if and only if
If consistent, the solution set has free parameters, where .
Proof. Let the RREF of have pivots in the coefficient Columns. The system is inconsistent if and only if the last non-zero row is which occurs precisely when the augmented column contains a pivot, i.e., when .
If consistent, the pivot variables are determined by the free variables, yielding degrees of freedom.
4.3 LU Decomposition
Section titled “4.3 LU Decomposition”An LU decomposition of writes where is Lower triangular with 1s on the diagonal, and is upper triangular.
Theorem 4.3. If Gaussian elimination can be performed on without row exchanges, then Admits an LU decomposition.
Algorithm. Store the multipliers (used to eliminate entry ) in the lower Triangular portion. The resulting upper triangular matrix is And the multipliers form .
Worked Example. Find the LU decomposition of
Solution
Step 1: Eliminate below . , .
Step 2: Eliminate below . .
Verify: .
To solve First solve (forward substitution), Then (back substitution).
4.4 Gaussian Elimination with Partial Pivoting
Section titled “4.4 Gaussian Elimination with Partial Pivoting”When a pivot is zero (or very small), we swap rows to bring the largest available entry in the Current column into the pivot position. This is partial pivoting, and it improves numerical Stability.
Problem. Solve the system using Gaussian elimination with partial pivoting:
Solution
Augmented matrix:
Step 1. Column 1: largest entry is 3 in row 2. Swap :
, :
Step 2. Column 2: largest entry below pivot is in row 3. Swap :
:
Back substitution. From row 3: So .
From row 2: So Giving .
From row 1: So Giving .
Solution: , , .
4.5 Least Squares Solutions
Section titled “4.5 Least Squares Solutions”When is overdetermined (more equations than unknowns) and inconsistent, We seek that minimises .
Theorem 4.4 (Normal Equations). The least squares solution satisfies
If has full column rank, then is invertible and .
Proof. The error vector is minimised when I.e., when . This gives Or . If has full column rank, then So Meaning is invertible.
Problem. Find the least squares line fitting the data points , , .
Solution
The system is I.e., with , .
Compute .
.
Solve :
.
.
.
The least squares line is .
4.6 Worked Example: System with Infinitely Many Solutions
Section titled “4.6 Worked Example: System with Infinitely Many Solutions”Problem. Solve the system:
Solution
The last row reads So the system is inconsistent (no solution).
Revised problem: Change the last equation to :
Still inconsistent! The RREF reveals in the last row.
Revised again: Change the last equation to :
Now the system is consistent. Pivots in columns 1 and 3; free variables are and . From row 2: . From row 1: .
Solution set: .
In parametric form: .
The solution space is a 2-dimensional affine subspace (a plane) in .
4.7 Common Pitfalls
Section titled “4.7 Common Pitfalls”- Partial pivoting is not optional for numerical work. Without it, Gaussian elimination can produce catastrophically wrong results due to rounding errors.
- The normal equations can be ill-conditioned. For better numerical stability, use QR decomposition to solve least squares problems instead of forming .
- Not every system has a solution. Always check consistency via the Rouche—Capelli theorem before attempting to solve.
- When a system has infinitely many solutions, the solution set is an affine subspace, not a vector space. The general solution is where is a particular solution and is any element of the null space. The null space is a vector space, but the affine shift by means the solution set does not contain (unless ).
- Do not confuse the number of equations with the number of unknowns. A system with more equations than unknowns (overdetermined) may have no solution, exactly one solution, or infinitely many solutions. A system with fewer equations than unknowns (underdetermined) may have no solution or infinitely many solutions, but never exactly one solution.
4.8 Intuition: What Does Gaussian Elimination Do Geometrically?
Section titled “4.8 Intuition: What Does Gaussian Elimination Do Geometrically?”Each elementary row operation corresponds to a geometric operation on the system of equations. In , each equation defines a plane. The solution to the system is the intersection of all these planes.
- Swapping rows reorders the equations, which does not change the solution set.
- Multiplying a row by a scalar rescales an equation without changing its solution set.
- Adding a multiple of one row to another replaces one plane with a new plane that passes through the line of intersection of the two original planes.
Gaussian elimination systematically rotates and translates the planes so that their intersection becomes apparent. After reduction to row echelon form, the last equation involves only one variable, the second-to-last involves at most two variables, and so on. Back substitution then recovers all variables one at a time, starting from the simplest equation.
When the system is inconsistent, the row reduction produces a contradiction (such as ), meaning the planes have no common point of intersection. When there are free variables, the planes intersect in a line, plane, or higher-dimensional flat, reflecting the infinitely many solutions.
4.9 Worked Example: 4x4 System
Section titled “4.9 Worked Example: 4x4 System”Problem. Solve the system:
Solution
Augmented matrix:
, , :
, :
:
The last row gives , so the system is inconsistent (no solution).
Check: The rank of the coefficient matrix is 3 (three pivots), but the rank of the augmented matrix is 4 (four pivots). By the Rouche—Capelli theorem, the system is inconsistent.
Intuition
Section titled “Intuition”Gaussian elimination is the systematic process of untangling a web of simultaneous constraints. Each equation in a linear system defines a hyperplane in some high-dimensional space, and a solution is a point where all hyperplanes intersect. Row reduction is the algebraic equivalent of rotating and sliding these hyperplanes until they reveal their intersection evidently. When you swap rows, you are re-ordering which constraint you address first. When you multiply a row by a scalar, you are rescaling a constraint without changing the solution set. When you add a multiple of one row to another, you are using one equation to eliminate a variable from another — the same logic as solving two equations with two unknowns by substitution.
The deeper insight is that row reduction preserves the solution space while simplifying its description. The row echelon form makes the structure of the solution set transparent: pivot columns identify the dependent variables, free columns identify the independent degrees of freedom, and the rank tells you the dimension of the solution space. This is why the same technique extends to function spaces and operator theory, where infinite-dimensional systems of equations arise logically.
Counterexamples worth knowing by name
Section titled “Counterexamples worth knowing by name”| Claim | True? | Counterexample |
|---|---|---|
| A system with the same number of equations as unknowns has a unique solution | no | and has infinitely many; and has none |
| A square system always has a solution | no | , is square and inconsistent |
| More equations than unknowns means no solution | no | duplicate or dependent equations collapse; three copies of one equation in one unknown has a solution |
| Row operations change the solution set | no | they are invertible, which is the reason elimination is valid |
| Least squares solves the system | no | it solves a different system, , whose solution is the best approximation when has none |
| A zero row in echelon form means no solution | no | a zero row means infinitely many solutions if the augmented entry is also zero, and no solution if it is not — read the augmented column |
| Partial pivoting changes the exact answer | no | it changes the rounding behaviour only; in exact arithmetic the solutions are identical |
| The LU factorisation exists for every matrix | no | it requires non-zero pivots in order; pivoting gives a permuted factorisation |
The first row is the one to internalise, because the shape of the coefficient matrix does not determine the outcome. Two systems can look identical in shape and differ in every way that matters — which is why the answer is read from the echelon form of the augmented matrix.
The least-squares row is the bridge to the next idea: when has no solution, asking for the best is still a sensible question, and the normal equations answer it.
Where the research frontier is
Section titled “Where the research frontier is”- Sparse elimination. For matrices from real problems, most entries are zero, and the ordering of elimination determines how much fill-in appears. Choosing a good ordering is NP-hard in general, so heuristics — minimum degree, nested dissection — are where the practical gains live.
- Iterative methods. For very large systems, factorisation is too expensive and Krylov subspace methods (conjugate gradient, GMRES) are used instead; their convergence theory is where the research is.
- Randomised linear algebra. Sketching a large system down to a smaller one and solving that, with probability bounds on the error.
- Rounding-error analysis. The classic backward-error results are decades old, and extending them to structured and low-rank matrices is active.
- Complexity. Whether Gaussian elimination is optimal, and the exponent of matrix multiplication, connect this page to the open problem on the matrices page.
Interleaving problems
Section titled “Interleaving problems”Mix these with Linear Independence, Span, Basis and Dimension, Matrices, Eigenvalues and Eigenvectors, Singular Value Decomposition and Inner Product Spaces.
- (Dimension.) A consistent system with rank in unknowns has free parameters. Derive that from rank-nullity rather than from elimination, and say what the null space is.
- (Matrices.) Show that a system is uniquely solvable exactly when the coefficient matrix is invertible, and that this is equivalent to a non-zero determinant and to full rank. Three statements, one fact.
- (LU.) Carry out elimination on a matrix and read the multipliers off into . Verify by multiplication, and explain why has the pivots on its diagonal.
- (Eigenvalues.) Show that the eigenvalues of a triangular matrix are its diagonal entries, and explain why that makes reduction to triangular form the standard route to eigenvalues.
- (Inner products.) Derive the normal equations from the geometry: the residual must be orthogonal to the column space. Then explain why orthogonality, rather than “as close as possible”, is the real condition.
- (Numerical analysis.) Construct a system where elimination without pivoting produces a wildly wrong answer, and show that partial pivoting fixes it. One small pivot is enough.
Cross-References
Section titled “Cross-References”- Matrices: The coefficient matrix of a linear system determines its solvability via rank and determinant.
- Linear Transformations: A system can be viewed as finding the preimage of under the linear transformation defined by .
- Singular Value Decomposition: The pseudoinverse derived from the SVD provides the minimum-norm least squares solution to inconsistent systems.