Skip to content
Calculator Collection

Linear Equation Solver

Solve any single-variable linear equation of the form ax + b = 0 for the unknown x. The simplest non-trivial equation in algebra, this is the building block for systems of equations, slope-intercept lines, and almost every applied modelling problem.

Last updated: May 2026

Compare with similar

About this calculator

A linear equation in one variable takes the form ax + b = 0, where a and b are real-number coefficients (a ≠ 0) and x is the unknown. Rearranging gives x = -b / a — the calculator returns exactly this value. The equation describes a horizontal-line cross-section of a linear function y = ax + b (the x-intercept), and geometrically the solution is the x-coordinate where the line crosses the x-axis. Variables: a is the coefficient of x (must be non-zero for a unique solution), b is the constant term. Edge cases: if a = 0 and b ≠ 0, the equation 0·x + b = 0 has no solution (no value of x makes it true — the line is horizontal and never crosses the x-axis); if a = 0 and b = 0, every real x is a solution (the equation is the trivial 0 = 0). This calculator does not handle these degenerate cases — it will return NaN or Infinity. For equations of the form cx + d = e, rearrange first to (c)x + (d − e) = 0 before entering. Linear equations always have at most one real solution because their graph is a straight line; this property is what makes them so much easier to solve than quadratic, cubic, or higher-degree equations. Real-world applications: unit conversions, break-even analysis, simple physics (constant velocity), basic finance (linear depreciation), and the foundational scaling laws in economics and biology.

How to use

Example 1 — Standard solve. Solve 2x + 6 = 0. Enter a = 2, b = 6. Result: x = -6 / 2 = -3. ✓ Verify: 2(-3) + 6 = -6 + 6 = 0 ✓. The equation has exactly one solution, x = -3, which is the x-intercept of the line y = 2x + 6. Example 2 — Equation needing rearrangement. Solve 4x = 12. Rearrange to 4x − 12 = 0, so a = 4 and b = -12. Enter a = 4, b = -12. Result: x = -(-12) / 4 = 12 / 4 = 3. ✓ Verify: 4(3) = 12 ✓. This rearrangement step trips up beginners — always move everything to one side and set the equation to 0 before identifying a and b.

Frequently asked questions

What does "linear" mean in linear equation?

Linear means that the variable appears only to the first power — no x², √x, 1/x, sin(x), or other non-linear terms. The graph of y = ax + b is a straight line (Latin linea = line), which is where the name comes from. More generally, a linear equation in any number of variables is one where each variable appears at most to the first power and no products of variables are present: 3x + 2y − z = 7 is linear, but xy = 6 or x² + y = 9 are not. Linearity is the property that makes equations tractable: linear systems of any size have algorithmic solutions (Gaussian elimination, matrix inversion), and almost every "complex" problem in applied mathematics is approached by linearising it first.

What happens if a = 0?

The equation becomes 0·x + b = 0, which simplifies to b = 0. If b is also 0, every real number is a solution (the equation is the trivial identity 0 = 0). If b is non-zero, there is no solution — the equation asserts a contradiction (e.g., 0·x + 5 = 0 means 5 = 0, which is false for any x). This calculator does not handle the degenerate case: division by zero produces NaN or Infinity. Whenever you see a = 0 in a linear-equation problem, stop and interpret manually — the answer is "no solution" or "every x", not a single value.

How do I solve equations like 3x + 5 = 2x − 4?

Rearrange to standard form ax + b = 0 first: subtract 2x from both sides to get x + 5 = -4, then subtract 5 to get x + 9 = 0. Now a = 1 and b = 9, giving x = -9. The general procedure for any linear equation: (1) expand parentheses and collect like terms; (2) move all variable terms to one side and constants to the other; (3) divide both sides by the coefficient of the variable. Each step preserves equality, so the final value satisfies the original equation. Always verify by substituting the answer back into the original — if it does not produce a true statement, an algebraic error crept in somewhere.

What are the most common mistakes people make solving linear equations?

The first is sign errors when rearranging: moving a term from one side to the other flips its sign, and forgetting to flip is a classic trap. The second is dividing both sides by a variable (rather than a constant), which can lose solutions or introduce extraneous ones if that variable could be zero. The third is mis-identifying a and b when the equation is not in standard form — for 3x − 7 = 0, a = 3 and b = -7, not 7. The fourth is treating "no solution" or "infinitely many solutions" as errors rather than valid outcomes; both are legitimate answers for degenerate linear equations. The fifth is forgetting to check the answer by substitution — a 30-second verification catches algebra mistakes that a "right-looking" final number cannot.

When should I not use this calculator?

Skip it for non-linear equations — quadratics (x² + bx + c = 0), cubics, exponentials (eˣ = k), trigonometric (sin x = c), or logarithmic equations all need their own solvers. Do not use it for systems of multiple linear equations; use a system-of-equations solver (2x2, 3x3, or general n×n) instead. It is the wrong tool for inequalities (3x + 5 > 0) — those need an inequality solver and have ranges as solutions, not single values. Avoid it when a is 0 — the equation is degenerate and this calculator cannot represent "no solution" or "all reals" as outputs. Finally, do not use it for parametric or symbolic algebra (solve for x in ax + b = c with a, b, c as symbols, not numbers) — that needs a computer algebra system.

Sources & references