← LibraryIndependent and Dependent Variables | KEVOS® MathematicsProject Delivery · Project ManagementLesson 70/189← PrevNext →
ArticlePublished 8 Aug 202622 min readBy Kevin Jogin
Skip to content

Engineering/Mathematics/Systems of Linear Equations

Independent and Dependent Variables

Every unknown in a consistent linear system is either pinned down by a pivot column or left free to take any value whatsoever. That single partition determines how many degrees of freedom the solution set has and gives an exact, finite description of an infinite family of solutions.

  • Core level
  • Stream: linear-systems
  • Reading time 15 min
  • Ref KVS-ENG-MATH-0011
Taxonomy
Engineering / Mathematics
Prerequisite
Reduced row-echelon form; system consistency
Rule
Pivot column → dependent; non-pivot column → free
Degrees of freedom
nr for a consistent system
Unique solution iff
r=n with the system consistent
Shortcut
Consistent with n>m → infinitely many solutions

Overview

A consistent linear system with fewer independent equations than unknowns has infinitely many solutions, which is an uncomfortable object to hand to an engineer. The remedy is not to enumerate the solutions but to parametrise them. Reduced row-echelon form supplies the parametrisation automatically: it sorts the unknowns into two groups, one of which may be assigned arbitrary values and the other of which is then determined uniquely.

The sorting rule is purely positional. Reduce the augmented matrix; a variable whose column carries a leading one is dependent, and every other variable is independent or free. Because a leading one is the only non-zero entry in its column, the row containing it already expresses its dependent variable explicitly in terms of the free variables. No back-substitution and no rearrangement are required — the reduced matrix is a solved system, written down.

Counting makes the structure quantitative. Writing r for the number of non-zero rows and n for the number of unknowns, a consistent system has exactly nr free variables. When nr=0 the solution is unique; when nr>0 the solution set is an (nr)-parameter family. This is also the sense in which the notion is robust: because reduced row-echelon form is unique, which variables are free is not a matter of taste or of elimination order but a property of the system itself.

The engineering reading of nr is degrees of freedom, and it is usually the most valuable number the analysis produces. In a redundantly actuated mechanism it is the size of the null-space motion available for secondary objectives; in a statically indeterminate structure it is the number of independent self-stress states; in a reaction network it is the number of independent reactions. The free variables are not a nuisance to be eliminated but the design latitude the model has revealed.

Definition

Independent and Dependent Variables

IDV

Let A be the augmented matrix of a system of linear equations in n unknowns and let B be a row-equivalent matrix in reduced row-echelon form. Suppose column j of B contains the leading one of some row and that jn+1, so column j is a pivot column other than the constants column. Then the variable xj is dependent. Any variable that is not dependent is independent, also called free.

The clause excluding the final column matters. A leading one in column n+1 makes the system inconsistent, and in that case the language of dependent and free variables has no content because there is no solution set to parametrise.

Free Variable Count

FVCS

For a consistent system of m equations in n unknowns whose augmented matrix reduces to a form with r non-zero rows, the solution set can be described using exactly nr free variables. Equivalently, the pivot index set D has r elements, of which none is n+1, so precisely nr of the n variable columns carry no leading one.

Parametric Description of a Solution Set

PDSS

An expression of the solution set in which each free variable ranges over the whole scalar field and each dependent variable is written as a fixed affine function of the free variables. Such a description is finite, exact and complete: every solution arises from exactly one assignment of the free variables, and every assignment yields a solution.

Concepts

Why the pivot column decides

Consider row i of the reduced matrix, whose leading one lies in column di. Because a leading one is the only non-zero entry of its column, no other row constrains xdi, and row i itself constrains it exactly once. The equation that row transcribes is therefore already solved for xdi: its value is the constant entry minus a linear combination of the variables in non-pivot columns. A variable in a non-pivot column appears in no row as a leading term, so nothing forces its value; it may be chosen freely. The partition is thus not a convention but a direct consequence of the shape of reduced row-echelon form.

The solved form written once and for all

