← LibrarySystems of Linear Equations: Fundamentals | KEVOS® MathematicsProject Delivery · Project ManagementLesson 156/189← PrevNext →
ArticlePublished 8 Aug 202621 min readBy Kevin Jogin
Skip to content

Engineering/Mathematics/Systems of Linear Equations

Systems of Linear Equations: Fundamentals

A system of linear equations is m simultaneous constraints on n unknowns, each constraint built only from constants multiplying unknowns. Solving it does not mean finding a solution — it means characterising the complete set of n-tuples that satisfy every equation at once.

  • Foundation level
  • Stream: linear-systems
  • Reading time 12 min
  • Ref KVS-ENG-MATH-0003
Taxonomy
Engineering / Mathematics
Notation
aij = coefficient of unknown j in equation i
Size
m equations, n unknowns — independent quantities
Scalars
Drawn from ; real data is the common case
A solution is
An ordered n-tuple satisfying every equation
Deliverable
The solution set S, not one member of it

Overview

Almost every quantitative model that produces more than one constraint on more than one unknown arrives at a system of linear equations. Node balances in a network, equilibrium at the joints of a structure, conservation of mass across a process unit and the normal equations of a least-squares fit all take the same shape: several equations, each a weighted sum of the unknowns set equal to a constant. Fixing a precise definition and a disciplined notation for that shape is the first step in the subject, because every later theorem is stated in terms of it.

The definition is deliberately narrow. Each equation must be expressible as ai1x1+ai2x2++ainxn=bi, with coefficients and constants that do not depend on the unknowns. Nothing about the underlying application is retained: variable names, physical units and equation ordering are all discarded, and what survives is a rectangular array of numbers. That deliberate loss of context is what makes a single algorithm applicable to a truss, a circuit and a regression alike.

The word solve carries a stronger meaning here than in casual use. A solution is an ordered n-tuple of values, one per unknown, that makes every equation in the system true simultaneously — satisfying most of them is worth nothing. Solving the system means producing the solution set: the complete collection of such n-tuples. Exhibiting one member is a verification exercise, not a solution, and a system with infinitely many members demands a description of the whole family.

Two conventions carry real weight. The double-subscript coefficient aij names the equation first and the unknown second, so the coefficients of one equation share a first index and the coefficients of one unknown share a second. And an unknown absent from an equation is recorded as a coefficient of zero rather than omitted, which keeps the array of coefficients rectangular. Both conventions exist so that the system can be handed to a machine without further interpretation.

Definition

System of Linear Equations

SLE

A system of linear equations is a collection of m equations in the unknowns x1,x2,,xn of the form ai1x1+ai2x2++ainxn=bi for i=1,2,,m, where every coefficient aij, every constant bi and every unknown xj is drawn from the complex numbers .

The linear qualifier is usually dropped once the context is established, so system of equations is understood to mean a linear one throughout this material.

Solution of a System

An ordered n-tuple (x1,x2,,xn)=(β1,β2,,βn) of complex numbers is a solution when substituting βj for xj throughout makes every one of the m equations a true statement. The tuple is ordered: the same numbers assigned to different unknowns are a different candidate, and almost always not a solution.

Solution Set

The solution set S of a system is the set of all its solutions. It may be empty, contain exactly one n-tuple, or contain infinitely many. Solving a system means describing S completely, in a form that permits any member to be generated and any candidate to be tested.

Coefficient and Constant

In equation i, the number aij multiplying unknown xj is the coefficient of that unknown, and the number bi standing alone on the right is the constant term. Both are data: they may not depend on any unknown. An unknown absent from an equation has coefficient 0 there, which is recorded rather than omitted.

Concepts

The double-subscript convention

The coefficient aij is indexed by equation first and unknown second, always in that order and always without a separating comma unless an index exceeds nine. Holding i fixed and sweeping j recovers one equation; holding j fixed and sweeping i recovers the influence of one unknown across the whole system. This is not decoration: it is the convention that lets the coefficients be laid out as a rectangular array with rows indexed by i and columns by j, which is the direct route from a system of equations to matrix methods.

Solving means characterising a set

Producing a single tuple that satisfies every equation demonstrates only that the solution set is non-empty. The system in the worked example below is satisfied by (4,3,1,3) and equally by (2,4,2,6), so exhibiting either in isolation would misrepresent the answer. The deliverable is the complete set, written in a form that makes its size and structure explicit — empty, a single point, or a family with a stated number of free parameters.

The counts m and n set expectations, not outcomes

