CompoundPage

System of Equations Calculator

Two or three equations at once: the system of equations calculator returns exact fractions, and a straight answer when the lines are parallel instead of a misleading number.

Solutionx = 3, y = 2

x
3
y
2
Determinant Non-zero, which guarantees exactly one solution. A zero determinant would mean either none or infinitely many.
-5
Check equation 1
2x + 3y = 12 -> 12 = 12
Check equation 2
x - y = 1 -> 1 = 1
The system
2x + 3y = 12 x - y = 1
  • Solved by Gauss-Jordan elimination with partial pivoting: the row with the largest leading coefficient is used first, which is what stops a leading zero from dividing by itself.
  • For a 3x3 system, set the z coefficients and use all three equations. Leaving a row of zeros makes the system dependent rather than smaller.

How the System of Equations Calculator works

Two linear equations in two unknowns usually have exactly one solution: the point where the two lines cross. Three equations in three unknowns usually have exactly one too, the point where three planes meet. "Usually" is doing real work in both sentences, and the exceptions are the interesting part.

The standard hand methods are substitution and elimination. For 2x + 3y = 12 and x - y = 1, substitution rearranges the second to x = y + 1 and puts it into the first: 2(y + 1) + 3y = 12, so 5y = 10 and y = 2, giving x = 3. Elimination instead scales one equation so that adding or subtracting cancels a variable: multiplying the second by 3 gives 3x - 3y = 3, and adding it to the first eliminates y.

Both are special cases of Gaussian elimination, which is what scales to any size and is what this calculator uses. Write the coefficients as a matrix with the right-hand sides attached, then use row operations (scaling a row, swapping two rows, adding a multiple of one to another) to reduce it until each variable is isolated. None of those operations changes the solution set, which is why the method is valid.

One refinement matters in practice. At each step you want the row with the largest leading coefficient, which is called partial pivoting. Without it, a system whose first equation happens to have no x term divides by zero, and a system with a very small leading coefficient loses precision badly. With it, the method is numerically stable for any system that has a solution.

The determinant predicts the outcome before solving. For a 2x2 system it is ad - bc; for a 3x3 system of equations it is the usual expansion along the first row. If it is non-zero there is exactly one solution. If it is zero, the equations are linearly dependent and there are either none or infinitely many. Which of the two depends on the right-hand sides.

Those two degenerate cases are different answers, and a calculator that blurs them is useless.

No solution means the equations contradict each other. x + y = 2 and 2x + 2y = 5 describe parallel lines: the second says x + y = 2.5, and both cannot hold. Elimination produces a row reading 0 = 1, which is the signature.

Infinitely many means an equation carried no new information. x + y = 2 and 2x + 2y = 4 are the same line written twice. Elimination produces a row of all zeros, and the solution set is the whole line rather than a point. Reporting any single point from it would be arbitrary and wrong.

In three dimensions the geometry is richer and the arithmetic is identical. Three planes can meet at a point (one solution), in a line (infinitely many), in a plane (infinitely many), or not at all, including the case where each pair of planes meets but all three have no common point, which forms a triangular prism. All of those collapse to the same two algebraic outcomes.

A practical note on exactness. Gaussian elimination on decimals gives decimal answers, and a solution of 0.3333333333 is usually meant to be 1/3. This calculator converts the result back to a fraction where a small denominator fits, via continued fractions, and reports the decimal otherwise. That is a presentation convenience rather than exact rational arithmetic, which is worth knowing if you need the answer to be provably exact rather than correct to ten digits.

System of Equations Calculator FAQ

How do I solve a system of equations?

By substitution or elimination for small systems. Substitution rearranges one equation for a variable and puts it into the other; elimination scales one equation so adding or subtracting cancels a variable. Both are special cases of Gaussian elimination, which generalizes to any number of equations.

What does it mean when a system has no solution?

The equations contradict each other. Geometrically, two lines are parallel or three planes have no common point. Algebraically, elimination produces a row reading 0 = something non-zero. The determinant is zero, which is the condition for either no solution or infinitely many.

What does the determinant tell me?

If it is non-zero the system has exactly one solution. If it is zero, the equations are dependent and there are either no solutions or infinitely many; the right-hand sides decide which. For a 2x2 system with rows (a b) and (c d), the determinant is ad - bc.

Can a system have infinitely many solutions?

Yes, when an equation duplicates information the others already carry. x + y = 2 and 2x + 2y = 4 are the same line, so every point on it is a solution. In three variables, planes meeting in a line give a one-parameter family. No single point can honestly be reported in either case.

Related calculators

Embed this calculator
<div id="compoundpage-system-of-equations-calculator"></div>
<script src="https://compoundpage.com/embed/system-of-equations-calculator.js" async></script>

The same calculation as JSON