Linear Algebra

Solve a Linear System (Ax = b)

Enter the coefficient matrix A and the right-hand side vector b. The calculator builds the augmented matrix [A | b], reduces it with Gauss-Jordan elimination, and reports a unique solution, no solution, or infinitely many solutions with a parametric form.

Solve a Linear System (Ax = b)

Gauss-Jordan on the augmented matrix — unique, infinite or no solution.

Try:
Answerx1 = 1, x2 = 3
  1. SystemA is 2×2, b has 2 entries.
  2. Matrix A[[2, 1], [1, 3]]
  3. Vector b(5, 10)
  4. Augmented [A | b][[2, 1, 5], [1, 3, 10]]
  5. Row operationsR1 → (1/2)·R1; R2 → R2 − (1)·R1; R2 → (1/2.5)·R2; R1 → R1 − (0.5)·R2
  6. RREF of [A | b][[1, 0, 1], [0, 1, 3]]
  7. ConclusionUnique solution — pivot in every variable column.
  8. Solutionx1 = 1, x2 = 3

The method that distinguishes the degenerate cases

A system of linear equations has one of exactly three outcomes: a single solution, none at all, or an infinite family. Determinant methods answer the first case cleanly and give up on the other two, reporting only that no unique solution exists.

This solver classifies all three. It builds the augmented matrix, reduces it, and reads off which case applies — including a parametric description of the family when there are infinitely many.

Knowing there is no unique solution is often not enough. An inconsistent system means the constraints contradict each other and the model is wrong; an underdetermined one means the constraints are satisfiable but insufficient, and the answer is a family that may be perfectly usable. Those are different diagnoses requiring different responses.

Row reduction separates them because the reduced matrix carries the evidence directly. A contradiction appears as a specific recognisable row, and an infinite family appears as columns without pivots. Neither is inferred — both are read.

How to use this calculator

  1. Enter the coefficient matrix Commas between entries, semicolons between rows. Each row is one equation and each column one unknown; a missing variable is a zero.
  2. Enter the right-hand side Comma-separated, one value per equation. It must have as many entries as the matrix has rows, and a mismatch is reported with both counts.
  3. Read the augmented matrix and the row operations The two inputs are joined into one wider matrix, and every operation applied to it is listed.
  4. Read the conclusion line It names which of the three cases applies before the solution itself, so the shape of the answer is known in advance.

How the system is solved and classified

The right-hand side is appended to the coefficient matrix as one extra column, and the combined matrix is reduced to reduced row echelon form. Every row operation acts across the full width, so the constants are transformed alongside the coefficients and the system the matrix represents never changes.

Inconsistency is then detected by looking for a row whose coefficient part is entirely zero while its constant is not. Such a row asserts that zero equals something non-zero, which no assignment of the unknowns can satisfy, so the system has no solution and the search stops there.

Otherwise the pivot columns are counted, ignoring any pivot in the constant column. When every variable column holds a pivot the solution is unique, and each variable's value is read straight from the constant column of its own row — no back-substitution is needed, because the reduction already cleared above the pivots as well as below.

When some variable columns have no pivot, those variables are free and the system has infinitely many solutions. Each pivot variable is then expressed in terms of the free ones by moving their coefficients across and negating them, which gives the parametric form reported alongside the count of free variables.

What each input means

A Coefficient matrix — form field “Coefficient matrix A (rows separated by ;)”
One row per equation, one column per unknown. Any shape is accepted — the system need not have as many equations as variables.
b Right-hand side — form field “Right-hand side b (comma-separated)”
One constant per equation, comma-separated. Its length must match the number of rows.
[A | b] Augmented matrix
The two joined into one. Reducing it is what solves the system, since row operations preserve the solution set.
free variables Free variables
Variable columns without a pivot. Their count is the number of parameters in an infinite solution family.

Worked examples

Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.

A unique solution

Two equations in two unknowns whose coefficients are independent, so exactly one assignment satisfies both.

Inputs Coefficient matrix A (rows separated by ;) = 2, 1; 1, 3, Right-hand side b (comma-separated) = 5, 10

  1. System A is 2×2, b has 2 entries.
  2. Matrix A [[2, 1], [1, 3]]
  3. Vector b (5, 10)
  4. Augmented [A | b] [[2, 1, 5], [1, 3, 10]]
  5. Row operations R1 → (1/2)·R1; R2 → R2 − (1)·R1; R2 → (1/2.5)·R2; R1 → R1 − (0.5)·R2
  6. RREF of [A | b] [[1, 0, 1], [0, 1, 3]]
  7. Conclusion Unique solution — pivot in every variable column.
  8. Solution x1 = 1, x2 = 3

Result x1 = 1, x2 = 3

The coefficient columns both receive pivots, which is what makes the solution unique. The values are read directly from the final column with no substitution, because the reduction cleared above every pivot as well as below.

A pivot in every variable column is the precise condition for uniqueness, and it is equivalent to the coefficient matrix being invertible — the same fact a non-zero determinant reports.

An inconsistent system

Two equations with identical coefficients but different constants, which cannot both hold.