It is tempting to assume m=n gives a unique answer, m<n gives infinitely many and m>n gives none. Only the middle case is reliably suggestive, and none is a theorem. Equations may repeat information, in which case a square system has a family of solutions; equations may contradict one another, in which case even m<n yields nothing. What matters is the number of independent equations, which is the rank, and rank is discovered by reduction rather than by counting rows.

Absent unknowns carry zero coefficients

In the system x1+2x2+x4=7, x1+x2+x3x4=3, 3x1+x2+5x37x4=1 there are n=4 unknowns and m=3 equations, and the first equation has a13=0 because x3 does not appear in it. Writing that zero explicitly, rather than treating the equation as one in three unknowns, is what keeps every equation the same length and makes the coefficient array rectangular. Every subsequent method assumes this has been done.

Why the scalars are complex from the outset

The definition draws all data from even though virtually every early example uses integers. The cost of the generality is nil — the real numbers sit inside the complex numbers, so a real system is already covered — and the benefit appears later, when eigenvalues of a real matrix turn out to be complex and inner products require conjugation. Fixing the scalar system once, at the widest useful setting, means no theorem in the subject needs a real-only caveat.

Linearity is what bounds the possibilities

A system of two nonlinear equations, such as x2+y2=1 together with x+3y=0, has exactly two solutions: (32,12) and (32,12), the two points where a line cuts a circle. No linear system can behave that way. Restricting to the linear form forces the solution set to be empty, a single point, or an infinite flat family — never a finite collection of two or more isolated points. That restriction on outcomes is the direct payoff of the restriction on form.

From a physical model to a stated system

Declare and order the unknownsFix the list x1,,xn and its order. Every coefficient index refers to this ordering, which must not change afterwards.
Write one equation per constraintEach conservation law, equilibrium condition or specification becomes one equation. The count of these is m.
Expand and collectMultiply out, move all unknowns to the left in the fixed order and all constants to the right.
Insert explicit zerosRecord a coefficient of 0 for every unknown absent from an equation so all equations have the same length.
Read off aij and biThe coefficients now form a rectangular m×n array and the constants an m-long list, ready for matrix methods.

Equations

General form of a system of linear equations

EQ-SLE-01
a11x1+a12x2++a1nxn=b1a21x1+a22x2++a2nxn=b2am1x1+am2x2++amnxn=bm

The defining shape. Row i is one equation; column j collects the influence of unknown xj across all equations.

Compact form of a single equation

EQ-SLE-02
j=1naijxj=bi,i=1,2,,m

Equation i written with summation notation. The index j runs over the unknowns; the index i selects the equation.

Definition of the solution set

EQ-SLE-03
S={(β1,β2,,βn)nj=1naijβj=bi for all i}

The object that solving a system produces. Membership requires every equation to hold, not most of them.

A worked instance with four unknowns

EQ-SLE-04
x1+2x2+0x3+x4=7x1+x2+x3x4=33x1+x2+5x37x4=1

Here m=3 and n=4, with a11=1, a12=2, a13=0, a14=1 and b1=7. The tuple (2,4,2,1) is a solution, and it is not the only one.

Verification of a candidate solution

EQ-SLE-05
(2)+2(4)+0(2)+(1)=7,(2)+4+21=3,3(2)+4+5(2)7(1)=1

Substitution into all three equations of the preceding system. Every equation must close; a single failure disqualifies the tuple entirely.

A nonlinear system with exactly two solutions

