Mathematics

Linear Equations Solver

Solve 2×2–6×6 systems Ax = b with partial pivoting, RREF, free-variable form, determinant, and optional inverse.

Ax = b solver

Gaussian elimination with partial pivoting · RREF · up to 6×6

a1a2a3b
=
=
=

Result

Unique solution

size 3×3 · rank 3 · det(A) ≈ -1

x1 = 2

x2 = 3

x3 = -1

Residual ‖Ax − b‖∞ ≈ 0

Elimination steps

Augmented matrix (3×4):
[ 2  1  -1 | 8 ]
[ -3  -1  2 | -11 ]
[ -2  1  2 | -3 ]
Swap R1 ↔ R2 (partial pivoting)
R1 ← R1 / -3
R2 ← R2 − (2)·R1
R3 ← R3 − (-2)·R1
Swap R2 ↔ R3 (partial pivoting)
R2 ← R2 / 1.66667
R1 ← R1 − (0.333333)·R2
R3 ← R3 − (0.333333)·R2
R3 ← R3 / 0.2
R1 ← R1 − (-0.8)·R3
R2 ← R2 − (0.4)·R3
Reduced row-echelon form (RREF):
[ 1  0  0 | 2 ]
[ 0  1  0 | 3 ]
[ 0  0  1 | -1 ]
Back-substitution from RREF complete (unique solution).
det(A) ≈ -1

What is the Linear Equations Solver?

A system of linear equations is a collection of equations that are linear—each variable appears only to the first power, with no products like xy or x²—in all unknowns. A 2×2 system has two equations in two unknowns; a 3×3 system has three equations in three unknowns. The solution, if one exists, is the point (or set of points) that simultaneously satisfies every equation in the system. Geometrically, each linear equation in two variables represents a line, and the solution is their intersection.

Linear systems are among the most widely applied mathematical models in science and engineering. Kirchhoff's circuit laws produce linear systems for unknown currents. Structural analysis in civil engineering, least-squares fitting in statistics, and chemical equilibrium mass balance all reduce to solving Ax = b. In computer graphics, solving linear systems determines lighting, transformations, and mesh deformations. Mastery of linear equation solving is prerequisite for linear algebra, numerical methods, and optimization.

Gaussian elimination is the standard algorithm taught in algebra and linear algebra courses. It transforms the augmented matrix of the system through elementary row operations—swapping rows, multiplying a row by a nonzero scalar, adding a multiple of one row to another—into row echelon form and then reduced row echelon form. Back substitution then yields the solution. The method is systematic, works for any size system, and reveals when no solution or infinitely many solutions exist.

A system may have a unique solution (lines intersect at one point), no solution (parallel lines, inconsistent system), or infinitely many solutions (coincident lines or planes). The determinant of the coefficient matrix for a square system signals uniqueness: a nonzero determinant guarantees a unique solution. Singular systems with zero determinant require further analysis to describe the solution set.

The Linear Equations Solver on Online Science Tools accepts systems from 2×2 up to 6×6, runs Gaussian elimination with partial pivoting to RREF, reports rank and det(A), writes free-variable parametric solutions when the system is underdetermined, and can form A⁻¹ when the solution is unique. Use it to verify homework, explore singular cases, and connect algebraic solutions to graphs on the 2D Graphing Calculator for 2×2 geometry.

  • A linear equation in n variables has the form a₁x₁ + a₂x₂ + … + aₙxₙ = b
  • Gaussian elimination uses row operations to reach upper triangular form
  • Consistent systems have at least one solution; inconsistent systems have none
  • The determinant (for square systems) equals zero when the system is singular

Mathematical / chemical formulas

Linear systems are compactly written as Ax = b. Gaussian elimination row-reduces the augmented matrix [A | b] to solve for x.

General form (n equations, n unknowns):
  a₁₁x₁ + a₁₂x₂ + … + a₁ₙxₙ = b₁
  a₂₁x₁ + a₂₂x₂ + … + a₂ₙxₙ = b₂
  ⋮
  aₙ₁x₁ + aₙ₂x₂ + … + aₙₙxₙ = bₙ

Matrix form:
  A x = b

2×2 Cramer's rule (when det A ≠ 0):
  x = det(A_x) / det(A)
  y = det(A_y) / det(A)

where A_x replaces column 1 of A with b, A_y replaces column 2.

Determinant (2×2):
  det | a  b | = ad − bc
      | c  d |