Inputs Coefficient matrix A (rows separated by ;) = 1, 1; 1, 1, Right-hand side b (comma-separated) = 1, 2

  1. System A is 2×2, b has 2 entries.
  2. Matrix A [[1, 1], [1, 1]]
  3. Vector b (1, 2)
  4. Augmented [A | b] [[1, 1, 1], [1, 1, 2]]
  5. Row operations R2 → R2 − (1)·R1; R1 → R1 − (1)·R2
  6. RREF of [A | b] [[1, 1, 0], [0, 0, 1]]
  7. Conclusion A row reduces to [0 … 0 | c] with c ≠ 0 — the system has no solution.

Result No solution (system is inconsistent)

Reduction produces a row whose coefficients are all zero and whose constant is not, asserting that zero equals a non-zero number. That is the signature of an inconsistent system and it is reported explicitly.

A determinant method would report only that no unique solution exists here. The reduced matrix says more: the constraints genuinely contradict each other, so no amount of relaxing the variables can help.

Infinitely many solutions

Two equations that are multiples of one another in both coefficients and constants, so one adds no information.

Inputs Coefficient matrix A (rows separated by ;) = 1, 1; 2, 2, Right-hand side b (comma-separated) = 3, 6

  1. System A is 2×2, b has 2 entries.
  2. Matrix A [[1, 1], [2, 2]]
  3. Vector b (3, 6)
  4. Augmented [A | b] [[1, 1, 3], [2, 2, 6]]
  5. Row operations Swap R1 ↔ R2; R1 → (1/2)·R1; R2 → R2 − (1)·R1
  6. RREF of [A | b] [[1, 1, 3], [0, 0, 0]]
  7. Conclusion Infinitely many solutions — 1 free variable: x2.
  8. Parametric form x1 = 3 − x2, x2 = x2 (free)

Result x1 = 3 − x2, x2 = x2 (free)

The second row reduces entirely to zeros, coefficients and constant alike, leaving one pivot for two variables. The variable without a pivot is free, and the other is expressed in terms of it.

This is the case a determinant method conflates with the previous one. Both have a zero determinant; only this one has solutions, and the parametric form describes all of them.

Reading the result

The three outcomes and their signatures

A pivot in every variable column means one solution. A zero row with a non-zero constant means none. Neither of those, and the variables without pivots are free — one parameter each.

Reading the parametric form

Each pivot variable is given as a constant plus multiples of the free ones. Choosing any values for the free variables and substituting produces a genuine solution, and every solution arises exactly once that way.

More equations than unknowns is not the same as no solution

An overdetermined system is often inconsistent, but not necessarily — redundant equations that agree with each other are perfectly fine. Only the reduced matrix settles it.

When you would use this

Diagnosing a model that will not solve

When a system refuses to yield an answer, the distinction between contradictory and insufficient constraints determines what to do next: fix the data, or gather more of it.

Describing a family of solutions

Where the constraints are genuinely insufficient, the parametric form is the answer rather than a failure. It says exactly which combinations satisfy every equation.

Assumptions and limitations

What this calculator assumes

  • Row operations preserve the solution set, so the reduced system is equivalent to the original.
  • The number of constants matches the number of equations.
  • Comparisons against zero use a small numerical tolerance rather than exact equality.
  • Any rectangular shape is accepted; the system need not be square.

Where it stops being the right tool

  • Entries are shown as decimals rather than exact fractions, so a solution of one third appears rounded.
  • No least-squares approximation is offered for an inconsistent system.
  • A basis for the null space is not reported separately from the parametric form.
  • Coefficients are entered as a matrix rather than parsed from typed equations.

Common mistakes

Treating no unique solution as no solution

Why it happens. The phrases are close, and determinant methods return the same message for both. An infinite family is a genuine answer, not a failure.

How to avoid it. Read the conclusion line, which names the case. If free variables are reported, solutions exist and the parametric form describes them.

Omitting a zero coefficient

Why it happens. An equation missing a variable seems to have one fewer entry, so the row comes out short and the columns no longer align with the unknowns.

How to avoid it. Write a zero for every absent variable. Each row must have exactly as many entries as there are unknowns.

Assuming a square system always has one solution

Why it happens. Equal counts of equations and unknowns is the well-behaved case in most examples, so it comes to feel like a guarantee.

How to avoid it. Check the pivot count rather than the shape. A square system with dependent rows has fewer pivots than columns and no unique solution.

Frequently asked questions

How does the calculator detect no solution?

By looking for a row in the reduced matrix whose coefficient entries are all zero while its constant is not. Such a row states that zero equals a non-zero number, which no values of the unknowns can satisfy.

When are there infinitely many solutions?

When the system is consistent but some variable columns have no pivot. Those variables are free to take any value, and the pivot variables adjust to match — giving one parameter per free variable.

Does this require a square matrix?

No. Any shape works, so systems with more equations than unknowns or fewer are both handled. What decides the outcome is the number of pivots relative to the number of variables, not the shape.

How does this differ from Cramer's rule?

Cramer's rule gives a closed form for the unique case and stops at a zero determinant without saying which degenerate case applies. Row reduction distinguishes an inconsistent system from an underdetermined one and produces the parametric family for the latter.