System of Equations Calculator: Elimination, Substitution and Cramer's Rule
By FindMySum · Last reviewed
A system of equations is a set of equations that must all be true at the same time. Solving it means finding the values of the unknowns that satisfy every equation at once. This calculator solves linear systems with two, three or four unknowns, by elimination, by substitution or by Cramer's rule, and shows the working. It keeps every number as an exact fraction, tells you whether there is one solution, none or infinitely many, and graphs two-unknown systems. The opening example is 2x + 3y = 7 and x − y = 1.
One, none or infinitely many
For two unknowns, each linear equation is a straight line, and a solution is a point on both lines. Two lines can:
- cross once: exactly one solution (the usual case);
- be parallel: no solution, because they never meet;
- be the same line: infinitely many solutions, every point on it.
The same three possibilities hold for any number of unknowns. With three, each equation is a plane, and three planes can meet at a point, along a line, or not at all.
Substitution
Solve one equation for one unknown and put the result into the other. For the default system:
- From x − y = 1, x = y + 1.
- Substitute: 2(y + 1) + 3y = 7, so 5y + 2 = 7 and y = 1.
- Back-substitute: x = 1 + 1 = 2.
Substitution is natural when one equation already has a variable with coefficient 1. It becomes messy with three or more unknowns, so the calculator offers it for two equations only.
Elimination and row reduction
Elimination adds a multiple of one equation to another to cancel an unknown. Subtracting twice the second equation from the first gives 5y = 5 directly. Written systematically, this is Gaussian elimination on the augmented matrix: the coefficients with the right-hand sides in an extra column.
[ 2 3 | 7 ]
[ 1 −1 | 1 ]
Three row operations are allowed, and none of them changes the solutions: swap two rows, multiply a row by a non-zero number, and add a multiple of one row to another. The calculator applies them in order (Gauss–Jordan elimination) until the left block is the identity and the right column holds the answer, listing every step, the same procedure as the reduced row echelon form on the matrix calculator.
Row reduction also detects the special cases. A row that reads 0 0 | 3 says 0 = 3, which is impossible: no solution. If some unknowns have no pivot (no leading 1 in their column), they are free: they can take any value, written as parameters such as t, and the others are expressed in terms of them. The system x + y = 2, 2x + 2y = 4 reduces to the single equation x + y = 2, so the answer is x = 2 − t, y = t for any t.
Cramer's rule
For a square system with a non-zero determinant, each unknown is a ratio of determinants:
xᵢ = det(Aᵢ) ÷ det(A)
where Aᵢ is the coefficient matrix with column i replaced by the right-hand sides. For the default system, det(A) = 2 × (−1) − 3 × 1 = −5. Replacing the x column gives det = 7 × (−1) − 3 × 1 = −10, so x = −10 ÷ −5 = 2; replacing the y column gives 2 × 1 − 7 × 1 = −5, so y = 1.
Cramer's rule is elegant for 2 × 2 and 3 × 3 systems and shows clearly why a zero determinant means trouble: you would be dividing by zero. For larger systems elimination is much less work.
Fractions and exact answers
Real problems rarely have whole-number answers. The calculator accepts fractions in the equations (x/2 + y/3 = 1) and keeps every intermediate value exact, so the answer to x/2 + y/3 = 1, x − y = 1/2 is exactly x = 7/5, y = 9/10, shown as 1.4 and 0.9. Answers with repeating decimals stay as fractions, such as 1/3.
Checking linearity
The methods here only work for linear equations: each unknown appears to the first power, multiplied by a number, with no products of unknowns. The calculator tests every equation, and if you type something like xy = 6 or x² + y = 3 it tells you the equation is not linear. A single quadratic or polynomial equation can be solved with the equation solver instead.
A worked 3 × 3 example
Take x + y + z = 6, 2x − y + z = 3 and x + 2y − z = 2. Subtract twice the first equation from the second and the first from the third to remove x: −3y − z = −9 and y − 2z = −4. Use the second of these to remove y from the first: −7z = −21, so z = 3. Then y = −4 + 6 = 2 and x = 6 − 2 − 3 = 1. The determinant of the coefficients is 7, confirming a single solution, (1, 2, 3).
More questions
Where are systems of equations used in real life?
Anywhere several unknowns are linked by several facts: mixing two solutions to get a target concentration, splitting an investment between two accounts to earn a set amount of interest, balancing chemical equations, working out currents in an electrical circuit with Kirchhoff's laws, or finding the break-even point where cost and revenue lines meet.
How many equations do I need?
As many independent equations as there are unknowns for a single solution: two for x and y, three for x, y and z. With fewer you get infinitely many solutions; with more than you need they may contradict each other, leaving no exact solution.
Why is elimination preferred for bigger systems?
It scales. Gaussian elimination takes roughly n³/3 operations for n unknowns, while Cramer's rule needs n + 1 determinants, which quickly becomes more work. Computers solve systems with millions of unknowns using refined versions of elimination.
Can I check my answer without the calculator?
Yes, always: substitute the values back into every original equation. If x = 2 and y = 1, then 2(2) + 3(1) = 7 and 2 − 1 = 1, so both equations hold. A mistake anywhere in the working will show up as an equation that doesn't balance.
What is the graphical meaning of a 3 × 3 system?
Each equation in x, y and z is a plane in three-dimensional space. Three planes usually meet at a single point (one solution), but they can also meet along a line (infinitely many) or have no common point at all, for instance when two of them are parallel.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.