Linear System Solver

Solve Ax = b for square systems up to 6×6 using Gaussian elimination with partial pivoting. Singular and inconsistent systems are detected and reported, with a residual check on every solution.

System

Enter the coefficient matrix A and the right-hand side vector b.

How it works

The solver performs Gaussian elimination with partial pivoting: at each step the largest available pivot is swapped into place, which keeps rounding error small. The same elimination yields the determinant and the rank, so a singular matrix is caught reliably instead of producing garbage. Every solution is followed by a residual check — the reported max |Ax − b| tells you how accurately the solution satisfies the system. Systems from discretised PDEs, circuit analysis, and least-squares normal equations are all fair game.

  1. Forward elimination with row swaps turns A into upper-triangular form.
  2. Back substitution reads off x₁ … xₙ.
  3. If a pivot is (numerically) zero, the rank is reported and the system is declared singular.

Frequently asked questions

What if my system has no unique solution?

The solver reports it instead of guessing: a singular coefficient matrix gives "no unique solution", and the determinant is shown so you can see why. Check the matrix calculator for the rank and null-space dimension.

What does the residual mean?

The maximum of |Ax − b| over all rows, using the computed solution. Values around 1e-12 or smaller mean the solution satisfies the system to nearly full double precision. A large residual on a non-singular system usually means the matrix is ill-conditioned.

Can it solve non-square or overdetermined systems?

Only square n×n systems. For least-squares problems, form the normal equations AᵀAx = Aᵀb (the matrix calculator gives you Aᵀ and products) and solve that here.

Is my data sent to a server?

No. Every computation runs in JavaScript in your own browser. Nothing you type ever leaves your device.