How it works

A linear equation in one variable can always be written as ax + b = cx + d. Solving it means getting x alone on one side. Subtract cx from both sides, subtract b from both sides, and you have (a − c)x = d − b. Divide by (a − c) and x = (d − b)/(a − c).

Two special cases matter. If a = c and b = d, every x works and the equation is an identity. If a = c but b ≠ d, the x-terms cancel to nothing while the constants disagree, so there is no solution. The solver detects both and says so instead of dividing by zero.

Worked example

Try it with these numbers

The result card above already shows this example — change any field and hit Solve.

FAQ

Quick answers

How do you solve a linear equation step by step?

Get every x-term on one side and every constant on the other, then divide. For 3x − 5 = x + 7: subtract x to get 2x − 5 = 7, add 5 to get 2x = 12, and divide by 2 to get x = 6. Each move is listed on this page.

What does it mean when there is no solution?

When the x-coefficients are equal on both sides but the constants differ, like 2x + 3 = 2x + 8, subtracting 2x leaves 3 = 8, which is false for every x. The lines are parallel and never meet.

What does infinitely many solutions mean?

When both sides are the same expression, like 2x + 3 = 2x + 3, any value of x satisfies the equation. The equation is an identity, not a puzzle with one answer.

Related solvers

Keep going

Every calculator on one page: all mathplum calculators.