Calculator AI Hub
Menu

System of Equations Solver with Steps

This system of equations solver handles linear systems typed one equation per line, such as 2x + 3y − z = 5. It finds the unique solution, describes every solution when there are infinitely many, or shows why there are none. The working shows the augmented matrix and every row operation, using exact fractions.

Mathematics · Linear algebraUpdated Sources cited

Use any letters as variables (x, y, z or x1, x2…). Brackets, fractions and terms on both sides are fine: 2(x + y) = 3 − z.
Method
Examples:

Result

Exactly one solution

x
x=135x = \frac{13}{5}≈ 2.6
y
y=0y = 0
z
z=15z = \frac{1}{5}≈ 0.2
Unknowns
3 (x, y, z)
Rank of the coefficient matrix
3
Rank of the augmented matrix
3
Assumptions behind this result
  • Coefficients are exact: decimals such as 0.1 are treated as exactly 1/10.

Step-by-step solution

Every row operation is computed from your input
  1. Step 1: Write each equation in standard form

    Move every variable term to the left and every constant to the right. The system has 3 equations in 3 unknowns: x, y, z.

    2x+3y−z=5x−y+2z=33x+y+z=8\begin{aligned} 2x + 3y - z &= 5 \\ x - y + 2z &= 3 \\ 3x + y + z &= 8 \end{aligned}
  2. Step 2: Form the augmented matrix

    Each row holds one equation: the coefficients of the variables, then the constant after the bar.

    [23−151−1233118]\left[\begin{array}{ccc|c} 2 & 3 & -1 & 5 \\ 1 & -1 & 2 & 3 \\ 3 & 1 & 1 & 8 \end{array}\right]
  3. Step 3: Eliminate to row echelon form

    Gaussian elimination: use each pivot to create zeros below it.

  4. Step 4: Swap rows 1 and 2.

    R1↔R2:[1−12323−153118]R_{1} \leftrightarrow R_{2}:\quad \left[\begin{array}{ccc|c} 1 & -1 & 2 & 3 \\ 2 & 3 & -1 & 5 \\ 3 & 1 & 1 & 8 \end{array}\right]
  5. Step 5: Subtract 2 × row 1 from row 2.

    R2→R2−2R1:[1−12305−5−13118]R_{2} \to R_{2} - 2R_{1}:\quad \left[\begin{array}{ccc|c} 1 & -1 & 2 & 3 \\ 0 & 5 & -5 & -1 \\ 3 & 1 & 1 & 8 \end{array}\right]
  6. Step 6: Subtract 3 × row 1 from row 3.

    R3→R3−3R1:[1−12305−5−104−5−1]R_{3} \to R_{3} - 3R_{1}:\quad \left[\begin{array}{ccc|c} 1 & -1 & 2 & 3 \\ 0 & 5 & -5 & -1 \\ 0 & 4 & -5 & -1 \end{array}\right]
  7. Step 7: Subtract 4/5 × row 2 from row 3.

    R3→R3−(45)R2:[1−12305−5−100−1−15]R_{3} \to R_{3} - \left(\frac{4}{5}\right)R_{2}:\quad \left[\begin{array}{ccc|c} 1 & -1 & 2 & 3 \\ 0 & 5 & -5 & -1 \\ 0 & 0 & -1 & -\frac{1}{5} \end{array}\right]
  8. Step 8: Back-substitute to find z

    Start from the last row, which involves only one unknown.

    z=−15−1=15z = \frac{-\frac{1}{5}}{-1} = \frac{1}{5}
  9. Step 9: Back-substitute to find y

    Substitute the values already found into this row.

    y=−1−(−5)(15)5=0y = \frac{-1 - (-5)(\frac{1}{5})}{5} = 0
  10. Step 10: Back-substitute to find x

    Substitute the values already found into this row.

    x=3−(−1)(0)−(2)(15)1=135x = \frac{3 - (-1)(0) - (2)(\frac{1}{5})}{1} = \frac{13}{5}
  11. Step 11: Check the solution

    Substituting the values back into every original equation makes each one true.

    5=5 ✓3=3 ✓8=8 ✓\begin{aligned} 5 = 5\ \checkmark \\ 3 = 3\ \checkmark \\ 8 = 8\ \checkmark \end{aligned}

What the solver does

Enter the equations and choose a method. The solver:

  • reads each equation, expands brackets and collects terms;
  • builds the augmented matrix [A | b];
  • row-reduces it exactly, listing each row operation;
  • decides whether there is one solution, infinitely many or none;
  • gives the solution, a parametric description of all solutions, or the contradiction that rules them out;
  • substitutes a unique solution back into every original equation as a check.

How to use it

Type one equation per line, or separate equations with semicolons. Variables can be any letters, with optional subscripts written as x1 or x_1. Coefficients can be integers, decimals or fractions, and you can use brackets and put terms on either side. Systems of up to 10 equations in up to 8 unknowns are supported.

