Linear Equation Solver
Solve a one-variable linear equation ax + b = 0 and find the value of x.
The value of x that makes ax + b = 0.
- 1
Move constant: a·x = −b
2·x = −(-6) = 6 = 6 - 2
Divide by coefficient a
x = 6 ÷ 2 = 3
Formula
How this is calculated
This tool solves a linear equation in one variable written in the standard form ax + b = 0. Here a is the coefficient of x (how many times the unknown appears) and b is the constant term. Both are exact real numbers you supply; the calculator carries them through with floating-point arithmetic, so no rounding happens until the answer is displayed to four decimals.
The logic mirrors hand algebra. Starting from ax + b = 0, it subtracts b from both sides to get ax = −b, then divides both sides by a, giving the unique solution x = −b ÷ a. This single step is valid only when a is non-zero, because division by zero is undefined.
Two edge cases are detected before dividing. If a = 0 but b ≠ 0, the equation collapses to b = 0, a contradiction, so it reports no solution. If both a = 0 and b = 0, the equation becomes 0 = 0, true for every x, so it reports infinitely many solutions. The method assumes a degree-one equation and does not handle quadratic or higher-order terms.
Examples
| Input | Result |
|---|---|
| a = 2, b = -6 | x = 3 |
| a = 5, b = 10 | x = -2 |
About this calculator
A linear equation in one variable has the form ax + b = 0, where a and b are known constants and x is the unknown. As long as a is not zero, there is exactly one solution: x = −b ÷ a. You simply move the constant to the other side and divide by the coefficient of x.
There are two special cases. If a = 0 and b ≠ 0 the equation reduces to b = 0, which is false, so there is no solution. If both a = 0 and b = 0 the equation becomes 0 = 0, which is always true, meaning every number is a solution.
Frequently asked questions
Subtract b from both sides to get ax = −b, then divide both sides by a to get x = −b ÷ a, provided a is not zero.
If a = 0 the term with x disappears. With b ≠ 0 there is no solution, and with b = 0 every value of x works (infinitely many solutions).
Yes. Rewrite the equation so one side is 0 (here 3x − 6 = 0), then enter a = 3 and b = −6 to get x = 2.
Also known as
TG we-Calculate Editorial Team. (2026). Linear Equation Solver [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/linear-equation-solver
TG we-Calculate Editorial Team. "Linear Equation Solver." TG we-Calculate. 2026. https://we-calculate.com/calculator/linear-equation-solver.
TG we-Calculate Editorial Team, "Linear Equation Solver," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/linear-equation-solver
@misc{wecalculate_linear_equation_solver, title = {Linear Equation Solver}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/linear-equation-solver}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
