LonghandMath calculators

System of Equations Calculator

Enter the coefficients of two linear equations to solve for x and y. The calculator shows the elimination steps, checks both equations, and tells you when there is no solution or infinitely many.

Equation 1: a₁x + b₁y = c₁

Equation 2: a₂x + b₂y = c₂

What is a system of equations?

A system of equations is a group of equations with the same unknowns. A solution must make every equation true at the same time. With two linear equations in x and y, each equation is a straight line, and the solution is where the lines meet.

Methods for solving a system

MethodBest when
EliminationCoefficients are easy to match or cancel
SubstitutionOne variable is already isolated, such as y = 2x + 1
GraphingYou want a visual check or an estimate
Cramer’s ruleYou want a direct formula using determinants

This calculator uses elimination written as general formulas, which is the same calculation as Cramer’s rule. With D = a₁b₂ − a₂b₁, the solution is x = (c₁b₂ − c₂b₁) ÷ D and y = (a₁c₂ − a₂c₁) ÷ D.

Worked examples

One solution: 2x + y = 7 and x − y = −1

Adding the equations cancels y: 3x = 6, so x = 2. Substituting into the first equation gives 4 + y = 7, so y = 3. Check the second: 2 − 3 = −1.

A word problem

Two notebooks and three pens cost 12, and one notebook and two pens cost 7. Write 2n + 3p = 12 and n + 2p = 7. Then D = 4 − 3 = 1, so n = (24 − 21) ÷ 1 = 3 and p = (14 − 12) ÷ 1 = 2. A notebook costs 3 and a pen costs 2.

No solution: x + y = 2 and 2x + 2y = 5

The second equation is twice the left side of the first, but 5 is not twice 2. The lines are parallel, so they never meet.

Infinitely many: x + y = 2 and 2x + 2y = 4

The second equation is just the first multiplied by 2. Both describe the same line, so every point on it is a solution.

The three possible outcomes

DeterminantWhat it meansGraph
D ≠ 0Exactly one solutionLines cross once
D = 0, constants inconsistentNo solutionParallel lines
D = 0, constants consistentInfinitely many solutionsSame line

Common mistakes

The usual slip is a sign error when subtracting one equation from another. Another is multiplying only the variable terms and forgetting the constant. Many students also solve for x and stop, forgetting to find y. Always put the equations in the form ax + by = c first, and check your answer in both. For a single unknown, use the linear equation calculator, and to see the lines behind the system, use the slope, distance and midpoint calculator.

Frequently asked questions

What is a system of equations?

A system of equations is a set of two or more equations that share the same unknowns. A solution must satisfy every equation at once. For two linear equations in x and y, the solution is the point where their lines cross.

How many solutions can a system of two linear equations have?

It can have exactly one solution, no solution, or infinitely many. One solution means the lines cross at a single point. No solution means the lines are parallel. Infinitely many means both equations describe the same line.

What is the difference between elimination and substitution?

Substitution solves one equation for a variable and puts it into the other. Elimination scales and adds or subtracts the equations so one variable cancels. Both give the same answer, and elimination is usually quicker when coefficients line up.

How do you know when there is no solution?

When the determinant a₁b₂ − a₂b₁ is zero and the constants do not match, the lines have the same slope but different positions. They are parallel and never meet, so no pair of numbers satisfies both equations.

How do I enter an equation like y = 2x + 1?

Rewrite it in the form ax + by = c by moving the x term across: −2x + y = 1. Then enter a = −2, b = 1 and c = 1. Always put the x term first, the y term second and the constant on the right.

More Algebra calculators

Browse every algebra calculator.

Other calculators

Related topics on this page: simultaneous equations, two-variable linear equations, elimination method, substitution method, Cramer's rule, determinant, parallel lines