With D={d1,,dr} the pivot indices and f1,,fnr the non-pivot variable indices, row i gives xdi=[B]i,n+1j[B]i,fjxfj. Every solution of the system has this form and every choice of the xfj produces one. Note that the constants column contributes the particular part and the non-pivot columns contribute the homogeneous part — a decomposition that reappears later as the statement that a solution set is a translate of a null space.

Consistency, rank and the count of solutions

For a consistent system with n unknowns, rn necessarily: the reduced augmented matrix has n+1 columns, so rn+1, and r=n+1 would place a leading one in the final column, contradicting consistency. Two cases remain. If r=n every variable column is a pivot column, there are no free variables, and the first n entries of the constants column are the unique solution. If r<n then nr>0 variables are free, and since each may take any of infinitely many values, the solution set is infinite.

Degrees of freedom are an invariant, not a choice

Reduced row-echelon form is unique, so the pivot index set D is determined by the original matrix alone. Consequently which variables are dependent and which are free is fixed by the system, not by the order in which rows were eliminated. This is what allows nr to be quoted as the number of degrees of freedom. What is not canonical is the choice of which variables one might prefer to treat as parameters in a hand-rolled parametrisation; the reduced form simply supplies a distinguished, reproducible choice.

The counting shortcut for wide systems

A consistent system with strictly more unknowns than equations has infinitely many solutions. The proof is a two-line count: the reduced matrix has m rows so rm, and therefore nrnm>0. The practical value is that it uses only m, n and the knowledge that some solution exists. A single solution obtained from measurement, from physical reasoning or from a solver certifies consistency, after which the conclusion follows without any reduction at all.

What the free variables mean in a model

A free variable is a quantity the constraints do not determine. In a well-posed design problem that is information, not error: it identifies where the model leaves latitude that a secondary criterion — minimum energy, minimum norm, manufacturability — can be used to resolve. In an ill-posed identification problem it is a warning: a parameter the data cannot distinguish, so any reported value for it is an artefact of the solver. Distinguishing these two readings is a modelling judgement that the algebra cannot make for you.

Procedure: partitioning the unknowns and describing the solution set

Reduce the augmented matrixRow-reduce [Ab] to reduced row-echelon form B and record r and the pivot index set D.
Confirm consistency firstIf n+1D the system has no solutions and the dependent-free partition is meaningless. Stop.
Label the variablesEach variable column in D gives a dependent variable; each variable column not in D gives a free variable. There are nr of the latter.
Read one equation per pivot rowRow i already isolates xdi. Move the non-pivot terms to the right-hand side; no back-substitution is needed.
Write the parametric solution setExpress the solution as a set indexed by the free variables, each ranging over the whole scalar field.
Report the degrees of freedomQuote nr and name the free variables explicitly, so a downstream reader knows what the model has left undetermined.

Equations

Partition of the variable indices

EQ-IDV-01
xjdependentjD,xjfreejD,1jn

The partition rule is purely positional. Writing D=D{1,,n} for the pivot indices that reference a variable and F for its complement, the dependent variables are indexed by D and the free variables by F.

Solved form of a pivot row

EQ-IDV-02
xdi=[B]i,n+1j=1nr[B]i,fjxfj,1ir

Each non-zero row of the reduced augmented matrix expresses one dependent variable as an affine function of the free variables. The constant term is a particular solution; the sum is the homogeneous part.

Number of free variables

EQ-IDV-03
|F|=nr

For a consistent system in n unknowns whose reduced augmented matrix has r non-zero rows, exactly nr variables are free. This is the number of degrees of freedom of the solution set.

Consistent systems, rank and uniqueness

EQ-IDV-04
Srn,r=n|S|=1,r<n|S|=

The complete classification for a consistent system. Rank equal to the number of unknowns is exactly the condition for a unique solution.

Wide consistent systems have infinitely many solutions

EQ-IDV-05
Sandn>mnrnm>0

Since the reduced matrix has only m rows, rm. More unknowns than equations therefore guarantees at least one free variable, provided a solution exists at all.

Parametric solution set

EQ-IDV-06
S={xnxdi=[B]i,n+1j[B]i,fjxfj,xfj}

