Linear Equations: How to Solve ax + b = 0 for x
Any linear equation in one variable can be written as ax + b = 0, and its solution is x = −b ÷ a (as long as a is not zero). The method behind that formula, doing the same operation to both sides until x stands alone, is the same one you use for systems of equations, intercepts of lines, and most word problems about cost, rate and distance. This guide shows the steps, two worked examples, and the common slips.
What a Linear Equation Is
A linear equation in one variable is any equation that can be written as ax + b = 0, where a and b are known numbers and x is the unknown. "Linear" refers to the graph: y = ax + b is a straight line, and solving ax + b = 0 finds where that line crosses the x-axis. The variable appears only to the first power, never squared or inside a root, which is what keeps these equations so predictable.
Linear relationships describe everyday situations surprisingly 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 is ax + b in disguise.
How to Solve ax + b = 0
The goal is to get x by itself on one side of the equals sign. Whatever you do to one side you do to the other, which keeps the equation balanced. Starting from ax + b = 0:
1. Subtract b from both sides: ax = −b
2. Divide both sides by a: x = −b ÷ a
So the general solution is:
x = −b ÷ a
The one caveat is that a cannot be zero, because division by zero is undefined. If a = 0 the equation collapses to b = 0, which is either always true (every x works) or never true (no solution); there is no single value of 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 by substituting back: 3(−4) + 12 = −12 + 12 = 0.
A second example with rearrangement. Real problems rarely arrive tidy. Solve 5x − 7 = 2x + 8.
1. Collect the variable terms: subtract 2x from both sides to get 3x − 7 = 8
2. Collect the constants: add 7 to both sides to get 3x = 15
3. Divide by 3: x = 5
Check: 5(5) − 7 = 18 and 2(5) + 8 = 18. In ax + b = 0 form the equation after step 1 and 2 is 3x − 15 = 0, so a = 3 and b = −15, and −(−15) ÷ 3 = 5.
Where Linear Equations Show Up
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, so 40x − 160 = 0 and x = 4 hours.
Break-even problems. Costs equal revenue when a linear cost expression equals a linear income expression. Set them equal, collect terms, and solve for the quantity.
Intercepts of a line. To find where y = mx + b crosses the x-axis, set y = 0 and solve mx + b = 0, which is exactly this formula. If you only have two points on the line, the Slope Calculator gives m as (y₂ − y₁) ÷ (x₂ − x₁) first.
Two unknowns. When a problem has two variables and two linear equations, the same balancing idea applies, but you eliminate one variable at a time. The 2x2 Linear System Solver solves ax + by = e and cx + dy = f directly and tells you when the lines are parallel and there is no unique answer.
Not linear after all. If the variable appears squared, you have a quadratic, and the Quadratic Formula Calculator is the right tool.
Common Mistakes
Sign errors. Moving a term across the equals sign flips its sign. Turning −b into +b is the single most common mistake. Write each step out.
Dividing too early. Clear the constant before dividing by the coefficient. Dividing by a while b is still attached produces fractions in the wrong place.
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.
Operating on one side only. Whatever you do, add, subtract, multiply or divide, must be done to both sides. Changing one side alone breaks the equality.
Skipping the check. Substituting your answer into the original equation catches nearly every arithmetic slip and takes seconds.
For the coordinate-geometry side of working with lines, the Midpoint Calculator finds the point halfway between two endpoints.
Sources
- OpenStax — Elementary Algebra, 2.1 Solve Equations Using the Subtraction and Addition Properties of Equality
- LibreTexts Mathematics — Prealgebra (OpenStax), 8.1 Solve Equations Using the Subtraction and Addition Properties of Equality/08%3A_Solving_Linear_Equations/8.01%3A_Solve_Equations_Using_the_Subtraction_and_Addition_Properties_of_Equality_(Part_1))