Algebra and equations
System of equations solver
Enter the coefficients of two equations in the form ax + by = c. The solver uses elimination to find x and y, checks the answer in both equations, and spots parallel and identical lines.
Press Calculate. The answer and every step of the working will show here.
How it works
A system of equations is a set of equations that must all be true at once. With two unknowns, x and y, you need two equations, and the solution is the pair of numbers that satisfies both. On a graph, each equation is a straight line and the solution is the point where the lines cross.
Elimination removes one variable by adding or subtracting the equations. To remove x, multiply equation 1 by the x coefficient of equation 2, multiply equation 2 by the x coefficient of equation 1, and subtract. The x terms cancel and you are left with one equation in y, which you solve. Repeating the idea for y gives x. This solver shows the multiplication, the subtraction and the final divisions, then substitutes the answer back into both original equations as a check.
Two lines can fail to cross in a single point. If they are parallel, with the same slope but different positions, there is no solution. If they are the same line written two ways, every point on the line works, so there are infinitely many solutions. The solver detects both by checking whether a1 × b2 - a2 × b1 equals zero, and then whether the right-hand sides are in the same ratio as the coefficients.
Each equation needs at least an x term or a y term. Put 0 where a term is missing.
The formula
- System: a1x + b1y = c1 and a2x + b2y = c2
- Determinant: D = a1 × b2 - a2 × b1
- If D is not 0: x = (c1 × b2 - c2 × b1) / D and y = (a1 × c2 - a2 × c1) / D
- If D = 0: the lines are parallel (no solution) or identical (infinitely many)
Worked example
Solve 2x + 3y = 12 and x - y = 1. To eliminate x, multiply equation 1 by 1 and equation 2 by 2: 2x + 3y = 12 and 2x - 2y = 2. Subtract the second from the first: 5y = 10, so y = 2. Eliminating y the same way gives -5x = -15, so x = 3. Check in equation 1: 2 × 3 + 3 × 2 = 12. Check in equation 2: 3 - 2 = 1. The lines cross at (3, 2).
More examples
Another clean answer. 3x + 2y = 7 and x + 4y = 9. Multiplying equation 2 by 3 gives 3x + 12y = 27. Subtracting gives -10y = -20, so y = 2, and then x = 1. The point is (1, 2).
A fractional answer. 2y = 6 and 3x + y = 10 (so a1 = 0). From the first, y = 3. Then 3x = 10 - 3 = 7, so x = 7/3, about 2.3333. The solver shows the fraction when the inputs are whole numbers.
Parallel lines. x + y = 2 and 2x + 2y = 5. The second equation, divided by 2, says x + y = 2.5, which contradicts the first. There is no solution.
The same line twice. x + y = 2 and 2x + 2y = 4. The second is the first doubled, so there are infinitely many solutions.
Common mistakes
- Subtracting only some terms. When you subtract one equation from the other, subtract every term, including the right-hand side.
- Sign slips when subtracting. Subtracting -2y is the same as adding 2y. Write the subtraction in full to avoid losing a sign.
- Stopping after finding one variable. The solution is a pair, x and y. Substitute the first answer back to find the second.
- Not checking in both equations. An answer that works in one equation but not the other means a mistake somewhere.
- Calling a cancelled system "no solution" without looking. If everything cancels to 0 = 0, there are infinitely many solutions. If it cancels to a false statement, there are none.
When to use it
Systems of equations model any situation with two unknowns and two facts: ticket prices when you know the totals for two different orders, the speeds of two vehicles, mixtures of solutions in chemistry, or break-even points in a small business.
In school they follow single-variable equations and prepare for matrices later on. Students can solve by graphing, by substitution or by elimination, and elimination is the most reliable by hand. The solver shows the elimination steps so you can match them to your own work.
Common questions
What are the ways to solve a system?
Graphing, substitution and elimination. Graphing gives a picture but is imprecise. Substitution is good when one equation already has x or y alone. Elimination works for any system and is what this solver uses.
What does no solution mean?
The lines are parallel. They have the same slope, so they never meet, and no pair of numbers satisfies both equations. Algebraically, elimination ends with something false like 0 = 3.
What does infinitely many solutions mean?
The two equations describe the same line, so every point on it works. Elimination ends with 0 = 0.
How do I enter an equation like y = 2x + 1?
Rearrange it into ax + by = c first. Subtract 2x from both sides to get -2x + y = 1, so a = -2, b = 1 and c = 1.
What if one equation has no x?
Enter 0 for its x coefficient. For y = 3, use a = 0, b = 1, c = 3. The solver handles it the same way.
Can I solve three equations with three unknowns?
Not with this tool, which is built for two equations and two unknowns. The method extends, though: eliminate one variable from two pairs of equations, then solve the resulting 2x2 system.
You might also need
- Linear Equation SolverSolve ax + b = cx + d for x, with every step and a check.
- Quadratic Equation SolverSolve ax² + bx + c = 0 with the discriminant, real or complex roots, and the vertex.
- Fraction CalculatorAdd, subtract, multiply or divide fractions and mixed numbers, with the answer simplified.
Need a quick calculation instead? The free scientific calculator on the homepage handles roots, powers, trig and logs, and the math guides explain each method step by step.