A finite, exact description of a possibly infinite set. Every solution corresponds to exactly one assignment of the free variables.

Particular solution from switching off the free variables

EQ-IDV-07
xfj=0jxdi=[B]i,n+1

Setting every free variable to zero recovers the constants column directly. This is the distinguished representative most software returns for an under-determined system.

Variable Definitions

Symbols used on this page
SymbolNameMeaningDomain / type
BReduced augmented matrixReduced row-echelon form of [Ab]m x (n+1) matrix
nUnknown countNumber of variables in the systempositive integer
mEquation countNumber of equations, equal to the row countpositive integer
rRankNumber of non-zero rows of B, equal to the number of leading ones0 to min(m, n+1)
diPivot column indexColumn of the leading one in row i; indexes a dependent variable when din1 to n+1
fjNon-pivot column indexColumn carrying no leading one; indexes a free variable when fjn1 to n+1
nrDegrees of freedomNumber of free variables in a consistent systemnon-negative integer
SSolution setAll vectors satisfying the systemsubset of C^n
bVector of constantsRight-hand sides of the equationsvector in C^m

Worked Numerical Example

Problem statement

A planar manipulator has five actuated joint rates x1,,x5 and three task-space velocity constraints. Determine which joint rates are determined by the task, which are free, and describe the complete set of admissible joint-rate vectors.

  1. Assemble the constraint system

    The three constraints are x1+2x2+3x4x5=4, 2x1+4x2+x3+5x4+x5=9 and x1+2x2+2x3+x4+5x5=6. Here m=3 and n=5, so the augmented matrix is 3×6.

    [120314241519122156]
  2. Anticipate the outcome

    Before reducing, note that n=5>3=m. If the system turns out to be consistent, it must have infinitely many solutions — at least nm=2 free variables. This is a check on the answer, not a substitute for the computation.

  3. Eliminate in the first pivot column

    Entry (1,1) is a one. Apply R2R22R1 and R3R3R1.

    [120314001131002262]
  4. Complete the reduction

    Column 2 has no available leading entry below row 1, so it is a non-pivot column. Column 3 supplies the second leading one. Apply R3R32R2; nothing needs clearing above, since entry (1,3) is already zero.

    B=[120314001131000000]
  5. Check consistency, then partition the variables

    Here r=2 and D={1,3}. Since n+1=6D, the system is consistent. Columns 1 and 3 are pivot columns, so x1 and x3 are dependent. Columns 2, 4 and 5 carry no leading one, so x2, x4 and x5 are free. The count agrees: nr=52=3.

  6. Read the solved equations

    Row 1 is x1+2x2+3x4x5=4 and row 2 is x3x4+3x5=1. Each already isolates its dependent variable:

    x1=42x23x4+x5,x3=1+x43x5
  7. Write the solution set

    Collecting the components in order gives an exact description of the whole three-parameter family.

    S={[42x23x4+x5x21+x43x5x4x5]x2,x4,x5}
  8. Verify two members

    Setting x2=x4=x5=0 gives x=(4,0,1,0,0), and the three constraints evaluate to 4, 9 and 6 as required. Setting x2=1, x4=2, x5=1 gives x1=5 and x3=6, and substitution again returns 4, 9 and 6. Both checks are performed against the original equations, not the reduced ones.

Result

The task determines only two of the five joint rates; three degrees of freedom remain. In manipulator terms the mechanism is kinematically redundant to order three, and that redundancy is available for secondary objectives such as joint-limit avoidance or minimum-norm motion. Reporting the solution as a single vector would discard exactly the information a redundancy-resolution scheme needs.

Applications &amp; Industry Use

Robotics

Redundancy resolution in manipulator control

For a redundant arm the instantaneous inverse-kinematics problem is an under-determined linear system in the joint rates. The free variables span the self-motion of the mechanism — joint motions that leave the end effector stationary. Identifying them explicitly is the precondition for any secondary-task projection scheme.

Structural engineering

Self-stress states in indeterminate frames

