Skip to content

Chapter 5. Systems of Linear Equations

A system of linear equations is a collection of linear equations imposed on the same unknowns. The purpose of solving the system is to find all assignments of the unknowns that satisfy every equation at once.

Systems are the first major computational object in linear algebra. They connect equations, matrices, geometry, algorithms, and abstract structure. The standard method is to write the system as an augmented matrix, use elementary row operations, reduce it to echelon form or reduced echelon form, and then read off the solutions. A system is inconsistent exactly when row reduction produces a contradictory row of the form 0=b0=b, where b0b\ne 0.

5.1 General Form

A system of mm linear equations in nn unknowns has the form

a11x1+a12x2++a1nxn=b1,a21x1+a22x2++a2nxn=b2,am1x1+am2x2++amnxn=bm. \begin{aligned} a_{11}x_1+a_{12}x_2+\cdots+a_{1n}x_n &= b_1,\\ a_{21}x_1+a_{22}x_2+\cdots+a_{2n}x_n &= b_2,\\ &\vdots\\ a_{m1}x_1+a_{m2}x_2+\cdots+a_{mn}x_n &= b_m. \end{aligned}

The unknowns are

x1,x2,,xn. x_1,x_2,\ldots,x_n.

The coefficients are the scalars

aij. a_{ij}.

The right-hand side entries are

b1,b2,,bm. b_1,b_2,\ldots,b_m.

The first index of aija_{ij} records the equation. The second index records the unknown. Thus a23a_{23} is the coefficient of x3x_3 in the second equation.

5.2 Matrix Form

The same system can be written as

Ax=b, Ax=b,

where

A=[a11a12a1na21a22a2nam1am2amn],x=[x1x2xn],b=[b1b2bm]. A= \begin{bmatrix} a_{11}&a_{12}&\cdots&a_{1n}\\ a_{21}&a_{22}&\cdots&a_{2n}\\ \vdots&\vdots&\ddots&\vdots\\ a_{m1}&a_{m2}&\cdots&a_{mn} \end{bmatrix}, \qquad x= \begin{bmatrix} x_1\\ x_2\\ \vdots\\ x_n \end{bmatrix}, \qquad b= \begin{bmatrix} b_1\\ b_2\\ \vdots\\ b_m \end{bmatrix}.

This notation is compact, but it also carries meaning.

The matrix AA represents the coefficients. The vector xx represents the unknowns. The vector bb represents the required output. Solving Ax=bAx=b means finding every vector xx that is mapped by AA to bb.

5.3 Augmented Matrix

The augmented matrix of the system Ax=bAx=b is

[Ab]. [A\mid b].

Explicitly,

[a11a12a1nb1a21a22a2nb2am1am2amnbm]. \left[ \begin{array}{cccc|c} a_{11}&a_{12}&\cdots&a_{1n}&b_1\\ a_{21}&a_{22}&\cdots&a_{2n}&b_2\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ a_{m1}&a_{m2}&\cdots&a_{mn}&b_m \end{array} \right].

The vertical bar separates the coefficient columns from the right-hand side column. Row operations are performed on the whole augmented matrix because each row represents one equation.

For example, the system

x+2yz=3,2xy+4z=1 \begin{aligned} x+2y-z&=3,\\ 2x-y+4z&=1 \end{aligned}

has augmented matrix

[12132141]. \left[ \begin{array}{ccc|c} 1&2&-1&3\\ 2&-1&4&1 \end{array} \right].

5.4 Solutions of a System

A solution of a system is a vector xx that satisfies every equation.

For example, consider

x+y=5,2xy=1. \begin{aligned} x+y&=5,\\ 2x-y&=1. \end{aligned}

The vector

[23] \begin{bmatrix} 2\\ 3 \end{bmatrix}

is a solution because

2+3=5 2+3=5

and

2(2)3=1. 2(2)-3=1.

A vector that satisfies only one equation is not a solution of the system. A solution must satisfy all equations simultaneously.

The solution set of a system is

{xFn:Ax=b}. \{x\in F^n: Ax=b\}.

This set may be empty, contain exactly one vector, or contain infinitely many vectors.

5.5 Consistency

A system is consistent if it has at least one solution.

A system is inconsistent if it has no solution.

For example,

x+y=1,x+y=3 \begin{aligned} x+y&=1,\\ x+y&=3 \end{aligned}

is inconsistent, because no pair (x,y)(x,y) can make both equations true.

In augmented matrix form,

[111113]. \left[ \begin{array}{cc|c} 1&1&1\\ 1&1&3 \end{array} \right].

Subtracting the first row from the second gives

[111002]. \left[ \begin{array}{cc|c} 1&1&1\\ 0&0&2 \end{array} \right].

The second row represents

0x+0y=2, 0x+0y=2,

or simply

0=2. 0=2.

This contradiction proves that the system is inconsistent.

5.6 Equivalent Systems

Two systems are equivalent if they have the same solution set.

Elementary row operations produce equivalent systems. The three operations are:

OperationMeaning
Row interchangeSwap two equations
Row scalingMultiply one equation by a nonzero scalar
Row replacementAdd a multiple of one equation to another

These operations preserve the set of solutions. They do not change the constraints; they only rewrite them.

For example, from

x+y=5,2xy=1 \begin{aligned} x+y&=5,\\ 2x-y&=1 \end{aligned}

we may replace the second equation by the sum of both equations:

3x=6. 3x=6.

The system becomes

x+y=5,3x=6. \begin{aligned} x+y&=5,\\ 3x&=6. \end{aligned}

The new system has the same solution as the old system.

5.7 Echelon Form

A matrix is in row echelon form when its nonzero rows appear above its zero rows, each leading entry is to the right of the leading entry in the row above it, and all entries below a leading entry are zero. These conditions are the usual structural conditions used in row reduction.

For example,

[121301450026] \left[ \begin{array}{ccc|c} 1&2&-1&3\\ 0&1&4&5\\ 0&0&2&6 \end{array} \right]

is in echelon form.

Its triangular shape allows the unknowns to be found by back substitution. The last equation determines the last leading unknown. The previous equation then determines the previous leading unknown, and so on.

5.8 Reduced Echelon Form

A matrix is in reduced row echelon form when it is in echelon form, each leading entry is 11, and each leading 11 is the only nonzero entry in its column. In this form, the solution can be read directly from the augmented matrix.

For example,

[102301140000] \left[ \begin{array}{ccc|c} 1&0&2&3\\ 0&1&-1&4\\ 0&0&0&0 \end{array} \right]

is in reduced echelon form.

It corresponds to

x1+2x3=3, x_1+2x_3=3, x2x3=4. x_2-x_3=4.

The variable x3x_3 is free. If x3=tx_3=t, then

x1=32t,x2=4+t. x_1=3-2t, \qquad x_2=4+t.

Thus

x=[32t4+tt]. x= \begin{bmatrix} 3-2t\\ 4+t\\ t \end{bmatrix}.

5.9 Pivots

A pivot is a leading entry used to solve for a leading variable.

In an echelon form, each nonzero row has a pivot. The column containing a pivot is called a pivot column. A variable corresponding to a pivot column is a leading variable. A variable corresponding to a nonpivot column is a free variable.

For example,

[103020110500017] \left[ \begin{array}{cccc|c} 1&0&3&0&2\\ 0&1&-1&0&5\\ 0&0&0&1&7 \end{array} \right]

has pivot columns 11, 22, and 44. Therefore x1x_1, x2x_2, and x4x_4 are leading variables. The variable x3x_3 is free.

Pivots are the algebraic markers of constraint. Free variables are the algebraic markers of freedom.

5.10 Gaussian Elimination

Gaussian elimination is the process of using elementary row operations to put an augmented matrix into echelon form, then solving by back substitution. Row reduction to echelon form followed by back substitution is the standard elimination method for solving systems.

Consider

x+y+z=6,2xy+z=3,x+2yz=2. \begin{aligned} x+y+z&=6,\\ 2x-y+z&=3,\\ x+2y-z&=2. \end{aligned}

The augmented matrix is

[111621131212]. \left[ \begin{array}{ccc|c} 1&1&1&6\\ 2&-1&1&3\\ 1&2&-1&2 \end{array} \right].

Replace R2R_2 by R22R1R_2-2R_1, and replace R3R_3 by R3R1R_3-R_1:

[111603190124]. \left[ \begin{array}{ccc|c} 1&1&1&6\\ 0&-3&-1&-9\\ 0&1&-2&-4 \end{array} \right].

Interchange R2R_2 and R3R_3:

[111601240319]. \left[ \begin{array}{ccc|c} 1&1&1&6\\ 0&1&-2&-4\\ 0&-3&-1&-9 \end{array} \right].

Replace R3R_3 by R3+3R2R_3+3R_2:

[1116012400721]. \left[ \begin{array}{ccc|c} 1&1&1&6\\ 0&1&-2&-4\\ 0&0&-7&-21 \end{array} \right].

The last row gives

7z=21, -7z=-21,

so

z=3. z=3.

The second row gives

y2z=4, y-2z=-4,

so

y6=4, y-6=-4,

and therefore

y=2. y=2.

The first row gives

x+y+z=6, x+y+z=6,

so

x+2+3=6, x+2+3=6,

and therefore

x=1. x=1.

The solution is

[123]. \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix}.

5.11 Gauss-Jordan Elimination

Gauss-Jordan elimination continues row reduction until the augmented matrix is in reduced row echelon form.

Using the previous echelon matrix,

[1116012400721], \left[ \begin{array}{ccc|c} 1&1&1&6\\ 0&1&-2&-4\\ 0&0&-7&-21 \end{array} \right],

scale the third row by 1/7-1/7:

[111601240013]. \left[ \begin{array}{ccc|c} 1&1&1&6\\ 0&1&-2&-4\\ 0&0&1&3 \end{array} \right].

Eliminate the entries above the pivot in column 33:

[110301020013]. \left[ \begin{array}{ccc|c} 1&1&0&3\\ 0&1&0&2\\ 0&0&1&3 \end{array} \right].

Eliminate the entry above the pivot in column 22:

[100101020013]. \left[ \begin{array}{ccc|c} 1&0&0&1\\ 0&1&0&2\\ 0&0&1&3 \end{array} \right].

The solution is read directly:

x=1,y=2,z=3. x=1,\qquad y=2,\qquad z=3.

5.12 Free Variables

Free variables appear when some columns have no pivot.

Consider

[12140013]. \left[ \begin{array}{ccc|c} 1&2&-1&4\\ 0&0&1&3 \end{array} \right].

The pivot columns are 11 and 33. The variable x2x_2 is free.

The equations are

x1+2x2x3=4, x_1+2x_2-x_3=4, x3=3. x_3=3.

Let

x2=t. x_2=t.

Then

x3=3, x_3=3,

and

x1+2t3=4. x_1+2t-3=4.

Thus

x1=72t. x_1=7-2t.

The solution set is

{[72tt3]:tR}. \left\{ \begin{bmatrix} 7-2t\\ t\\ 3 \end{bmatrix} :t\in\mathbb{R} \right\}.

A free variable produces infinitely many solutions whenever the system is consistent.

5.13 Homogeneous Systems

A homogeneous system has the form

Ax=0. Ax=0.

Every homogeneous system is consistent, because the zero vector always satisfies it:

A0=0. A0=0.

This solution is called the trivial solution.

A homogeneous system has either exactly one solution or infinitely many solutions. It has exactly one solution when the trivial solution is the only solution. It has infinitely many solutions when there is at least one nonzero solution.

If a homogeneous system has nn unknowns and its reduced echelon form has rr nonzero rows, then it has nrn-r free variables.

5.14 Nonhomogeneous Systems

A nonhomogeneous system has the form

Ax=b,b0. Ax=b, \qquad b\ne 0.

Its solution set, when nonempty, is a translate of the solution set of the associated homogeneous system

Ax=0. Ax=0.

Suppose pp is one particular solution of

Ax=b. Ax=b.

Then any other solution xx satisfies

A(xp)=AxAp=bb=0. A(x-p)=Ax-Ap=b-b=0.

Therefore

xp x-p

belongs to the null space of AA. Hence every solution has the form

x=p+v,v{z:Az=0}. x=p+v, \qquad v\in\{z:Az=0\}.

This structure is one of the central facts of linear systems.

5.15 Three Possible Outcomes

A linear system has exactly one of three possible solution types:

OutcomeAlgebraic conditionGeometric meaning
No solutionContradictory row appearsEmpty intersection
One solutionPivot in every variable column and no contradictionSingle intersection point
Infinitely many solutionsAt least one free variable and no contradictionAffine line, plane, or higher-dimensional set

There is no fourth case. In particular, a linear system cannot have exactly two distinct solutions.

The reason is linearity. If two distinct solutions exist, their difference gives a nonzero solution of the associated homogeneous system. That nonzero direction can be scaled, giving infinitely many solutions.

5.16 Underdetermined and Overdetermined Systems

A system with fewer equations than unknowns is called underdetermined. Such a system often has free variables, though it may also be inconsistent.

A system with more equations than unknowns is called overdetermined. Such a system often has no solution, though it may be consistent if some equations are redundant or compatible.

For example,

x+y=1 x+y=1

is underdetermined in two unknowns and has infinitely many solutions.

The system

x+y=1,xy=0,2x+3y=5 \begin{aligned} x+y&=1,\\ x-y&=0,\\ 2x+3y&=5 \end{aligned}

is overdetermined. It may or may not be consistent. The number of equations alone does not determine the solution type. The arrangement of the equations matters.

5.17 Geometry of Systems

Each equation in a system defines a geometric constraint.

In R2\mathbb{R}^2, each nonzero linear equation defines a line. A system of two equations asks where two lines intersect. The possibilities are:

GeometrySolution type
Intersecting linesOne solution
Parallel distinct linesNo solution
Same lineInfinitely many solutions

In R3\mathbb{R}^3, each nonzero linear equation defines a plane. Several planes may intersect in a point, a line, a plane, or not at all.

In Rn\mathbb{R}^n, each equation defines a hyperplane. A system describes the intersection of hyperplanes.

5.18 Row Space View

Each row of AA is the coefficient vector of one equation.

The equation

aix=bi a_i\cdot x=b_i

uses the ii-th row aia_i of AA. Thus a system can be viewed as a collection of dot product constraints:

a1x=b1, a_1\cdot x=b_1, a2x=b2, a_2\cdot x=b_2, \vdots amx=bm. a_m\cdot x=b_m.

This view is useful because it connects systems with geometry. Each row vector is normal to a hyperplane.

5.19 Column Space View

The matrix equation

Ax=b Ax=b

can also be read by columns.

If

A=[a1a2an], A= \begin{bmatrix} |&|&&|\\ a_1&a_2&\cdots&a_n\\ |&|&&| \end{bmatrix},

then

Ax=x1a1+x2a2++xnan. Ax=x_1a_1+x_2a_2+\cdots+x_na_n.

Thus Ax=bAx=b asks whether bb can be written as a linear combination of the columns of AA.

The system is consistent precisely when bb lies in the span of the columns of AA. In later chapters this span is called the column space of AA.

5.20 Example with Infinitely Many Solutions

Consider

x+y+z=4,2x+2y+2z=8. \begin{aligned} x+y+z&=4,\\ 2x+2y+2z&=8. \end{aligned}

The second equation is twice the first, so it adds no new constraint.

The augmented matrix is

[11142228]. \left[ \begin{array}{ccc|c} 1&1&1&4\\ 2&2&2&8 \end{array} \right].

Replace R2R_2 by R22R1R_2-2R_1:

[11140000]. \left[ \begin{array}{ccc|c} 1&1&1&4\\ 0&0&0&0 \end{array} \right].

The equation is

x+y+z=4. x+y+z=4.

Let

y=s,z=t. y=s, \qquad z=t.

Then

x=4st. x=4-s-t.

The solution set is

{[4stst]:s,tR}. \left\{ \begin{bmatrix} 4-s-t\\ s\\ t \end{bmatrix} :s,t\in\mathbb{R} \right\}.

This is a plane in R3\mathbb{R}^3.

5.21 Example with No Solution

Consider

x+y+z=4,2x+2y+2z=9. \begin{aligned} x+y+z&=4,\\ 2x+2y+2z&=9. \end{aligned}

The augmented matrix is

[11142229]. \left[ \begin{array}{ccc|c} 1&1&1&4\\ 2&2&2&9 \end{array} \right].

Replace R2R_2 by R22R1R_2-2R_1:

[11140001]. \left[ \begin{array}{ccc|c} 1&1&1&4\\ 0&0&0&1 \end{array} \right].

The second row says

0=1. 0=1.

Therefore the system has no solution.

Geometrically, the two equations describe parallel planes in R3\mathbb{R}^3.

5.22 Example with One Solution

Consider

x+y+z=6,y+z=5,z=3. \begin{aligned} x+y+z&=6,\\ y+z&=5,\\ z&=3. \end{aligned}

This system is already triangular.

From the third equation,

z=3. z=3.

From the second equation,

y+3=5, y+3=5,

so

y=2. y=2.

From the first equation,

x+2+3=6, x+2+3=6,

so

x=1. x=1.

The unique solution is

[123]. \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix}.

The system has one pivot for each variable.

5.23 Algorithmic Summary

To solve a linear system:

StepAction
1Write the augmented matrix
2Use elementary row operations
3Obtain echelon form or reduced echelon form
4Check for contradiction
5Identify pivot variables and free variables
6Write the solution set

If a contradictory row appears, the system is inconsistent. If no contradiction appears and every variable column has a pivot, the solution is unique. If no contradiction appears and at least one variable column has no pivot, there are infinitely many solutions.

5.24 Summary

A system of linear equations is a set of simultaneous linear constraints. It is represented compactly by

Ax=b. Ax=b.

The augmented matrix

[Ab] [A\mid b]

contains all coefficients and right-hand side values. Elementary row operations replace the original system by equivalent systems. Row reduction exposes pivots, free variables, contradictions, and solution structure.

The essential classification is:

Row-reduction resultSolution type
Contradictory rowNo solution
Pivot in every variable column, no contradictionUnique solution
Free variable, no contradictionInfinitely many solutions

This classification is the computational foundation for rank, nullity, invertibility, column space, and linear transformations.