Equation Solver

Solve linear equations in the form ax + b = c. Enter your equation and get the value of x instantly.

Solving linear and quadratic equations

A linear equation has exactly one solution unless it has none or infinitely many. A quadratic has two, which may coincide or may be complex. Knowing which case you are in before you start saves you from misreading a valid "no solution" as an error.

Formula

Linear: ax + b = 0 => x = -b / a | Quadratic: ax^2 + bx + c = 0 => x = (-b +/- sqrt(b^2 - 4ac)) / 2a

Both require a to be non-zero. If a = 0 in a quadratic, it is really a linear equation.

The three outcomes of a linear equation

Rearranging ax + b = 0 gives x = -b/a, provided a is not zero. When a is zero, two distinct things can happen and they mean opposite things.

  • a is non-zero: exactly one solution, x = -b/a. The normal case.
  • a = 0 and b is non-zero: the equation reduces to b = 0, which is false. No solution exists. Graphically, two parallel lines that never meet.
  • a = 0 and b = 0: the equation reduces to 0 = 0, true for every x. Infinitely many solutions. Graphically, the same line twice.
  • The last two cases are not failures of the method. In systems of equations they signal an inconsistent or an under-determined model, which is genuine information.

The discriminant tells you the answer before you solve

For a quadratic, the quantity D = b^2 - 4ac under the square root determines the nature of the roots without computing them.

  • D > 0: two distinct real roots. The parabola crosses the x-axis twice.
  • D = 0: one repeated real root at x = -b/2a. The parabola touches the axis at its vertex.
  • D < 0: two complex conjugate roots. The parabola never touches the axis. In physical models this usually means the condition you are solving for cannot occur.
  • D being a perfect square additionally tells you the roots are rational, which means the quadratic factorises neatly over the integers.

Checks that catch arithmetic errors

Vieta's formulas give two independent checks that take seconds. For ax^2 + bx + c = 0, the sum of the roots is -b/a and their product is c/a.

If your two roots do not sum to -b/a, you have made an error. This catches sign mistakes, which are by far the most frequent, and it is faster than substituting back into the original equation.

One numerical warning: when b^2 is much larger than 4ac, the standard formula subtracts two nearly equal numbers for one of the roots and loses precision. The stable alternative computes the larger root first, then obtains the smaller as c / (a x larger root).

Worked example

Solve 2x^2 - 7x + 3 = 0. Here a = 2, b = -7, c = 3.

Discriminant: D = 49 - 24 = 25, a perfect square, so expect two rational roots.

Roots: x = (7 +/- 5) / 4, giving x = 3 and x = 0.5.

Check with Vieta: the sum should be -b/a = 3.5, and 3 + 0.5 = 3.5. The product should be c/a = 1.5, and 3 x 0.5 = 1.5. Both hold, so the answer is confirmed without substitution.

Reading the discriminant

b^2 - 4acRootsGraph
Positive, perfect squareTwo rationalCrosses axis at two rational points
Positive, not a perfect squareTwo irrationalCrosses axis twice
ZeroOne repeated realTouches axis at the vertex
NegativeTwo complex conjugatesNever touches the axis

Frequently Asked Questions

No. It means no value of x satisfies the equation. For a linear equation it indicates parallel lines; for a quadratic with negative discriminant it means the parabola never reaches zero. Both are valid, informative results.

The algebra does not know your physical constraints. A negative time, a negative length, or a probability above 1 is mathematically valid and physically meaningless. Discarding it is legitimate, but state the reason rather than assuming.

Only when the roots are rational, which happens when the discriminant is a perfect square. The quadratic formula works in every case, so it is the safer default.

It converts ax^2 + bx + c into a(x + p)^2 + q, which immediately gives the vertex at (-p, q). It is also how the quadratic formula is derived, and it is the standard route to integrating certain rational functions.

A general cubic formula exists but is unwieldy. Quartics also have one. Abel and Ruffini proved that no general algebraic formula exists for degree five and above, so those are solved numerically.

Related calculators

References

Last reviewed: 2026-08-07. This page is informational. For legal, medical, tax, or financial decisions, confirm the result with a qualified professional.