Equilibrium equations for a redundant truss are consistent but rank-deficient in the member forces. The nr free variables index independent self-stress states: internal force distributions in equilibrium with zero external load. Their number is the degree of static indeterminacy and dictates how many compatibility conditions must be added.

Chemical engineering

Independent reactions in a reaction network

Atom balances over a set of candidate reactions form a homogeneous system in the stoichiometric coefficients. The free variables correspond to an independent reaction set, and their count tells a process engineer how many reaction extents must be measured or specified to close the model.

Transport &amp; logistics

Circulations in a flow network

Conservation at each node leaves the flows determined only up to circulations around independent cycles. The free variables are exactly one flow per independent cycle, so their number equals the cyclomatic number of the network and quantifies the routing latitude available to a scheduler.

Statistics &amp; experimental design

Non-estimable parameters

In an over-parametrised linear model the normal equations are consistent but rank-deficient. Free variables identify parameter combinations the data cannot distinguish. Reporting individual coefficient values in this situation is meaningless; only functions of the dependent combinations are estimable.

Computer graphics

Under-constrained geometric fits

Fitting a plane, conic or transform to fewer constraints than parameters yields a family of solutions. Enumerating the free variables shows which geometric attributes the data pins down and which must be supplied by a regularisation term or an additional observation.

Design Considerations

Test consistency before partitioning

The dependent-free distinction presupposes a non-empty solution set. Applying the count nr to an inconsistent system produces a number that describes nothing. Order the analysis so that the augmented-column pivot test always runs first.

Report the free variables, not just their count

Two systems with the same nr can leave entirely different quantities undetermined. Downstream consumers of a model need to know which variables are free, because that is what determines whether the residual freedom is useful design latitude or an identifiability failure.

Do not confuse free with arbitrary in a physical sense

Mathematically a free variable ranges over the entire scalar field. Physically it is usually bounded by actuator limits, non-negativity or material capacity. The parametric solution set describes the affine family; intersecting it with the physical feasible region is a separate step and may leave nothing at all.

Prefer the canonical partition for reproducibility

Any set of nr variables that indexes a non-singular submatrix could serve as parameters, and hand-picked choices are sometimes more natural physically. The pivot-based partition has the advantage of being unique and reproducible, which matters when two teams must compare results. If a different parametrisation is used, document it.

Rank is a fragile quantity in floating point

The number of free variables is determined by r, and r is discontinuous in the matrix entries. A nearly dependent pair of equations can be counted as independent or not depending on rounding, changing the reported degrees of freedom. Where the entries come from measurement, determine rank from a singular value decomposition with a stated tolerance rather than from a pivot count.

Use the minimum-norm solution deliberately, not by default

Least-squares routines silently select one member of an infinite family, usually the one of smallest norm. That choice is defensible, but it is a choice. If the free variables carry engineering meaning, resolve them against an explicit criterion rather than accepting a library default.

Standards &amp; Codes

Notation, interchange and numerical standards that govern how this material is written down, stored and computed in production systems.

Applicable standards, conventions and reference implementations
ReferenceTitleRelevance to this topic
ISO 80000-2Quantities and units — Part 2: MathematicsPrescribes the set-builder and indexing notation used to write a parametric solution set, including the conventions for subscripted indices such as xdi and xfj.
ISO 8373Robotics — VocabularyDefines degrees of freedom, redundancy and mobility for manipulators, aligning the algebraic quantity nr with the terminology used in robotic system specifications.
IEEE 754-2019IEEE Standard for Floating-Point ArithmeticGoverns the rounding that makes the pivot count, and hence the reported number of free variables, sensitive to perturbation in computed matrices.
LAPACK / BLAS referenceLinear Algebra PACKage reference implementationRank-revealing routines such as xGELSY and xGELSD return a minimum-norm solution and an estimated numerical rank, which is the production analogue of counting free variables by hand.
ISO/IEC 40314Mathematical Markup Language (MathML) Version 3.0Encodes the set-builder expressions and stacked column vectors on this page so that the parametric description remains machine-readable and accessible.

Material Selection

For a mathematical topic, "material" is the numeric representation: the scalar field, storage format and precision the computation is built from.

