Free Variables and Pivots in Linear Algebra: What They Are and How to Read Them
In a system of linear equations, pivots and free variables divide the variables into two groups. Variables whose coefficient columns contain pivot positions are basic variables. Variables whose coefficient columns contain no pivot positions are free variables.
In a consistent system, free variables may be assigned arbitrary values, and the basic variables are then determined in terms of them.
And now I'll go deep into each of these topics and explain how to calculate and interpret them.
What Is a Pivot?
A pivot position is the location of a leading entry in a matrix written in row echelon form (REF). The nonzero entry occupying that position is called a pivot entry, and the column containing it is a pivot column.
For example,
[ 2 4 1 ] [ 0 3 5 ]
is in REF. The pivot entries are 2 and 3, located in columns 1 and 2.
Pivots do not have to equal 1 in REF.
In reduced row echelon form (RREF), however, every pivot entry is normalized to 1, and every other entry in its column is zero. For example:
[ 1 0 5 ] [ 0 1 -3 ]
has pivots in columns 1 and 2.
Each pivot column of the coefficient matrix corresponds to one basic variable. If the coefficient matrix has three pivot positions, it has three basic variables and rank 3.
Thus:
rank(A) = number of pivot positions in A = number of basic variables
This statement refers specifically to pivots in the coefficient matrix A. A pivot that appears in the augmented column of [A | b] does not correspond to a variable.
What Is a Free Variable?
A free variable is a variable whose corresponding coefficient column contains no pivot position.
Suppose a system has variables:
x1, x2, x3
and the pivot columns are columns 1 and 2. Then x1 and x2 are basic variables, while x3 is free.
If the system is consistent, a free variable is not uniquely determined by the equations. It may be assigned an arbitrary real value, usually represented by a parameter such as t.
The basic variables are then expressed in terms of that parameter.
One free variable produces one independent parameter. Two free variables produce two parameters, and so on.
Therefore, if a system is consistent and contains at least one free variable, it has infinitely many solutions.
Basic Variables vs Free Variables
Every variable in a linear system belongs to exactly one of two categories:
Basic variable: Its coefficient column contains a pivot position.
Free variable: Its coefficient column contains no pivot position.
Once values are assigned to the free variables in a consistent system, the basic variables are determined.
The distinction is therefore:
Pivot column → basic variable Non-pivot coefficient column → free variable
The number of free variables is directly related to rank.
If a coefficient matrix A has n columns and rank r, then:
number of free variables = n - r
For example:
- 4 variables and rank 3 → 1 free variable.
- 5 variables and rank 2 → 3 free variables.
- n variables and rank n → no free variables.
The quantity:
n - r
is called the nullity of A.
So:
nullity(A) = number of free variables
Pivot Positions Do Not Require RREF
You do not need to reduce a matrix all the way to RREF to identify its pivot and free-variable columns.
REF is enough.
For example,
[ 2 4 1 ] [ 0 3 5 ]
is in REF.
The leading entries occur in columns 1 and 2. Therefore:
- column 1 is a pivot column;
- column 2 is a pivot column;
- column 3 is a non-pivot column.
So x1 and x2 are basic variables, while x3 is free.
Continuing from REF to RREF does not change which columns contain pivots. It only normalizes each pivot to 1 and clears the entries above it.
RREF is therefore useful because it makes the relationships among the variables easier to read, not because it creates the distinction between basic and free variables.
How to Identify Pivots and Free Variables in RREF
Consider the system:
x1 + 2x2 - x3 = 4
2x1 + 3x2 + x3 = 7
Its augmented matrix is:
[ 1 2 -1 | 4 ] [ 2 3 1 | 7 ]
Apply:
R2 = R2 - 2R1
[ 1 2 -1 | 4 ] [ 0 -1 3 | -1 ]
Then:
R2 = -R2
[ 1 2 -1 | 4 ] [ 0 1 -3 | 1 ]
Finally:
R1 = R1 - 2R2
[ 1 0 5 | 2 ] [ 0 1 -3 | 1 ]
This is RREF. You can also check the reduction with a matrix RREF calculator.
The pivot positions are in coefficient columns 1 and 2.
Therefore:
- x1 is basic;
- x2 is basic;
- x3 is free.
The coefficient matrix has three columns and rank 2, so:
3 - 2 = 1
free variable, exactly as the RREF shows.
How to Write the Parametric Solution
Since x3 is free, set:
x3 = t, where t ∈ R.
From the first row:
x1 + 5x3 = 2
so:
x1 = 2 - 5t
From the second row:
x2 - 3x3 = 1
so:
x2 = 1 + 3t
The complete solution is therefore:
x1 = 2 - 5t x2 = 1 + 3t x3 = t
In vector form:
(x1, x2, x3) = (2, 1, 0) + t(-5, 3, 1)
The vector:
(2, 1, 0)
is one particular solution, corresponding to t = 0.
The vector:
(-5, 3, 1)
describes the direction in which the solutions vary as the free parameter changes.
So the solution set is an affine line in R³.
As a quick check, take t = 1. Then:
(x1, x2, x3) = (-3, 4, 1)
Substituting into the original equations gives:
-3 + 8 - 1 = 4
and:
-6 + 12 + 1 = 7
Both equations are satisfied.
Rank, Pivots, and Solution Types
Rank, pivots, and free variables are closely connected.
For a system:
Ax = b
the coefficient matrix A has:
r = rank(A)
pivot columns and:
n - r
free variables, where n is the number of variables.
The solution type then depends on both the pivot structure and consistency.
Unique solution
A system has a unique solution when it is consistent and every variable column contains a pivot.
Equivalently:
rank(A) = n
There are no free variables.
Infinitely many solutions
A system has infinitely many solutions when it is consistent and at least one variable is free.
Equivalently:
rank(A) < n
and the system is consistent.
Consistency matters. The presence of non-pivot columns alone does not guarantee infinitely many solutions.
No solution
A system has no solution when the augmented matrix contains a pivot in the augmented column.
For example, an RREF may contain:
[ 0 0 0 | 1 ]
which represents:
0 = 1
That contradiction makes the system inconsistent.
The augmented column does not correspond to a variable. Therefore, a pivot in that column does not create a basic variable; it signals that no solution exists.
Free Variables in Homogeneous Systems
A homogeneous system has the form:
Ax = 0
Every homogeneous system is consistent because:
x = 0
is always a solution.
If there are no free variables, the zero vector is the only solution.
If free variables exist, the system has infinitely many solutions, and the solution set forms the null space of A.
Using the coefficient matrix from the previous example, consider:
x1 + 2x2 - x3 = 0
2x1 + 3x2 + x3 = 0
Its RREF is:
[ 1 0 5 | 0 ] [ 0 1 -3 | 0 ]
The pivot columns are still columns 1 and 2, and x3 remains free.
Set:
x3 = t
Then:
x1 = -5t, x2 = 3t, x3 = t
So:
(x1, x2, x3) = t(-5, 3, 1)
Therefore:
Nul(A) = {t(-5, 3, 1) : t ∈ R}
The null space is a line through the origin.
Each free variable contributes one independent parameter. More generally, when several free variables are present, set one free variable equal to 1 and the others equal to 0 in turn. The resulting direction vectors form a basis for the null space.
That is why:
dim(Nul(A)) = nullity(A) = number of free variables
For a nonhomogeneous but consistent system Ax = b, the solution set has the same null-space directions but is shifted by a particular solution.
The free variables control those directions; the pivots determine how the basic variables depend on them.