Linear Equation Solver

This tool solves linear equations of the form $ax + b = 0$ and shows the solution step by step by isolating $x$. Enter $a$ and $b$ as numbers (decimals are allowed). The solver also handles the special cases where $a=0$ (no solution or infinitely many solutions). For more algebra tools, explore Algebra.

Enter coefficients a and b to solve ax + b = 0.

Coefficient of x.

Constant term.

What Is a Linear Equation?

A linear equation in one variable has the variable only to the first power and can be written in the standard form $$ax + b = 0$$ where $a$ and $b$ are constants. When $a\ne 0$, the equation has exactly one solution for $x$.

How the Solver Works

The solver isolates $x$ using algebraic moves that keep the equation balanced on both sides. It first moves the constant term, then divides by the coefficient of $x$:

$$ax + b = 0 \;\Rightarrow\; ax = -b \;\Rightarrow\; x=\frac{-b}{a}$$

Input Rules and Edge Cases

  • Decimals are allowed: $a$ and $b$ can be integers or decimals.
  • If $a=0$ and $b\ne 0$: no solution (the equation becomes a contradiction like $7=0$).
  • If $a=0$ and $b=0$: infinitely many solutions (the equation becomes $0=0$).
  • Formatting: results are shown with the tool’s configured decimal precision.

If your equation includes an $x^2$ term, use the Quadratic Equation Solver. If you have two linear equations with two variables, use the 2x2 System of Equations Solver.

Worked Examples With Steps

Example 1: Unique solution

Solve a typical linear equation where $a\ne 0$.

Solve: $$3x-12=0$$

Move the constant term: $$3x=12$$

Divide by $3$: $$x=\frac{12}{3}=4$$

Example 2: Negative coefficient

Negative coefficients are handled the same way - isolate $x$ and divide.

Solve: $$-2x+5=0$$

Move the constant term: $$-2x=-5$$

Divide by $-2$: $$x=\frac{-5}{-2}=2.5$$

Example 3: No solution

When $a=0$ but $b\ne 0$, the equation has no solution.

Solve: $$0x+7=0$$

This simplifies to: $$7=0$$ which is impossible, so there is no solution.

Example 4: Infinitely many solutions

When $a=0$ and $b=0$, every value of $x$ satisfies the equation.

Solve: $$0x+0=0$$

This is: $$0=0$$ which is always true, so there are infinitely many solutions.

Keep exploring Mathematics or jump back to Calculators to browse more tools.

Questions About the Linear Equation Solver

Quick answers about ax + b = 0, solutions, and edge cases.

Trusted by thousands of users every month. Fast, accurate and privacy-friendly tools.