ToolSphere

Linear System Solver

Student tools

Solve systems of 2 to 5 linear equations (Ax = b) using Gaussian elimination. Enter matrix coefficients and constants to compute exact variable solutions.

Linear system solver

Solves Ax = b for a system of up to 5 linear equations using Gaussian elimination with partial pivoting.

Unknowns:
x1 =
x2 =
x3 =
x1
2
x2
3
x3
-1

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

About Linear System Solver

Linear System Solver

Solves a system of linear equations Ax = b using Gaussian elimination with partial pivoting, for 2 to 5 unknowns. Partial pivoting (swapping to the largest available pivot in each column) keeps the elimination numerically stable, avoiding division by very small numbers.

If the system has no unique solution (a singular matrix — dependent or contradictory equations), the tool reports this instead of a misleading result.

What the three outcomes mean

A linear system has exactly one of three answers, and the geometry explains each. With two unknowns each equation is a line: they cross at one point (one solution), they are parallel (no solution), or they are the same line (infinitely many). With three unknowns the same logic runs on planes.

A unique solution is the case people expect. "No solution" means the constraints contradict each other — often a sign the model, not the arithmetic, is wrong. "Infinitely many" means an equation adds no information beyond the others, which is what the solver reports as a singular matrix.

Why the solver swaps rows

Gaussian elimination divides by the pivot in each column. If that pivot is zero the division is impossible, and if it is merely small the division amplifies rounding error through every subsequent step, so a system with a perfectly good answer returns numerical rubbish.

Partial pivoting fixes this by swapping in the largest available value in the column before dividing. It changes the row order but not the solution, and it is why the working shown may not match the order in which you entered the equations.

Near-singular systems

Between "solvable" and "singular" lies the case worth worrying about: an ill-conditioned system, where the equations are nearly but not quite redundant. These return an answer, and that answer can move enormously under a tiny change in the inputs. If your coefficients came from measurements, a near-singular system means the result is not trustworthy to more precision than the measurements themselves.

A practical test: change a coefficient in the last decimal place you trust and re-solve. If the answer barely moves, it is sound. If it swings wildly, the system is ill-conditioned and needs better data rather than more arithmetic.

Guides and tutorials

Frequently asked questions

What does 'the system is singular' mean?

It means the equations don't have a single unique solution — either they're dependent (infinitely many solutions) or contradictory (no solution). This happens when the coefficient matrix's determinant is zero.

Why does the solver swap rows during elimination?

Partial pivoting selects the row with the largest absolute value in the current column as the pivot, which keeps the arithmetic numerically stable and avoids amplifying floating-point rounding errors.

What does 'singular' actually mean here?

That the equations do not pin down a unique answer — either they contradict each other (no solution) or one adds nothing the others did not already say (infinitely many solutions). Geometrically the lines or planes are parallel or coincident.

Why does the solution change when I barely change a coefficient?

The system is ill-conditioned: the equations are nearly redundant, so the intersection point is poorly determined. If the coefficients came from measurements, the answer is not reliable beyond the precision of those measurements.

Does row swapping change my answer?

No. Partial pivoting reorders the equations to divide by the largest available pivot, which keeps rounding error under control. The solution is identical; only the intermediate working differs.

Have a suggestion for Linear System Solver?Share your feedback ↗