🔢 Linear Equation Solver

Solve 2×2 and 3×3 systems of linear equations using Gaussian elimination with partial pivoting. The solver shows each row operation step and handles singular or ambiguous systems.

Tip: If the solver reports infinitely many or no solutions, inspect the reduced row-echelon form shown in the steps to understand dependencies.

How to Solve Linear Systems — Step-by-Step Tutorial (Online Linear Equation Solver)

Quick overview: A linear system is a set of linear equations with the same variables. Solving these systems is a core skill in mathematics, engineering, data science and physics. This tutorial explains common solution methods (Gaussian elimination, Cramer’s Rule and the inverse-matrix method), shows worked examples for 2×2 and 3×3 systems, and explains how to use this online linear equation solver to get fast, reliable answers with step-by-step details.

What is a system of linear equations?

A system of linear equations has the general form a₁₁x₁ + a₁₂x₂ + … + a₁ₙxₙ = b₁, a₂₁x₁ + a₂₂x₂ + … + a₂ₙxₙ = b₂, and so on. In matrix form this becomes Ax = b, where A is the coefficient matrix, x is the vector of unknowns, and b is the RHS (constants) vector. The goal is to find vector x that satisfies the equation.

Why an online solver helps

Manual solution methods are excellent for learning, but they are time-consuming and error-prone for routine calculations. An online linear equation solver quickly executes robust numeric routines (Gaussian elimination with partial pivoting), clearly shows steps, and allows you to export results — which is ideal for homework checks, engineering verification, and quick prototyping in data workflows.

Method 1 — Gaussian elimination (recommended)

Gaussian elimination is the most widely used numeric method: it converts the augmented matrix [A | b] to an upper-triangular (or row-echelon) form using row operations, and then performs back-substitution to obtain the unknowns. Partial pivoting (swapping rows to choose the largest pivot) reduces numerical error and is standard in reliable solvers.

Advantages: Works for general n×n systems, robust with partial pivoting.

When to use: Anytime you need a numeric solution and traceable steps—this is what the solver above implements.

Method 2 — Cramer’s Rule (small systems only)

Cramer’s Rule gives an exact formula for each variable using determinants: xᵢ = det(Aᵢ) / det(A), where Aᵢ is matrix A with its ith column replaced by b. Although elegant, Cramer’s Rule is computationally expensive for systems larger than 3×3 and sensitive to determinant numerical instability.

Method 3 — Inverse matrix method

If A is invertible (i.e., det(A) ≠ 0), then the solution is x = A⁻¹ b. Computing the inverse directly is inefficient for large systems compared to elimination, but it’s useful conceptually and for small problems where you also need the inverse for other calculations.

How to use this calculator — step-by-step

  1. Select system size: choose 2×2 or 3×3 depending on your problem.
  2. Enter coefficients: fill each coefficient aᵢⱼ and the RHS values bᵢ. The solver accepts decimals and negative numbers.
  3. Choose display precision: pick how many decimals to show (0–4). Increase precision if your determinant or pivots are very small.
  4. Click Solve: the solver performs Gaussian elimination with partial pivoting and displays the solution, a detailed row-operation log, and a reduced matrix for inspection.
  5. Export or copy: you can download a CSV of the augmented matrix and solution, or copy the result to the clipboard for documentation.

Worked example — 2×2 system

Problem:

2x + 3y = 8
x − 4y = −2

Matrix form: A = [[2,3],[1,−4]], b = [8,−2].

Gaussian elimination: Use row operations to form an upper-triangular system, then back-substitute:

  1. R2 ← R2 − (1/2)R1 ⇒ new R2: 0x + (−5.5)y = −6
  2. Back-substitute: y = (−6)/(−5.5) ≈ 1.0909, then x = (8 − 3y)/2 ≈ 1.3636

Enter the coefficients into the solver (2, 3, 1, −4 and RHS 8, −2) and click Solve to verify step-by-step calculations and result.

Worked example — 3×3 system

Problem:

x + 2y +  z = 9
2x −  y + 3z = 13
3x +  y − 2z = 4

Enter the 3×3 matrix coefficients and RHS into the solver. The solver will apply partial pivoting where appropriate, eliminate below the pivots, and then compute x, y, z by back-substitution. The step log helps you trace row swaps and numerical factors so you can learn or audit the computation.

Interpreting solver output: unique, infinite or no solution

The solver returns one of three outcomes:

  • Unique solution: The coefficient matrix is full-rank and you’ll get a distinct value for each variable.
  • Infinitely many solutions: The matrix is singular but the system is consistent (dependent equations). The solver shows the reduced rows so you can identify free variables.
  • No solution: The system is inconsistent (a row with zeros in coefficients but non-zero RHS). The step log highlights the conflicting row.

Common mistakes & troubleshooting

  • Entering values incorrectly: Ensure coefficients are placed in the correct row/column and RHS corresponds to the correct equation.
  • Floating point rounding: If a result seems close to zero, increase display precision or use symbolic tools for exact arithmetic.
  • Singular matrices: If the solver reports infinite solutions or no solution, check whether your system equations are redundant or contradictory.
  • Poor scaling: Very large or very small coefficients can cause numeric instability. Rescale equations (divide by a common factor) or use higher-precision routines if available.

When to use Cramer’s rule or inverse methods

Cramer’s rule and direct inversion are useful for teaching and for small problems where exact determinant-based formulas are instructive. For larger problems or production code, Gaussian elimination (or LU decomposition) is more efficient and stable. Use matrix inversion if you need A⁻¹ for other computations, but avoid computing inverses just to solve a system—solving Ax=b directly via elimination is more numerically efficient.

Real-world applications

Systems of linear equations arise everywhere: circuit analysis (Kirchhoff’s laws), equilibrium in statics, chemical reaction balances, linear regression normal equations in machine learning, and finite-element discretizations in engineering simulations. This simple solver is a quick prototyping tool for small systems and a learning resource for students and professionals.

SEO & practical tips

When searching for help, terms like “online linear equation solver,” “solve system of equations step by step,” and “matrix calculator with steps” will surface tools like this one. Use the step log to learn Gaussian elimination mechanics and export CSV results when documenting examples or including numeric results in reports.

Conclusion

This online linear equation solver implements tried-and-true numerical methods (Gaussian elimination with partial pivoting) and presents readable step-by-step output to help you learn and verify solutions. Use the examples above to test the calculator, increase precision for sensitive cases, and export results for classroom or engineering documentation. If you work with larger systems, consider numerical libraries like NumPy, MATLAB or dedicated linear algebra packages to handle performance and precision at scale.

Quick reference (copy/paste)

How to use:
1. Select 2×2 or 3×3
2. Enter coefficients aᵢⱼ and RHS bᵢ
3. Choose precision
4. Click Solve
5. Inspect step-by-step log and export if needed
  

Frequently Asked Questions

Which method is used?
Gaussian elimination with partial pivoting, then back-substitution.
Can I use this for larger systems?
This tool handles 2×2 and 3×3 systems. For larger systems use libraries like NumPy or MATLAB.
What does 'singular' mean?
Singular means the coefficient matrix has determinant zero and the system may have no unique solution.