Linear System of Equations

A linear system of mm equations in nn unknowns x1,x2,…,xnx_1, x_2, \ldots, x_n is a set of equations of the form

a11x1+a12x2+⋯+a1nxn=b1a21x1+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}

where aij,bi∈Ra_{ij}, b_i \in \mathbb{R} for 1≤i≤m1 \le i \le m and 1≤j≤n1 \le j \le n.

In matrix form, Ax⃗=b⃗A\vec{x} = \vec{b}, where

A=(a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮am1am2⋯amn),x⃗=(x1x2⋮xn),b⃗=(b1b2⋮bm)A = \begin{pmatrix} 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{pmatrix}, \quad \vec{x} = \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix}, \quad \vec{b} = \begin{pmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{pmatrix}
Here:
AA
coefficient matrix
[A∣b⃗][A \mid \vec{b}]
augmented matrix

Ax⃗=b⃗A\vec{x} = \vec{b} has exactly one of 3 outcomes:

  • A unique solution.
  • Infinitely many solutions.
  • No solution.

Homogeneity

The system is homogeneous iff b⃗=0⃗\vec{b} = \vec{0}. Otherwise it’s non-homogeneous.

For a system Ax⃗=b⃗A\vec{x} = \vec{b}, the system Ax⃗=0⃗A\vec{x} = \vec{0} is its associated homogeneous system.

Equivalent Systems

Equivalent systems are the systems with the same set of solutions.

2 linear systems are equivalent iff one is obtained from the other by a finite number of elementary operations.

Applying elementary operations to the augmented matrix [A∣b⃗][A \mid \vec{b}] instead of the equations gives row equivalence (see Elementary Transformations).

Row-Equivalent Matrix

2 matrices are said to be row-equivalent iff one can be obtained from the other by a finite number of elementary row operations.

Methods

Numerical methods for solving linear systems split into 2 classes:

Direct

Yield the exact solution in a finite number of steps, ignoring round-off error. Cost is about 23n3\tfrac{2}{3}n^3 operations for a dense n×nn \times n matrix.

  • Gaussian elimination
    Reduces the system to echelon form, then back substitution.
  • LU decomposition
    Factors A=LUA = LU once, so each new b⃗\vec{b} needs only 2 triangular solves.
  • LUP decomposition
    Factors PA=LUPA = LU, adding row interchanges.
  • Cholesky decomposition
    Factors A=LLTA = LL^T for a symmetric positive definite AA, at about half the cost of LU.

Iterative

Start from a guess x⃗(0)\vec{x}^{(0)} and produce x⃗(1),x⃗(2),…\vec{x}^{(1)}, \vec{x}^{(2)}, \ldots until the residual ∥Ax⃗(k)−b⃗∥\|A\vec{x}^{(k)} - \vec{b}\| falls below a tolerance.

  • Cost per step is about n2n^2 operations, less for a sparse matrix.
  • Suits very large sparse matrices.
  • Convergence depends on properties of AA such as diagonal dominance.

Worked Example

Determine the number of solutions of each system.

(a){x+y=32x−y=0(b){x+y=32x+2y=6(c){x+y=32x+2y=7\text{(a)} \begin{cases} x + y = 3 \\ 2x - y = 0 \end{cases} \qquad \text{(b)} \begin{cases} x + y = 3 \\ 2x + 2y = 6 \end{cases} \qquad \text{(c)} \begin{cases} x + y = 3 \\ 2x + 2y = 7 \end{cases}
Solution Reveal Hide

System (a)

[1132−10]→R2−2R1[1130−3−6]\left[\begin{array}{cc|c} 1 & 1 & 3 \\ 2 & -1 & 0 \end{array}\right] \xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & -3 & -6 \end{array}\right]

Back substitution gives y=2y = 2 and x=1x = 1. A unique solution.

System (b)

[113226]→R2−2R1[113000]\left[\begin{array}{cc|c} 1 & 1 & 3 \\ 2 & 2 & 6 \end{array}\right] \xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & 0 & 0 \end{array}\right]

yy is free and x=3−yx = 3 - y. Infinitely many solutions.

System (c)

[113227]→R2−2R1[113001]\left[\begin{array}{cc|c} 1 & 1 & 3 \\ 2 & 2 & 7 \end{array}\right] \xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & 0 & 1 \end{array}\right]

The last row reads 0=10 = 1. No solution.

The associated homogeneous system of (a) is Ax⃗=0⃗A\vec{x} = \vec{0} with the same AA. It has only the solution x⃗=0⃗\vec{x} = \vec{0}, since AA reduces to the same triangular form.

Wolfram Mathematica notebook

The summary notebook defines every function used in this module, with documentation and no examples, as a starting point for your own problems.

Written by November 3, 2026 2 min read
Was this helpful?