Simultaneous Equation Solver (2–10 Variables)

Solve systems of linear equations using matrix inverse, Gaussian elimination, or Cramer's rule. Displays full step-by-step workings, solution verification, 2D graphing (for 2-variable systems), determinant, and matrix display.

2–10 Variables 3 Solution Methods Step-by-Step Verification 2D Graphing

Enter System of Equations

2
Quick Examples

Step-by-Step Solution

Solve a system to see step-by-step workings here.

2D Line Graph

For 2-variable systems, each equation is plotted as a line. The intersection is the solution point (●).

Theory & Solution Methods

A system of linear simultaneous equations consists of n equations and n unknowns where all variables appear only with exponent 1 (no x², sin x, etc.). They model real-world systems from circuit analysis to structural mechanics to economics.

Matrix Form

Any system of n linear equations can be written in compact matrix form:

A · x = b
where A is the n×n coefficient matrix, x is the vector of unknowns, b is the constant vector

For a 3×3 system:

| a11 a12 a13 | | x1 | | b1 |
| a21 a22 a23 | × | x2 | = | b2 |
| a31 a32 a33 | | x3 | | b3 |
Method 1 - Matrix Inverse

If det(A) ≠ 0, the coefficient matrix is invertible and the unique solution is:

x = A⁻¹ · b

Computing A⁻¹ uses the adjugate matrix: A⁻¹ = adj(A) / det(A). Efficient for n ≤ 4. For larger systems, Gaussian elimination is preferred.

Method 2 - Gaussian Elimination (Row Reduction)

The augmented matrix [A|b] is transformed using elementary row operations into row echelon form (upper triangular), then solved by back-substitution:

Row operations: (1) Swap rows (2) Scale a row (3) Add multiple of one row to another

