Linear Equation Solver
A linear equation in one variable has the form mx + b = c. The solver isolates x by subtracting b from both sides and dividing by m, showing each operation. It also handles the special cases where m = 0, which give either no solution or infinitely many.
The steps, and the two degenerate cases
A linear equation in one variable is the simplest thing algebra solves, and it teaches the technique everything else is built on: whatever you do to one side, do to the other, until the unknown stands alone. Two operations suffice — subtract the constant, divide by the coefficient.
This solver works through mx + b = c in exactly those two moves, showing each. It also handles the two cases where the method breaks down, which are more interesting than the ordinary solve.
For a routine equation the value of showing the work is that a disagreement can be traced. Both intermediate lines carry actual numbers, so a wrong answer is either a wrong subtraction or a wrong division, and the two are distinguishable at a glance.
The cases where the coefficient is zero are worth dwelling on. The variable disappears, and what is left is either a true statement or a false one — giving every number as a solution, or none. Those are usually met as a surprise rather than as a category, and the tool names them explicitly.
How to use this calculator
- Rearrange your equation into mx + b = c Collect the x terms on the left and the constants on the right. An equation with x on both sides must be gathered first — this solver takes coefficients, not typed text.
- Enter m, the coefficient of x Any real number, including zero. Zero is not an error here: it produces one of the two degenerate cases rather than a rejection.
- Enter b and c The constant on the left and the value on the right. Both may be negative or fractional, and both are used exactly as entered.
- Read both steps, not only the answer The first line shows the equation after the constant has been removed; the second shows the division. Comparing them against your own working localises any discrepancy.
The formula, and where it comes from
mx + b = c → mx = c − b → x = (c − b) / m (m ≠ 0)
Subtracting b from both sides is the first move. It leaves the x term alone on the left — a single subtraction, but one whose sign is easy to get wrong when b is negative, since removing a negative constant means adding.
Dividing by m then isolates x. The order matters: dividing first would mean dividing b too, which is more arithmetic and more opportunity for error. That is why the standard procedure clears the constant first.
The condition m ≠ 0 is not a technicality but the boundary of the method. Where m is zero there is nothing to divide by, and the equation has stopped being an equation about x at all.
In that case the left side is just b and the statement reads b = c. If those are equal it is true regardless of x, so every number solves it; if they differ it is false regardless of x, so nothing does. The implementation checks this before any division.
What each input means
- m Coefficient of x — form field “m (x coefficient)”
- The multiplier on the unknown. Any real number; zero is accepted and routes to one of the two degenerate cases rather than producing an error.
- b Constant on the left — form field “b (constant on the left)”
- Added to the x term. It is removed first, by subtracting it from both sides.
- c Right-hand side — form field “c (right-hand side)”
- The value the left side must equal. Only the difference c − b affects the answer, so the two constants matter jointly.
- x Solution
- The value satisfying the equation. Unique whenever m is non-zero — a linear equation cannot have two distinct solutions.
Worked examples
Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.
A straightforward solve
Solve 2x + 3 = 7. Both steps come out as whole numbers, which makes the structure of the method easy to follow before the arithmetic gets in the way.
Inputs m (x coefficient) = 2, b (constant on the left) = 3, c (right-hand side) = 7
- Equation 2x + 3 = 7
- Subtract b 2x = 7 − (3) = 4
- Divide by m x = 4 / 2 = 2
Result x = 2
Subtracting 3 leaves 2x = 4, and dividing by 2 gives x = 2. Substituting that back reproduces the original equation exactly, which is the check every solved equation deserves and which costs one line.
Notice that only the difference between the two constants matters. The equation 2x + 10 = 14 has the same solution, because 14 − 10 is also 4.
A fractional result
Solve 3x + 1 = 2. The difference of the constants is 1 and the coefficient is 3, so the division does not come out whole.
Inputs m (x coefficient) = 3, b (constant on the left) = 1, c (right-hand side) = 2
- Equation 3x + 1 = 2
- Subtract b 3x = 2 − (1) = 1
- Divide by m x = 1 / 3 = 0.333333
Result x = 0.333333
The answer is a third, shown as a decimal rather than as a fraction. Rounding is applied only to remove floating-point noise, so a value that should be exactly a third does not appear with stray digits at the end.
Nothing about the method changes when the answer is not an integer. Whole-number solutions are a feature of textbook exercises, not of linear equations.
Reading the result
There is exactly one solution, or none, or all
A non-zero coefficient always gives precisely one answer. A zero coefficient gives either every number or no number, according to whether the two constants match. No linear equation in one variable has any other outcome.
What no solution actually means
Not that the answer is hard to find, but that the equation reduces to a false arithmetic statement such as 3 = 7. No value of x can make that true, because x has already vanished from it.
Reading the answer as a graph
Solving mx + b = c asks where the line y = mx + b reaches height c. A zero coefficient makes the line horizontal, so it either sits at that height everywhere or never reaches it — the graphical picture of the two degenerate cases.
When you would use this
Isolating an unknown in a formula
Most rearrangements of a simple formula are linear in the quantity solved for. Identifying the coefficient and the two constants turns the rearrangement into this calculation.
Break-even and threshold questions
Asking when a linear cost meets a linear revenue, or when a quantity growing at a fixed rate reaches a target, is this equation with the answer read as a time or a quantity.
Assumptions and limitations
What this calculator assumes
- The equation has been rearranged into mx + b = c before the coefficients are entered.
- All three inputs are finite real numbers; m may be zero.
- The variable appears to the first power only, and on the left side only.
- The result is displayed as a decimal, rounded only to remove floating-point noise.
Where it stops being the right tool
- Coefficients are entered rather than parsed: a typed equation such as 3x + 4 = 2x − 1 must be collected by hand first.
- One variable and one equation. Simultaneous systems have their own solvers.
- The answer is decimal, never an exact fraction, so a solution of one third is shown rounded rather than as a ratio.
Common mistakes
Mishandling the sign when the constant is negative
Why it happens. For mx − 5 = c the constant is −5, and removing it means adding 5 to both sides. Written as a subtraction of a negative, that step inverts in a way that is easy to perform on autopilot.
How to avoid it. Read the first output line. It shows c − b computed explicitly, so a difference smaller than c when it should be larger identifies the double negative immediately.
Dividing before clearing the constant
Why it happens. Dividing everything by m looks like a symmetric first move, and it is valid — but it turns b into a fraction that then has to be subtracted, which is more work and more error.
How to avoid it. Subtract first, always. Both routes reach the same answer, and one has noticeably fewer places to slip.
Treating a zero coefficient as an input error
Why it happens. Every other equation returns a number, so entering zero and receiving a sentence looks like the tool refusing rather than answering.
How to avoid it. Read which of the two cases it names. Infinitely many solutions and no solution are genuine results, and telling them apart is exactly what the exercise is testing.
Key terms
Frequently asked questions
What form of equation does this accept?
It solves mx + b = c, entered as three coefficients rather than as typed text. Any linear equation can be put into that shape by collecting the x terms on the left and the constants on the right first.
What happens when m is 0?
The variable disappears and the equation reduces to b = c. If those two are equal the statement is true for every x, so there are infinitely many solutions; if they differ it is false for every x, so there are none.
Can the answer be a fraction?
The value can be fractional, but it is displayed as a decimal rather than as a ratio. Rounding is applied only to strip floating-point noise, so a solution of one third shows as a clean recurring decimal rather than with stray trailing digits.
Why subtract before dividing?
Both orders are valid, but subtracting first keeps the arithmetic simpler: the constant is removed as a whole number, and only one division is needed at the end. Dividing first turns every term into a fraction before the subtraction has even happened.