Representation and precision selection
RepresentationSelect whenTrade-off
Exact rational arithmeticSymbolic models where the parametric solution set is the deliverable and coefficients are small integers or ratios.Yields an exact, auditable parametrisation with an unambiguous free-variable set, but intermediate coefficients can grow rapidly.
IEEE 754 binary64 with an SVD rank testMeasured or computed matrices at engineering scale where the degrees of freedom must be robust to noise.Gives a defensible rank with an explicit tolerance, at roughly an order of magnitude more arithmetic than elimination.
Pivoted QR factorisationSelecting a well-conditioned set of dependent variables rather than the leftmost one.Chooses a numerically sensible partition and is far cheaper than an SVD, but the resulting free-variable set is not the canonical one and must be reported explicitly.
Symbolic parameters for the free variablesDesign studies where the effect of each degree of freedom must be traced analytically.Preserves interpretability and supports sensitivity analysis, but expressions grow quickly with nr.
Fixed-point arithmeticEmbedded controllers evaluating a precomputed parametric solution on-line.Cheap and deterministic for evaluating an already-derived parametrisation, but wholly unsuitable for determining rank in the first place.
Sparse elimination with a fill-reducing orderingLarge network or finite-element systems where the free variables correspond to cycles or mechanisms.Keeps the factorisation tractable, but the pivot order is chosen for sparsity, so the resulting dependent-free split is not the canonical one.

Manufacturing Notes

Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.

The reduced form is already the answer

Once the augmented matrix is fully reduced, writing the parametric solution requires only transcription: move the non-pivot terms of each pivot row to the right-hand side and change their signs. The characteristic cost of the method is therefore the reduction itself, about n3 operations for a square system, with the parametrisation effectively free.

Hand procedure and index bookkeeping

Record the pivot column index as each leading one is created, rather than reconstructing D at the end. Then list the variable indices not in D in increasing order to obtain the free variables. This ordering discipline is what prevents the classic slip of pairing row i with variable xi in a rank-deficient system.

Extracting a basis for the direction space

Setting one free variable to 1 and the rest to 0, then reading the resulting dependent values, produces one vector per degree of freedom. The nr vectors obtained this way are linearly independent by construction, because each carries a 1 in a coordinate where all the others carry 0, and together they span the homogeneous part of the solution set.

Library behaviour

SymPy's linsolve returns a parametric solution with symbols for the free variables, which mirrors the hand method directly. NumPy and SciPy instead return a single minimum-norm vector from lstsq plus an estimated rank; recovering the free directions there requires the null space, obtained from the trailing right singular vectors of the SVD.

Verification strategy

Check the parametrisation, not just one solution. Substitute the general expression into the original equations symbolically and confirm that every free variable cancels identically; a residual term in a free variable indicates an arithmetic error in the corresponding column. Then confirm that the count of independent direction vectors equals nr.

Failure Modes &amp; Common Mistakes

Failure modes, root causes and prevention
Failure mode / mistakeImpactRoot causePrevention & detection
Pairing variable xi with row ihighAssuming pivots lie on the leading diagonal, which holds only for square full-rank systems.Track the pivot index set D explicitly during reduction and label dependent variables by column index, never by row number.
Counting free variables as the number of zero rowshighConfusing the row deficiency mr with the column deficiency nr; they coincide only when m=n.Always compute nr from the number of unknowns, and treat zero rows as evidence of redundant equations only.
Partitioning an inconsistent systemhighSkipping the augmented-column test and applying the dependent-free rule to a system with no solutions.Confirm n+1D before any variable is labelled. The free-variable theorem has consistency as an explicit hypothesis.
Treating the constants column as a variable columnmediumIncluding index n+1 when listing non-pivot columns, inflating the free-variable count by one.Remember that for a consistent system n+1 always lies in F but indexes no variable; exclude it before counting.
Reporting one vector for an infinite familymediumPassing on a solver's minimum-norm output without noting that nr>0.Report r, nr and the identity of the free variables alongside any numeric solution.
Inferring consistency from r<nmediumReading the classification theorem as an equivalence when its hypothesis is consistency.Establish consistency independently; a rank-deficient system can still have a pivot in the constants column.
Rank inflation from roundinghighA structurally dependent row acquires a tiny non-zero pivot in floating point, reducing the apparent degrees of freedom to zero.Determine rank from singular values against a tolerance scaled by the matrix norm and the machine epsilon, not from exact pivot tests.
Assuming the free variables are physically unboundedlowReading the algebraic parametrisation as a statement about achievable configurations.Intersect the parametric family with the physical feasible set before quoting the available latitude.

