Calculator · Engineering Mathematics
Linear System Solver — Gaussian Elimination
Solve Ax = b by Gaussian elimination with partial pivoting, and find out which of the three possible answers your system actually has: one solution, infinitely many, or none at all.
Matrix A
One row per line; entries separated by spaces or commas. Scientific notation such as 1.5e-3 is accepted. At most 10 × 10; ragged rows and blank entries are refused, never repaired.
Right-hand side b
One entry per row of A, separated by spaces or commas.
What Anemodia read
| 2 | 1 | -1 |
| -3 | -1 | 2 |
| -2 | 1 | 2 |
| 8 |
| -11 |
| -3 |
Results
| Classification | Exactly one solution — rank(A) = rank([A|b]) = n |
|---|---|
| Size | 3 × 3 |
| rank(A) | 3 |
| rank([A|b]) | 3 |
| Pivot columns | x1, x2, x3 |
| Free variables | none |
| Row swaps | 2 |
| Pivot threshold (eps · n · ‖A‖∞) | 3.997e-15 |
| Pivot growth ρ | 1 |
| Residual ‖b − Ax‖₂ | 8.882e-16 |
| Relative residual ‖r‖₂ / (‖A‖₂‖x‖₂ + ‖b‖₂) | 2.690e-17 |
| 2 |
| 3 |
| -1 |
Elimination detail
Continue
A and b continue into the Lab's Solve workspace, where the same system can also be factorised, conditioned and perturbed.
Assumptions & validity
- · A must be square and at most 10 × 10. An overdetermined system is refused rather than silently turned into a least-squares problem.
- · Every entry of A and b must be finite. Ragged rows and blank entries are refused, never padded or read as zero.
- · Elimination uses PARTIAL PIVOTING: the largest available entry in the column becomes the pivot. Naive elimination is not offered.
- · A pivot counts as zero when it falls below eps · n · ‖A‖∞. That threshold scales with the matrix, so the classification is unchanged by A → cA.
- · Classification is by rank, never by the determinant, which scales as cⁿ and says little about solvability.
- · The residual is formed from the ORIGINAL A and b, not from the transformed system.
Technical reference
A x = b, A ∈ ℝⁿˣⁿ
rank(A) = rank([A|b]) = n → exactly one solution
rank(A) = rank([A|b]) < n → infinitely many solutions, x = x_p + N α
rank(A) < rank([A|b]) → no exact solution
r = b − A x, ‖r‖₂ / (‖A‖₂‖x‖₂ + ‖b‖₂)
- n
- number of unknowns, equal to the matrix size here
- [A|b]
- the augmented matrix
- x_p
- one particular solution, with the free variables set to zero
- N
- a basis of the null space of A
- ρ
- pivot growth max|uᵢⱼ| / max|aᵢⱼ|
Gaussian elimination with partial pivoting reduces [A|b] to upper-echelon form, choosing at each step the row whose entry in the current column is largest in magnitude. The swap costs nothing and removes the failure mode of a zero — or merely small — leading entry.
The residual r = b − Ax says how well the computed vector satisfies the equations. It is NOT the forward error x_computed − x_true, which cannot be known without the exact solution. A tiny residual and a highly sensitive problem regularly occur together.
A consistent rank-deficient system has a whole affine family of solutions. Reporting one of them as THE answer would be false; the particular solution and the null-space basis together describe every solution there is.
Conditioning is a separate question from the residual: see the Matrix Condition Number calculator. A solution can satisfy the equations almost exactly and still be extremely sensitive to small changes in A or b.