System of Equations Solver
Solve 2 or 3 simultaneous linear equations with step-by-step elimination (Gauss–Jordan), exact fractions, and a check of the answer. Detects systems with no solution or infinitely many.
Use any variable names (x, y, z, a, b…). Fractions and decimals are fine: x/2 + 0.5y = 4.
Try:
Solution
x = 3, y = 2
Step-by-step solution
- Write each equation in standard form2x + 3y = 12
4x − y = 10 - Augmented matrix
2 3 12 4 −1 10 - R1 → R1 ÷ 2
1 32 6 4 −1 10 Make the x coefficient 1. - R2 → R2 − 4R1
1 32 6 0 −7 −14 Eliminate x from the other rows. - R2 → R2 ÷ (−7)
1 32 6 0 1 2 Make the y coefficient 1. - R1 → R1 − 32R2
1 0 3 0 1 2 Eliminate y from the other rows. - Check2x + 3y = 12 ✓
4x − y = 10 ✓Substituting the solution into each original equation.
How elimination works
- Write the coefficients as an augmented matrix — one row per equation, the constants after the dashed line.
- Use row operations (swap rows, multiply a row, add a multiple of one row to another) to turn the left side into the identity matrix.
- The right-hand column is then the solution. A row like
0 0 | 5means no solution; a row of all zeros means infinitely many.
Systems of equations formulas
SubstitutionSolve one equation for a variable, substitute into the other
EliminationScale the equations so one variable cancels when you add or subtract them
Cramer’s rule (2 × 2)x = c1b2 − c2b1D, y = a1c2 − a2c1D
DeterminantD = a1b2 − a2b1 (D = 0 → no solution or infinitely many)
Where a1x + b1y = c1 and a2x + b2y = c2
Worked examples
Substitution: y = 2x + 1 and 3x + y = 11.
- 3x + (2x + 1) = 11
- 5x = 10 → x = 2
- y = 2(2) + 1
Answer: x = 2, y = 5
Elimination: 2x + 3y = 12 and 4x − y = 10.
- Multiply the second by 3: 12x − 3y = 30
- Add to the first: 14x = 42 → x = 3
- y = 4(3) − 10
Answer: x = 3, y = 2
Same system with Cramer’s rule.
- D = 2(−1) − 4(3) = −14
- x = 12(−1) − 10(3)−14 = −42−14
- y = 2(10) − 4(12)−14 = −28−14
Answer: x = 3, y = 2
50 tickets sold, adults $12 and children $8, total $500. How many of each?
- a + c = 50 and 12a + 8c = 500
- 12a + 8(50 − a) = 500 → 4a = 100
Answer: 25 adult and 25 child tickets
Tips & common mistakes
- Each linear equation in two variables is a line: one solution = the lines cross, none = parallel, infinitely many = the same line.