Row operations (preserves solution set):
  Rᵢ ↔ Rⱼ
  Rᵢ ← c·Rᵢ        (c ≠ 0)
  Rᵢ ← Rᵢ + k·Rⱼ
  • Reduced row echelon form has leading 1s (pivots) with zeros above and below each pivot.
  • Free variables appear when a column lacks a pivot, leading to infinitely many solutions.
  • For large systems, iterative methods replace direct elimination, but Gaussian elimination is exact for small systems.

Step-by-step example: Solving a 2×2 System by Elimination

Solve the system: 2x + 3y = 8 and x − y = 1. Verify the solution by substitution.

  1. Write the augmented matrix: [2 3 | 8] / [1 −1 | 1].
  2. Swap rows for convenience (optional): [1 −1 | 1] / [2 3 | 8].
  3. Eliminate x from row 2: R₂ ← R₂ − 2R₁ → [1 −1 | 1] / [0 5 | 6].
  4. Back substitute: 5y = 6, so y = 6/5 = 1.2.
  5. Substitute y into row 1: x − 1.2 = 1, so x = 2.2.
  6. Verify in both equations: 2(2.2) + 3(1.2) = 4.4 + 3.6 = 8 ✓. 2.2 − 1.2 = 1 ✓.
  7. Geometric interpretation: the lines 2x + 3y = 8 and x − y = 1 intersect at (2.2, 1.2).

Enter the coefficients 2, 3, 8 and 1, −1, 1 into the Linear Equations Solver on Online Science Tools. The tool performs Gaussian elimination and should report x = 2.2 and y = 1.2. Review the step summary to compare each row operation with your manual work. Plot y = (8 − 2x)/3 and y = x − 1 on the 2D Graphing Calculator to confirm the intersection visually at (2.2, 1.2).

Frequently asked questions

What does it mean when the solver reports no solution?

An inconsistent system arises when the equations represent parallel lines (2D) or parallel planes (3D) that never intersect. During Gaussian elimination, you encounter a row of the form [0 0 … 0 | c] where c is nonzero, meaning 0 = c, which is impossible. This often indicates a modeling error—conflicting constraints—or a special case where coefficients must be adjusted.

How do I handle infinitely many solutions?

When Gaussian elimination produces a row of zeros (0 = 0) and fewer pivots than variables, free variables exist. Express the pivot variables in terms of the free variables to describe the full solution set. Geometrically, two identical equations represent the same line, giving infinitely many intersection points. The Linear Equations Solver identifies this case and reports the parametric solution when applicable.

Is Cramer's rule or Gaussian elimination better?

Cramer's rule is elegant for 2×2 and 3×3 systems and useful for theoretical work involving determinants, but it requires computing multiple determinants and does not scale efficiently. Gaussian elimination is the standard computational method for any size system and directly reveals consistency and rank. The Linear Equations Solver uses Gaussian elimination because it handles all cases uniformly and provides step-by-step output for learning.

Can I use the Linear Equations Solver for 3×3 systems?

Yes. Enter three equations with three unknowns and the solver row-reduces the 3×3 augmented matrix. The process involves more row operations than a 2×2 case, but the logic is identical: eliminate variables column by column, then back substitute. Review each elimination step in the summary to follow the algorithm for exam preparation.

How do linear systems connect to the Phase Portrait Generator?

Near an equilibrium of a nonlinear dynamical system, linearization produces a linear system whose Jacobian matrix plays the role of A. Solving or analyzing this linear system (via eigenvalues) determines local stability. The Linear Equations Solver handles the algebraic side; the Phase Portrait Generator visualizes the resulting trajectory behavior. Together they connect computation and geometry in differential equations.

Keep learning with more calculators and study guides on Online Science Tools.

Practice problems & worked examples

Practice alongside the linear equations solver above. Each problem includes a full worked solution so you can check your reasoning step by step.

Practice problem 1

4×4 unique system

Solve the 4×4 system with rows [1,2,0,1|4], [0,1,1,0|2], [2,0,1,1|5], [1,1,1,1|4] using the Linear Equations Solver preset.

Show solution

Worked solution

  1. Load the 4×4 unique preset (or enter the matrix).
  2. RREF yields a unique solution; check residual near zero.

Answer: Unique solution (verify with the 4×4 preset)

Practice problem 2

Free variable case

For a system whose second row is a multiple of the first, what does the solver report?

Show solution

Worked solution

  1. Rank < n → free variable(s).
  2. Solution is written as particular + parameters tᵢ.

Answer: Infinitely many solutions (parametric form)

Practice problem 3

Determinant check

If det(A) = 0 for a square system, can there still be solutions?

Show solution

Worked solution

  1. det(A) = 0 means A is singular: either none or infinitely many solutions.
  2. Use RREF / rank to distinguish contradiction vs free variables.

Answer: Yes — either none or infinitely many (never a unique solution)

Related tools