EQ-SLE-06
{x2+y2=1x+3y=0S={(32,12),(32,12)}

A line intersecting a circle. Two isolated solutions is an outcome no linear system can produce, which is why the linear restriction is worth imposing.

Variable Definitions

Symbols used on this page
SymbolNameMeaningDomain / type
mEquation countNumber of simultaneous constraints in the systempositive integer
nUnknown countNumber of quantities to be determinedpositive integer
xjUnknownThe j-th quantity being solved forcomplex number
aijCoefficientMultiplier of unknown j in equation icomplex number
biConstant termRight-hand side of equation icomplex number
βjCandidate valueA specific value substituted for unknown xj when testing a tuplecomplex number
SSolution setThe set of all n-tuples satisfying every equationsubset of n
Complex scalarsThe number system supplying all coefficients, constants and unknownsfield
i,jIndicesEquation index and unknown index respectively1im, 1jn

Worked Numerical Example

Problem statement

A pipe network has four branches carrying volumetric flows q1,q2,q3,q4 in litres per second, with positive values denoting the nominal flow direction. Three junction balances have been assembled. State the system in standard notation, identify every coefficient, verify a proposed operating point, and establish whether it is the only one.

  1. State the system in standard form

    The three junction balances, with all unknowns on the left in the fixed order q1,q2,q3,q4 and every absent unknown recorded as a zero coefficient:

    2q1+q2+0q3+q4=14q1q2+3q3+0q4=40q1+2q2+q3q4=4
  2. Record the sizes and the data

    There are m=3 equations and n=4 unknowns. Reading the first row: a11=2, a12=1, a13=0, a14=1, b1=14. Reading the second: a21=1, a22=1, a23=3, a24=0, b2=4. Reading the third: a31=0, a32=2, a33=1, a34=1, b3=4. Note that the two explicit zeros are data, not omissions.

  3. Test the proposed operating point

    The design office proposes (q1,q2,q3,q4)=(4,3,1,3). Substitution must satisfy all three balances, not merely the first:

    2(4)+3+0+3=14,43+3(1)+0=4,0+2(3)+13=4
  4. Confirm and interpret

    All three equations close, so (4,3,1,3) is a solution and the solution set is non-empty. What has not been established is that it is the only operating point — verification confirms membership, never exclusivity.

  5. Search for a second solution

    With four unknowns constrained by only three equations, a second solution should be expected. Test the tuple (2,4,2,6) against every balance:

    2(2)+4+0+6=14,24+3(2)+0=4,0+2(4)+26=4
  6. Identify the pattern connecting them

    The difference between the two solutions is (2,4,2,6)(4,3,1,3)=(2,1,1,3). Substituting that difference into the left-hand sides gives 4+1+0+3=0, 21+3+0=0 and 0+2+13=0 — every balance returns zero. Adding any multiple of this direction to a known solution therefore produces another solution.

    (q1,q2,q3,q4)=(4,3,1,3)+t(2,1,1,3),t
  7. State the solution set

    The complete answer is a one-parameter family, not a point. Only now has the system been solved; the two individual tuples were samples of it.

    S={(42t,3+t,1+t,3+3t)t}
Result

The network has one degree of freedom: three independent junction balances cannot pin down four branch flows, so an infinite family of consistent operating points exists, all obtained by shifting along the direction (2,1,1,3). Physically this is a circulation loop that satisfies every balance while carrying no net supply. An additional constraint — a pump setting, a valve position or a measured flow — is required to select a single operating point, and if the design brief expected a unique answer the model is under-specified.

Applications &amp; Industry Use

Civil &amp; structural engineering

Joint equilibrium in a truss

Resolving forces horizontally and vertically at each pin joint gives two linear equations per joint in the unknown member forces. The system is assembled directly in the aij convention with rows indexed by equilibrium equations and columns by members, and its solution set determines whether the structure is determinate, indeterminate or a mechanism.

Electrical engineering

Nodal analysis of a resistive network

Applying Kirchhoff's current law at each node produces one linear equation per node in the unknown node voltages, with conductances as coefficients. Recording a zero coefficient for every node pair that is not directly connected is what gives the coefficient array its characteristic sparse structure.

Chemical process engineering

Steady-state material balances

Each component in a flowsheet contributes one balance equation across each unit, linear in the unknown stream flows. Large plant models assemble thousands of such equations, and the counts m and n are the first diagnostic of whether the flowsheet is fully specified, over-specified or under-specified.

Surveying &amp; geodesy

Levelling network adjustment

Each measured height difference gives one linear equation relating two unknown benchmark elevations. Networks routinely have far more observations than unknowns, so the system as written is inconsistent and is reformulated as a least-squares problem — which is itself a square linear system in the same notation.

Economics &amp; input-output analysis

Inter-industry demand models

Leontief input-output models express each sector's output as a linear function of the outputs it supplies to other sectors plus final demand. The result is a square system in the sector outputs, with technical coefficients aij carrying exactly the equation-then-unknown indexing used here.

Computer vision

Camera calibration constraints

Each correspondence between a known three-dimensional point and its observed image location contributes linear constraints on the entries of the projection matrix. Enough correspondences give a system whose solution set determines the calibration, and whose dimension reveals any degeneracy in the chosen calibration target.

Design Considerations

Fix the unknown ordering before writing any coefficient

Every index in the notation refers to a declared ordering of the unknowns. Reordering the unknowns midway through assembly permutes the columns of the coefficient array and silently corrupts the model. Record the ordering alongside the data and treat it as part of the model definition, not as an implementation detail.

Write the zeros

An unknown absent from an equation has coefficient zero, and that zero is data. Omitting it produces equations of differing lengths and an array that cannot be indexed, which defeats every subsequent method. In sparse storage the zeros need not be stored, but they must still be part of the model's logical shape.

Do not infer the outcome from m and n alone

Equation and unknown counts are a useful first check but never a conclusion. Duplicated or contradictory equations break every rule of thumb. Reserve judgement about the size of the solution set until the coefficient array has been reduced and its rank established.

Verification confirms membership, not uniqueness

Substituting a candidate and finding every equation satisfied proves only that the solution set is non-empty. Claims of uniqueness require an argument about the structure of the system. Reports that present a verified tuple as the answer without that argument are a recurring source of under-specified designs.

Keep units consistent within each equation

The notation is dimensionless, so nothing in the algebra prevents adding a term in metres to a term in kilonewtons. Normalising units before assembly, or non-dimensionalising the model entirely, both prevents that class of error and improves the numerical conditioning of the resulting system.

Decide early whether an exact solve or a fit is required

When m exceeds n and the constants come from measurement, an exact solution almost certainly does not exist, and forcing one by discarding equations throws away information. The right response is a least-squares formulation, and that decision is best made when the model is assembled rather than when the solver reports failure.

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 indexing and typographic conventions used here: italic scalar variables, subscript ordering for aij, and the set-builder notation used to write S.
ISO 80000-1Quantities and units — Part 1: GeneralGoverns dimensional consistency. Every term within one equation of a physically derived system must share a dimension, which is the cheapest available check on a freshly assembled model.
IEEE 754-2019IEEE Standard for Floating-Point ArithmeticDefines the arithmetic in which candidate solutions are verified numerically, and therefore why residuals are tested against a scaled tolerance rather than against exact zero.
ISO/IEC 9899 (C) Annex FIEC 60559 floating-point arithmetic bindingSpecifies how a conforming language exposes floating-point semantics, which determines the reproducibility of a residual computed by two different solver builds.
Matrix Market exchange formatNIST sparse and dense matrix file formatThe de facto standard for interchanging an assembled coefficient array and right-hand side between tools, preserving the row-equation and column-unknown convention explicitly.

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 integer coefficientsCoefficients arise from counting, stoichiometry or incidence structure rather than measurement.Verification of a candidate solution is exact and unambiguous, but the constants are rarely integral once physical data enters.
Exact rational arithmeticSmall systems where the structure of the solution set must be certified rather than estimated.No rounding and provable consistency decisions, at the cost of operand growth and limited tool support outside symbolic systems.
IEEE 754 binary64The default for any system assembled from measured or computed engineering data.Ample precision for most models, but residuals never reach exact zero, so consistency becomes a tolerance judgement.
Real scalarsStatics, steady-state balances, resistive networks and any model with no oscillatory content.Halves storage and simplifies the code path, but forecloses phase and eigenvalue analysis without a later type change.
Complex scalarsAlternating-current impedance networks, modal analysis and frequency-domain models.Doubles memory and roughly quadruples multiplication cost, in exchange for a theory that needs no special cases.
Sparse coefficient storageLarge network, flowsheet or finite element models where each equation involves only a handful of unknowns.Memory scales with the number of non-zero coefficients rather than mn, but the explicit zeros of the logical model must still be respected by the indexing scheme.

Manufacturing Notes

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

Assembling the system in software

The standard pattern is to allocate an m×n array of zeros, then write only the non-zero coefficients into position using the declared unknown ordering. Starting from zeros makes the explicit-zero convention automatic and removes the most common assembly error, which is a coefficient written into the wrong column after an unknown is inserted or removed.

Cost of verifying a candidate

Substituting a proposed n-tuple into all m equations costs about 2mn floating-point operations — one multiplication and one addition per coefficient. This is negligible compared with solving, so verification should be performed as a matter of course and the residual reported alongside any answer.

Residual tolerance in floating point

A correct solution computed in binary64 leaves a residual of order machine epsilon times the magnitude of the terms involved, not zero. The defensible test compares the residual norm against a tolerance proportional to the norms of the coefficient array and the constants; testing against exact zero rejects every correct numerical answer.

Library conventions

NumPy, SciPy, MATLAB and Eigen all take the coefficient array with rows indexed by equation and columns by unknown, matching the aij convention used here. LAPACK inherits Fortran column-major storage, so an array assembled row-wise in C must be transposed or declared appropriately at the interface — a mismatch that produces a plausible but incorrect answer rather than an error.

Recording the model, not just the numbers

The array of coefficients is meaningless without the ordering of unknowns and the identity of each equation. Any durable model should carry both as metadata. Formats such as Matrix Market permit comment headers for exactly this purpose, and using them is what makes an assembled system auditable years later.

Failure Modes &amp; Common Mistakes

Failure modes, root causes and prevention
Failure mode / mistakeImpactRoot causePrevention & detection
Reporting one solution as the answerhighA verified tuple is presented without establishing whether the solution set contains anything else.Determine the size of the solution set by reduction before reporting, and state explicitly whether the answer is unique.
Transposing the coefficient indiceshighReading aij as unknown-then-equation, so the coefficient array is built transposed.Fix the convention that the first index selects the equation, and check that the array has exactly m rows and n columns before solving.
Omitting a zero coefficienthighAn equation is written with only the unknowns that appear in it, leaving equations of differing lengths.Initialise the coefficient array to zero and write only non-zero entries, so absent unknowns are handled automatically.
Changing the unknown ordering mid-assemblyhighAn unknown is inserted, removed or reordered after some coefficients have already been placed.Declare the ordering once as part of the model definition and treat any change as requiring full reassembly.
Assuming a square system has a unique solutionmediumCounting equations rather than independent equations, when two rows carry the same information.Establish the rank by reduction; the count m=n is a hint, never a guarantee.
Satisfying most equations and declaring successmediumA candidate is checked against a subset of the equations, typically the simplest ones.Verify against every equation and report the largest residual, not the average or the first.
Mixed units within an equationmediumTerms in incompatible units are summed because the algebraic notation carries no dimensions.Perform a dimensional check on every assembled equation, and prefer a non-dimensionalised model where feasible.
Testing a floating-point residual against zerolowA correct solution leaves a small non-zero residual, which an exact comparison rejects.Use a tolerance scaled to the magnitudes of the coefficients and constants involved.

FAQs

What exactly does it mean to solve a system of equations?

It means producing the complete solution set: every ordered n-tuple that satisfies all m equations simultaneously. Exhibiting one tuple demonstrates only that the set is non-empty. A finished answer states whether the set is empty, a single point, or an infinite family, and in the last case describes the family well enough to generate any member of it.

Why is a solution an ordered tuple rather than just a set of numbers?

Because each value belongs to a specific unknown. The tuple (4,3,1,3) assigns 4 to q1 and 3 to q2; the tuple (3,4,1,3) assigns them the other way round and is a completely different candidate, almost certainly not a solution. This is why the ordering of the unknowns must be declared before any coefficient is written.

If I have as many equations as unknowns, is the solution unique?

Not necessarily. Two equations may express the same constraint, in which case the system has fewer independent constraints than unknowns and the solution set is infinite; or two equations may contradict each other, in which case it is empty. Uniqueness depends on the rank of the coefficient array, which equals n only when the equations are genuinely independent.

Does the order in which I write the equations matter?

Not to the solution set. Reordering the equations reindexes the rows but changes nothing about which tuples satisfy them all, which is why swapping two equations is one of the permitted operations for simplifying a system. The ordering of the unknowns is an entirely different matter and must be held fixed.

Why does the definition use complex numbers when my data is real?

Because the real numbers are contained in the complex numbers, so a real system is a special case and nothing is lost. The generality earns its keep later: real matrices can have complex eigenvalues, and inner products in the complex setting require conjugation. Fixing the scalar system at the widest useful setting once means no later theorem needs a real-only exception.

How do I record an unknown that does not appear in an equation?

As a coefficient of zero, written explicitly. In x1+2x2+x4=7 with four unknowns, a13=0. Keeping the zero preserves the rectangular shape of the coefficient array, which every matrix method depends on. Sparse storage may omit the zero physically, but the logical model still contains it.

Can a linear system have exactly two solutions?

No. A linear system's solution set is empty, a single point, or infinite — never a finite collection of two or more. If two distinct tuples both satisfy every equation, so does every tuple on the line joining them. A pair of isolated solutions, such as the two intersections of a line with a circle, can only arise from a nonlinear system.

References

  1. Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section SSLE, Definition SLE. 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. Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013.
  4. Higham, N. J. Accuracy and Stability of Numerical Algorithms, 2nd edition. Society for Industrial and Applied Mathematics, 2002.
  5. Boisvert, R. F., Pozo, R. and Remington, K. The Matrix Market Exchange Formats: Initial Design. National Institute of Standards and Technology, NISTIR 5935, 1996.

AI Suggested Questions

  • Assemble the coefficient array for a five-node resistive network and show me exactly which entries are zero and why.
  • Give me a system with four equations and four unknowns whose solution set is infinite, and explain which equation is redundant.
  • How should I choose a residual tolerance when verifying a solution computed in binary64 for a system with coefficients spanning six orders of magnitude?
  • Show me two systems that look completely different but have identical solution sets, and explain what makes them equivalent.
  • Why can a system of two linear equations in two unknowns never have exactly three solutions?
  • Walk me through converting an over-determined measurement system into the square system of normal equations, keeping the aij notation throughout.

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