Goal: [ a11 a12 a13 | b1 ] → [ a11 a12 a13 | b1 ]
[ a21 a22 a23 | b2 ] [ 0 a'22 a'23| b'2]
[ a31 a32 a33 | b3 ] [ 0 0 a''33|b''3]

Then back-substitute: x3 = b''3/a''33, x2 = (b'2 - a'23·x3)/a'22, etc.

Partial pivoting (choosing the largest element as pivot) improves numerical stability.

Method 3 - Cramer's Rule

Cramer's Rule uses determinants to solve each variable independently:

xᵢ = det(Aᵢ) / det(A)

where Aᵢ is matrix A with column i replaced by vector b

Practical for n = 2 or 3. Computationally expensive for large n (requires n+1 determinant evaluations).

Determinant and Solution Existence
det(A)Rank ConditionType of SolutionGeometric Interpretation (2D)
≠ 0rank(A) = nUnique solutionLines intersect at one point
= 0rank(A) = rank([A|b]) < nInfinite solutionsLines are coincident (same line)
= 0rank(A) < rank([A|b])No solutionLines are parallel (no intersection)
Condition Number & Numerical Stability

The condition number κ(A) = ‖A‖ · ‖A⁻¹‖ measures sensitivity to rounding errors. A high condition number (ill-conditioned system) means small perturbations in inputs cause large changes in solutions. For κ(A) near 1 the system is well-conditioned; for κ(A) >> 1, solutions may be unreliable.

Engineering Applications
ApplicationWhat the System RepresentsVariables
Electrical CircuitsKirchhoff's voltage/current laws (KVL/KCL)Branch currents / node voltages
Structural AnalysisStiffness method (K·u = F)Nodal displacements
Heat TransferFinite difference equationsNode temperatures
Fluid MechanicsPipe network flowsPipe flow rates
EconomicsInput-output (Leontief) modelIndustry output levels
ChemistryMixture / blending problemsComponent concentrations
Substitution Method (2×2 Example)

For small systems, substitution is intuitive:

Equation 1: x + 2y = 5 → x = 5 - 2y
Equation 2: 3x - y = 1 → 3(5 - 2y) - y = 1 → 15 - 6y - y = 1 → y = 2
Back-substitute: x = 5 - 2(2) = 1
Solution: x = 1, y = 2 ✓
Elimination Method (2×2 Example)
x + 2y = 5 ×3 → 3x + 6y = 15
3x - y = 1 ×1 → 3x - y = 1
Subtract: 7y = 14 → y = 2 → x = 1

Frequently Asked Questions

1. What is a system of simultaneous linear equations?

A system of simultaneous linear equations is a set of n equations, each containing n unknowns, where every term is either a constant or a constant multiplied by a variable (no powers, products, or functions of variables). A solution is a set of values for all unknowns that satisfies all equations simultaneously. The system has a unique solution, no solution, or infinitely many solutions.

2. How many variables can this tool handle?

This tool handles systems from 2 to 10 variables (equations). For 2-variable systems it also generates a 2D line graph showing the geometric intersection. All three methods (matrix inverse, Gaussian elimination, Cramer's rule) work for 2–10 variables, though Cramer's rule becomes computationally intensive for n > 4.

3. What is the difference between Gaussian elimination and matrix inverse methods?

Matrix inverse solves Ax = b as x = A⁻¹b, requiring computation of the inverse matrix (suitable for small systems or when solving many right-hand sides). Gaussian elimination transforms the augmented matrix [A|b] to upper triangular form by row operations, then back-substitutes - more efficient for large n and numerically more stable. Both give the same answer for well-conditioned systems.

4. What is Cramer's Rule and when should I use it?

Cramer's Rule solves xᵢ = det(Aᵢ)/det(A) where Aᵢ replaces column i of A with vector b. It's mathematically elegant and useful for hand calculations with n = 2 or 3. For n ≥ 4, it requires n+1 determinant calculations, making it computationally expensive compared to Gaussian elimination, so it's not recommended for large systems.

5. Why does the solver say 'no unique solution' (determinant zero)?

When det(A) = 0, the coefficient matrix is singular (non-invertible), meaning the equations are linearly dependent. This happens in two cases: (1) Inconsistent system - the equations contradict each other (parallel lines in 2D) - no solution exists. (2) Dependent system - one equation is a linear combination of others - infinitely many solutions exist. Check for redundant or contradictory equations in your input.

6. What does the determinant tell us about the system?

The determinant det(A) of the coefficient matrix A is the key indicator. If det(A) ≠ 0: unique solution exists and the system is 'consistent and independent'. If det(A) = 0: either no solution or infinitely many solutions - the system is 'degenerate'. The absolute value of the determinant also indicates volume scaling in linear transformations.

7. How does the tool verify the solution?

After solving, the tool substitutes the computed values of x1, x2, ..., xn back into each original equation and checks if the left-hand side equals the right-hand side (within floating-point tolerance of ±0.0001). This catches any numerical errors. A residual (LHS − RHS) close to zero confirms the solution is correct.

8. Can this tool solve non-linear equations?

No. This tool is designed exclusively for linear simultaneous equations (all variables appear to the first power only). For non-linear systems (e.g., x² + y = 5), numerical methods like Newton-Raphson iteration are required. The equations must be in the form: a₁x₁ + a₂x₂ + … + aₙxₙ = b.

9. What real-world problems use 3×3 or larger systems?

Examples: Kirchhoff's circuit laws for mesh or nodal analysis (3–6 equations for complex circuits), truss analysis by the method of joints (2 equations per joint), finite element method stiffness equations (potentially thousands of equations), chemical process balances (mass/energy conservation for multiple streams), economic input-output models (Leontief model for n industries).

10. How do I enter a coefficient of zero?

Simply enter '0' in the corresponding input box. If an equation doesn't contain a variable (e.g., the equation only has x1 and x3, not x2), enter 0 for the x2 coefficient. The solver will handle zeros correctly.

11. What is an ill-conditioned system?

An ill-conditioned system has a high condition number κ(A), meaning small changes in the input coefficients or constants produce large changes in the solution. This happens when rows of the coefficient matrix are nearly parallel (nearly linearly dependent). Solutions of ill-conditioned systems may be numerically unreliable due to floating-point rounding errors. If you suspect ill-conditioning, try scaling your equations.

12. How do I solve 3 equations with 3 unknowns by hand?

Use Gaussian elimination: write the augmented matrix [A|b], then use row operations to create zeros below each pivot element (left-to-right), resulting in upper triangular form. Then back-substitute from the bottom equation up. Alternatively, use Cramer's Rule for n = 3: compute det(A) and three modified determinants det(A1), det(A2), det(A3), then x = det(A1)/det(A), y = det(A2)/det(A), z = det(A3)/det(A).

13. What are eigenvalues and how do they relate to simultaneous equations?

Eigenvalues λ arise from the equation (A − λI)x = 0, which is a homogeneous system of linear equations. This system has non-trivial solutions only when det(A − λI) = 0 - called the characteristic equation. Eigenvalues are critical in structural vibration (natural frequencies), stability analysis, and principal component analysis. This tool does not compute eigenvalues, but the underlying theory is the same.

14. Can I use this for overdetermined systems (more equations than unknowns)?

No - this tool requires exactly n equations for n unknowns. Overdetermined systems (more equations than unknowns) are solved using least-squares methods (pseudo-inverse). Underdetermined systems (fewer equations) have infinitely many solutions, and you must choose additional constraints. Both cases require different approaches beyond simple matrix inversion.

15. Why might two mathematically correct methods give slightly different answers?

Due to floating-point arithmetic limitations in computers, different algorithms accumulate rounding errors differently. Matrix inverse and Gaussian elimination may produce results differing by tiny amounts (e.g., 2.9999999 vs 3.0000001). These are not errors - they reflect the finite precision of 64-bit floating-point arithmetic. The differences are typically less than 10⁻¹⁰ for well-conditioned systems.

Explore More Engineering Tools

Try sieve analysis, mass-density, chi-square, and more free tools.

All Tools Blog