Skip to content
Calculator Collection
← All articles
algebraMarch 10, 2026

Linear Equations: How to Solve ax + b = 0 for x

The equation ax + b = 0 looks almost too simple to deserve a guide, yet it is the quiet foundation beneath an enormous amount of mathematics. Master it and you have the key to systems of equations, slope-intercept lines, and nearly every applied modeling problem you will meet. This guide breaks down exactly how to solve a single-variable linear equation, why the method works, and how to sidestep the small slips that trip people up most often.

What a Linear Equation Is and Why It Matters

A linear equation in one variable is any equation that can be written in the form ax + b = 0, where a and b are known numbers and x is the unknown you want to find. The word "linear" comes from the fact that, when graphed, the relationship is a straight line. The variable appears only to the first power — never squared, cubed, or inside a root — which is what keeps these equations so well-behaved.

This is the simplest non-trivial equation in algebra, and that simplicity is exactly why it matters. Systems of equations are just several linear equations solved together. The slope-intercept line y = mx + b becomes a linear equation the moment you fix a value. Word problems about cost, distance, mixing, and rates almost always reduce to "isolate x." If you can solve ax + b = 0 fluently, you have the core skill that everything more advanced builds on.

Linear relationships also describe the real world remarkably often: a flat fee plus a per-unit charge, a starting balance plus a steady monthly deposit, a temperature rising at a constant rate. Each of these is ax + b in disguise.

How to Solve ax + b = 0

The goal of solving is always the same: get x by itself on one side of the equals sign. You do that by performing the same operation to both sides, which keeps the equation balanced, until only x remains.

Starting from ax + b = 0:

1. Subtract b from both sides to move the constant away from the x term: ax = −b

2. Divide both sides by a to free x: x = −b ÷ a

That gives the general solution:

x = −b ÷ a

This single line is the formula behind every linear equation solver. It works for any values of a and b, with one essential caveat: a cannot be zero, because dividing by zero is undefined. (If a = 0, the equation collapses to b = 0, which is either always true or never true, with no single solution for x.)

Worked example. Solve 3x + 12 = 0.

Here a = 3 and b = 12.

1. Subtract 12 from both sides: 3x = −12

2. Divide both sides by 3: x = −12 ÷ 3 = −4

Check it by substituting back: 3(−4) + 12 = −12 + 12 = 0. The equation holds, so x = −4 is correct. You can confirm any solution instantly with the Linear Equation Solver, which applies x = −b ÷ a and returns the value of x.

A second example with rearrangement. Real problems rarely arrive in tidy ax + b = 0 form. Solve 5x − 7 = 2x + 8.

1. Move the variable terms together — subtract 2x from both sides: 3x − 7 = 8

2. Move the constants together — add 7 to both sides: 3x = 15

3. Divide by 3: x = 5

Notice the pattern: collect the x terms on one side, collect the numbers on the other, then divide. Once an equation is in the form ax + b = 0, the solver handles the final step in one click.

Where Linear Equations Show Up

Seeing the structure in word problems is half the battle. A few common patterns:

Flat fee plus rate. A plumber charges a $50 call-out fee plus $40 per hour. If the bill is $210, then 40x + 50 = 210, giving x = 4 hours.

Break-even style problems. Costs equal revenue when a linear expression for cost equals a linear expression for income — set them equal and solve for the quantity.

Unit conversions and proportions. Many "find the missing value" problems rearrange into ax + b = 0 after cross-multiplying.

Slope-intercept intercepts. To find where a line y = mx + b crosses the x-axis, set y = 0 and solve mx + b = 0 — exactly our formula. A slope calculator and linear solving go hand in hand when analyzing lines.

In every case, the work is the same: translate the words into ax + b = 0, then isolate x.

Common Mistakes and How to Avoid Them

Sign errors. Moving a term across the equals sign flips its sign. Forgetting to do so — turning −b into +b — is the single most common mistake. Write each step out rather than skipping ahead.

Dividing too early. Always clear the constant before dividing by the coefficient. Dividing by a while b is still attached to the x term leads to errors.

Dividing by zero. If the coefficient of x turns out to be zero, there is no unique solution. Recognize this rather than forcing an answer.

Only operating on one side. Whatever you do — add, subtract, multiply, divide — you must do to both sides. Changing one side alone breaks the equality.

Skipping the check. Substituting your answer back into the original equation catches nearly every arithmetic slip. It takes seconds and is the best habit you can build.

Conclusion

Solving ax + b = 0 comes down to one elegant idea: keep the equation balanced while you peel away everything that is not x, and you arrive at x = −b ÷ a. That method — subtract the constant, divide by the coefficient, then verify — scales seamlessly from this simplest case to systems, lines, and applied models throughout mathematics. Practice the rearranging step until spotting the linear structure in a word problem feels automatic, always check your answer, and the rest of algebra will rest on solid ground.

Key Takeaways

Know the formula: For ax + b = 0, the solution is x = −b ÷ a, valid for any nonzero coefficient a

Isolate step by step: Subtract the constant from both sides first, then divide by the coefficient — never divide before clearing the constant

Watch your signs and your zeros: Sign errors and dividing by zero cause most mistakes; if a = 0 there is no single solution

Verify with substitution: Plug your answer back into the original equation, or check it with the Linear Equation Solver, to confirm it is correct

Looking for a calculator?

Calculator Collection has 4,000+ free calculators. Browse all calculators →