Mathematics · Algebra

Linear system solver — 2×2 and 3×3

Solve a 2×2 or 3×3 linear system and distinguish unique, inconsistent and dependent systems using Gaussian elimination.

Created v1.0

By Thibaut Grzelak, Mechanical Analysis Engineer

Algebra
01

Calculation inputs

Enter the coefficients of x, y and z, then the right-hand side. Coefficients may be negative or zero.

System equations

A · (x ; y)ᵀ = b

03

Results

Solution state
Unique solution
Determinant of A
-2
Reduced augmented matrix
102
011

Results show up to four significant digits for readability; internal calculations retain full precision.

See calculation details

01Determinant of A

Formuladet A = a₁₁a₂₂ − a₁₂a₂₁
Substitution1 × (-1) − 1 × 1
Result
-2

02[A | b]

Formula[A | b]
Result
113
1-11

03L₂

FormulaL₂ ← L₂ − kL₁
SubstitutionL₂ ← L₂ − 1 × L₁
Result
113
0-2-2

04L₂

FormulaL₂ ← L₂ / pivot
SubstitutionL₂ ← L₂ / (-2)
Result
113
011

05L₁

FormulaL₁ ← L₁ − kL₂
SubstitutionL₁ ← L₁ − 1 × L₂
Result
102
011

06Solution state

Formularank(A) = rank([A | b]) = n
Substitution2 = 2
Result
Unique solution

07x

Formulax = b′₁
Substitution2
Result
2

08y

Formulay = b′₂
Substitution1
Result
1

09L₁(x)

Formulaa₁₁x + a₁₂y = b₁
Substitution1 × 2 + 1 × 1 ≈ 3
Result
3

10L₂(x)

Formulaa₂₁x + a₂₂y = b₂
Substitution1 × 2 + (-1) × 1 ≈ 1
Result
1

11Ax

FormulaAx = b
Substitution(2 ; 1)
Result
(3 ; 1)
01Formulas and symbols

Formulas used

x

Ax = b

rank(A) = rank([A|b]) = n

A: coefficient matrix; x: unknown vector; b: right-hand side; rank: number of independent pivots.

SymbolMeaning
AMatrix A
bRight-hand sides b
xSolution vector
det ADeterminant of A
[A|b]Reduced augmented matrix
02Validation example

Reference numerical case

  1. x + y = 3 and x − y = 1 give x = 2, y = 1 and determinant −2. Doubling the first equation gives infinitely many solutions if the right side is 6, and no solution if it is 7.
03How it works

Fill the coefficient cells beside x, y and z, then the right-hand side of each equation. Row scaling and partial pivoting reduce the augmented matrix; its ranks determine the solution state.

04Limits and conventions

Real square systems of size 2 or 3. Pivots below 64 times machine epsilon after row scaling are treated as numerical zero. Very ill-conditioned systems may be classified as dependent; this is not symbolic exact arithmetic.

05Common mistakes

Keep coefficient rows and right-hand-side values in the same order. A zero determinant does not distinguish no solution from infinitely many solutions.

06Practical questions

What does it mean when a linear system has no solution?

It means the equations are inconsistent: no vector satisfies all of them at the same time. In row-reduced form this appears as a contradictory row such as 0 = nonzero.

Why can a linear system have infinitely many solutions?

Infinitely many solutions occur when the equations are dependent and do not provide enough independent constraints to determine every unknown uniquely. One or more variables remain free.

07Technical references