Linear Equation Calculator
A linear (first-degree) equation has x to the first power and one solution. Enter the coefficients of ax + b = cx + d and the calculator isolates x and shows each step.
Your numbers
Result
| Step | Detail |
|---|---|
| Equation | 2x + 3 = 0x + 7 |
| Move x terms together | (2 - 0)x = 7 - 3 |
| x = (d - b) / (a - c) | x = 2 |
What "linear" means, and how to isolate x
An equation is linear, or first-degree, when the unknown appears only to the first power: no x², no √x, no 1 ÷ x, no x multiplied by another unknown. That single restriction is what guarantees the tidy behaviour on this page — a linear equation in one variable has exactly one solution, none at all, or infinitely many. There is no fourth possibility.
Solving it is two moves. Gather the x terms on one side and the plain numbers on the other, so ax + b = cx + d becomes (a − c)x = d − b. Then divide by whatever is multiplying x: x = (d − b) ÷ (a − c).
For 2x + 3 = 7 — that is a = 2, b = 3, c = 0, d = 7 — you get x = (7 − 3) ÷ 2 = 2.
What licenses those moves is that an equation stays true if you do the same thing to both sides. Add, subtract, multiply or divide freely, with one exception: never divide by zero, and never divide by an expression that might be zero without checking it first.
Reading the equation as two lines
Everything about the three possible outcomes becomes obvious the moment you draw it.
ax + b and cx + d are two straight lines. Setting them equal asks where they cross. The coefficients a and c are the slopes; b and d are where each line meets the vertical axis.
Two lines with different slopes must cross, exactly once, somewhere — which is the one-solution case, and the crossing point is your x.
Two lines with the same slope are parallel. They either never meet (no solution) or they are the very same line (infinitely many solutions). Which of the two depends only on whether the intercepts also match.
This picture is why the algebra behaves as it does rather than merely that it does. Whenever a solution surprises you, sketching the two lines usually explains it faster than re-checking the arithmetic.
No solution, or every solution
When a = c, the x terms cancel completely and there is nothing left to solve for. What remains is a statement about the constants alone, and it is either true or false.
If the constants differ — 2x + 3 = 2x + 7 — you are left with 3 = 7, which is false no matter what x is. The equation has no solution. Geometrically, two parallel lines that never meet.
If the constants match too — 2x + 3 = 2x + 3 — you are left with 3 = 3, true for every x. That is an identity, and every real number is a solution. Geometrically, one line drawn twice.
The calculator detects both and labels them rather than returning a misleading zero. This matters in applied work, because "no solution" is real information: a break-even model with no solution is usually telling you the two options never actually cross.
Turning a word problem into ax + b = cx + d
The general form is more useful than it looks, because most one-variable comparisons collapse into it.
Two phone plans, one at $30 a month plus $0.10 per gigabyte and another at $50 flat, become 0.10x + 30 = 0 × x + 50, and x = 200 gigabytes is where they cost the same. Two vehicles leaving at different times at different speeds, a rental that charges a base fee plus a daily rate against one that does not — all the same shape.
The pattern to look for is fixed amount plus rate times quantity, on each side. The fixed amount is your b or d; the rate is your a or c.
If your equation has fractions, clear them first by multiplying every term by the least common denominator; if it has parentheses, expand them before collecting terms. Either way you end up with four numbers to type in.
Checking the answer, and the traps
A linear equation is one of the few things in mathematics where verification is free: substitute your x back into the original equation and confirm both sides land on the same number. For 2x + 3 = 7 and x = 2, the left side is 7. Done.
A few traps recur. Sign errors when moving terms across the equals sign account for most wrong answers — subtracting a negative is where it usually happens. Dividing by an expression containing the unknown can quietly destroy a solution or invent one, which is why the safe order is always to collect first and divide last.
There is a numerical trap too. When a and c are very close but not equal, the denominator a − c is tiny and x becomes enormous. That is not an error — it is a genuine feature of nearly-parallel lines meeting far away — but the result is extremely sensitive to small changes in the inputs, so treat it with suspicion if your coefficients came from measurements.
Finally, remember the scope: this solves for one unknown. Two unknowns need two equations, and that is a different technique.
Frequently asked questions
Sources
Embed this calculator
Copy the code and paste it into your site or blog. Credit with a link back to Contania is included, and the height adjusts itself.
<iframe src="https://contania.app/embed/math/linear-equation" title="Linear Equation Calculator (ax + b = cx + d)" width="100%" height="720" loading="lazy" style="border:1px solid #e5e0d8;border-radius:12px;max-width:640px"></iframe>
<script>window.addEventListener("message",function(e){if(e.data&&e.data.type==="contania:embed-height"){var f=document.querySelector('iframe[src="https://contania.app/embed/math/linear-equation"]');if(f){f.style.height=e.data.height+"px"}}});</script>Related calculators
Quadratic Equation
Solve quadratic equations ax² + bx + c = 0 with the quadratic formula. Enter the coefficients to see the discriminant and the roots.
CalculateProportion
Solve a proportion a/b = c/d for any missing term by cross multiplication. Enter the three known values and choose which one to solve for.
CalculateRule of Three
Solve the rule of three: enter three known values and find the fourth. Supports direct and inverse proportion with the step-by-step work.
CalculatePercentage
Work out percentages three ways: what is X% of a number, what percent one number is of another, and finding the whole from a part and its percentage.
Calculate