The method: Gaussian elimination

The augmented matrix

A system of m equations in n unknowns can be written as Ax = b. The augmented matrix places b next to A:

2x+3y−z=5x−y+2z=33x+y+z=8⟶[23−151−1233118]\begin{aligned} 2x + 3y - z &= 5 \\ x - y + 2z &= 3 \\ 3x + y + z &= 8 \end{aligned} \quad\longrightarrow\quad \left[\begin{array}{ccc|c} 2 & 3 & -1 & 5 \\ 1 & -1 & 2 & 3 \\ 3 & 1 & 1 & 8 \end{array}\right]

Row operations

Three operations change the matrix without changing the solutions:

  1. swap two rows;
  2. multiply a row by a non-zero number;
  3. add a multiple of one row to another.

Gaussian elimination uses them to create zeros below each pivot, giving row echelon form. The last row then involves one unknown, and back substitution recovers the rest. Gauss–Jordan elimination continues until each pivot is 1 with zeros above and below it, so each row states one unknown’s value directly.

How many solutions?

Let r be the rank of A, r′ the rank of [A | b], and n the number of unknowns (the Rouché–Capelli theorem):

Condition Solutions
r < r′ none: some row reduces to 0 = c with c ≠ 0
r = r′ = n exactly one
r = r′ < n infinitely many, with n − r free variables

Worked example

Solve 2x + 3y − z = 5, x − y + 2z = 3 and 3x + y + z = 8.

  1. Choose a convenient pivot. Swap rows 1 and 2, so the first pivot is 1.
  2. Eliminate x. Subtract 2 × row 1 from row 2, and 3 × row 1 from row 3. This leaves two equations in y and z: 5y − 5z = −1 and 4y − 5z = −1.
  3. Eliminate y. Subtract 4/5 × row 2 from row 3, leaving −z = −1/5, so z = 1/5.
  4. Back-substitute. 5y − 5(1/5) = −1 gives y = 0. Then x − 0 + 2(1/5) = 3 gives x = 13/5.

The solution is x = 13/5, y = 0, z = 1/5. Substituting back: 2(13/5) + 3(0) − 1/5 = 25/5 = 5 ✓.

Common mistakes

  • Applying an operation to only part of a row. Every row operation must include the constant after the bar.
  • Losing a sign when subtracting a multiple of a row. Write out the new row in full before moving on.
  • Concluding “no solution” from a row of zeros. A row 0 = 0 means a redundant equation, not a contradiction. Only 0 = non-zero rules out solutions.
  • Rounding fractions to decimals part-way through. Small rounding errors can change a dependent system into an inconsistent one.

Practical applications

  • Electrical circuits. Kirchhoff’s laws give a linear system for the currents in a network.
  • Chemistry. Balancing a chemical equation is solving a linear system for the coefficients.
  • Economics. Input–output models and supply–demand equilibria are linear systems.
  • Engineering. Forces in the members of a truss satisfy a system of equilibrium equations.
  • Data fitting. The least-squares line of best fit solves a 2 × 2 linear system.

Assumptions and limitations

Equations must be linear: each variable to the first power, never multiplied by another variable or used as a divisor. Coefficients are exact rational numbers, and all arithmetic is exact. The solver handles up to 10 equations in 8 unknowns.

Frequently asked questions

What is a system of linear equations?

A set of two or more linear equations that share the same unknowns, such as 2x + y = 5 and x − y = 1. The solution satisfies all equations at once.

How many solutions can a system of linear equations have?

Exactly one, none, or infinitely many. It can never have exactly two.

How do you solve by elimination?

Multiply equations so one variable has matching coefficients, then add or subtract to cancel it. Repeat until one unknown is left.

What is Gaussian elimination?

A step-by-step method using row operations to turn a system into triangular form, then solving from the bottom row up.

What is Cramer's rule?

It solves a system using determinants: each unknown equals the determinant of a modified matrix divided by the main determinant. It works only when that determinant is not zero.

How do I know if a system has no solution?

If elimination gives a false statement like 0 = 5, the equations contradict each other. Graphically, the lines are parallel.

How do I know if there are infinitely many solutions?

If elimination gives 0 = 0, one equation repeats information from the others. The lines or planes overlap.

How many equations do I need to find all unknowns?

Usually as many independent equations as there are unknowns. Three unknowns normally need three independent equations.

References

  1. Strang, G. (2016). Introduction to Linear Algebra (5th ed.), chapters 2–3. Wellesley-Cambridge Press.
  2. Anton, H. & Rorres, C. (2013). Elementary Linear Algebra (11th ed.), chapter 1. Wiley.
  3. Weisstein, E. W. Gaussian Elimination. MathWorld, Wolfram Research.