Linear Equation Solver – Solve ax + b = 0 and ax + b = cx + d
A linear equation is any first-degree equation in one variable — the variable appears only to the power of 1, with no squares, cubes, or roots attached to it. Linear equations are the building block of algebra: they show up when converting units, splitting a bill, finding a break-even point, or working out how long it takes two moving objects to meet. This tool solves both the simple one-sided form ax + b = 0 and the more general two-sided form ax + b = cx + d, where a, b, c, and d are numbers you supply.
How the Solver Works
Every two-sided equation can be reduced to the simple form by moving all the x terms to one side and all the constants to the other. The solver computes A = a − c (the combined coefficient of x) and B = d − b (the combined constant). When A is not zero, the unique solution is x = B / A. The tool then substitutes that value back into both sides of the original equation to verify that the left-hand side equals the right-hand side, and it shows every intermediate algebraic step so you can follow — or double-check — the work by hand.
Identities and Contradictions
Not every linear equation has exactly one solution. If A = 0 (meaning the coefficient of x is the same on both sides) there are two possibilities. When the constants also match (B = 0), the equation is an identity — both sides are literally the same expression, so any real number satisfies it, giving infinitely many solutions. When the constants differ (B ≠ 0), the equation collapses to a false statement like 0 = 4, which is a contradiction with no solution at all. Recognizing these two edge cases is a common stumbling block for students, so the solver labels them explicitly instead of throwing a division-by-zero error.
Exact Fractions and Mixed Numbers
Many linear equations produce a solution that isn't a whole number. Rather than only showing a rounded decimal, the solver converts the result into an exact, fully reduced fraction using a continued-fraction algorithm, then also offers a mixed-number representation. You can toggle between decimal, fraction, and mixed-number output, and adjust the decimal precision from 0 to 10 places for the numeric display.
Graphing the Equation
Algebraically, solving ax + b = cx + d is the same as finding where the two lines y = ax + b and y = cx + d cross. The tool plots both lines and marks their intersection point, whose x-coordinate is the solution to the equation. When the equation is a contradiction, the lines are parallel and never meet; when it's an identity, the two lines are coincident — they lie exactly on top of each other.
Free-Form Equation Input
If you'd rather type the equation as written, switch to free-form mode and enter something like 4(x - 2) = 2x + 6. The parser expands parentheses, combines like terms on each side, and feeds the resulting coefficients into the same solver. It supports a single variable (x) and degree-1 terms only; entering something like x^2 or a second variable will return a clear error message pointing you toward the right tool.
x² term, try the Quadratic Equation Solver instead; for two or more equations solved simultaneously, use the System of Equations Solver.