FAQs

Can I choose which variables to treat as free?

Yes, provided the remaining variables correspond to a non-singular submatrix of the coefficient matrix. The pivot-based choice is simply the canonical one, produced automatically by reduced row-echelon form and reproducible by anyone. If you deviate from it, say so explicitly, because the algebraic form of the solution changes even though the solution set does not.

Why is the number of free variables nr rather than nm?

Because equations may be redundant. The value r counts the independent equations, and only those constrain the unknowns. When all m equations are independent the two counts agree, but a system with duplicated or linearly dependent rows has r<m and correspondingly more freedom than the raw equation count suggests.

Does a free variable mean the system is badly posed?

Not by itself. In design and control, free variables represent genuine latitude and are exploited deliberately. In parameter identification they usually indicate that the data cannot separate certain parameter combinations, which is a problem. The mathematics is identical; the interpretation depends on what the model is for.

How do I get a single representative solution?

Set every free variable to zero. The dependent variables are then read directly from the constants column of the reduced augmented matrix, with no further arithmetic. This is a valid solution but carries no claim to being preferred; a minimum-norm solution obtained from a least-squares routine is a different, and often more defensible, representative.

What is the relationship between the free variables and the null space?

Setting each free variable to one in turn, with the others zero, and reading the induced dependent values produces a set of nr vectors that span the null space of the coefficient matrix. The full solution set is one particular solution plus every combination of these vectors, which is the affine translate structure of a consistent system.

If a system has more unknowns than equations, must it have free variables?

If it is consistent, yes: rm<n forces nr>0. If it is inconsistent the question does not arise, since there is no solution set to parametrise. The hypothesis of consistency cannot be dropped.

Does the number of degrees of freedom change if I reorder the equations?

No. Row swaps are elementary row operations and preserve the reduced row-echelon form, hence r, D and the entire dependent-free partition. Reordering the variables is a different matter: that permutes columns, which is not a row operation and does change which columns are pivotal.

References

  1. Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section TSS, subsection IDV. Licensed under the GNU Free Documentation License v1.2.
  2. ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
  3. ISO 8373:2021, Robotics — Vocabulary. International Organization for Standardization.
  4. Strang, G. Introduction to Linear Algebra, 5th edition. Wellesley-Cambridge Press, 2016.
  5. Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013.

AI Suggested Questions

  • Given a 4x7 augmented matrix in reduced row-echelon form with pivots in columns 1, 2 and 5, list the dependent and free variables and write the parametric solution set.
  • Show how setting each free variable to one in turn produces a spanning set for the null space, and prove that the resulting vectors are linearly independent.
  • Why can a different choice of free variables give a different-looking parametrisation of the same solution set, and how would I verify two such descriptions agree?
  • How does the numerical rank tolerance in a least-squares routine change the reported number of degrees of freedom for a nearly rank-deficient system?
  • Relate the number of free variables in a truss equilibrium system to the degree of static indeterminacy computed from the Maxwell counting rule.
  • For a redundant manipulator, how are the free variables of the velocity kinematics used to construct a null-space projection controller?

Related Calculators

Continue learning

Algebraic and Geometric Multiplicities of Eigenvalues | KEVOS® MathematicsArticle · Project ManagementAmitsur’s Theorem on the Radical of a Polynomial Ring | KEVOS®Article · Project ManagementAmitsur’s Theorem on the Radical of an Algebra of Small Dimension | KEVOS®Article · Project ManagementArchetypes: Reference Catalogue of Worked Systems | KEVOS® MathematicsArticle · Project Management