Connect via MCP →

Enter Calculation

Solves a·x + b = 0 for x.

Formula

Advertisement

Results

Solution
x = 1
satisfies a·x + b = 0
Equation 2·x + (-2) = 0
Solution type unique solution
x-intercept (1, 0)
y-intercept (0, -2)
Slope 2

What this calculator does

This tool solves the linear (first-degree) equation \(a\cdot x + b = 0\) for the unknown x. A linear equation is one where the variable appears only to the first power, so its graph is always a straight line. This is pure mathematics and works identically everywhere — there are no region-specific rules.

How to use it

Enter the coefficient a (the number multiplying x) and the constant term b. Press calculate and you get the value of x, the solution type, and the geometric description of the line \(y = a\cdot x + b\): its slope, its y-intercept (0, b), and its x-intercept (x, 0).

The formula explained

Starting from \(a\cdot x + b = 0\), subtract b from both sides to get \(a\cdot x = -b\), then divide by a:

$$x = -\frac{b}{a}$$

This division is only valid when a is not zero. The calculator guards against dividing by zero and reports the special cases instead.

Graph of a line crossing the x-axis at x equals minus b over a
The solution of ax + b = 0 is the point where the line crosses the x-axis.

Worked example

With the default values \(a = 2\) and \(b = -2\) the equation is \(2x - 2 = 0\). Solving: \(2x = 2\), so \(x = 1\). The line \(y = 2x - 2\) has slope 2, crosses the y-axis at −2 and the x-axis at (1, 0).

Worked example showing b moved to the other side then divided by a
Solving step by step: isolate x by subtracting b and dividing by a.

FAQ

What if a = 0 and b is not zero? The equation collapses to \(b = 0\), which is false, so there is no solution.

What if both a and b are zero? The equation becomes \(0 = 0\), which is true for every value of x, so there are infinitely many solutions — any real number works.

Can I enter decimals or negatives? Yes. The coefficient and constant can be any real number, positive, negative, or fractional in decimal form, and the result x may be negative, zero, or positive.

Last updated: