Clever Quest Lab Tools

Quadratic Equation Solver

2026-09-24

Type the coefficients of ax² + bx + c = 0 and get both roots—real or complex, exact and decimal—together with the discriminant, vertex, factored form, a graph of the parabola and a step-by-step solution. Useful for checking algebra homework or getting a reliable answer fast.

ax² + bx + c = 0 (enter a, b and c)

Try an example:

x² − 5x + 6 = 0

    Point at the graph (or tap it) to read coordinates.

    Step-by-step solution

      How to use the quadratic equation solver

      1. Rearrange your equation so that one side is zero. For example, x² = 5x − 6 becomes x² − 5x + 6 = 0.
      2. Enter a, b and c. Negative numbers, decimals (0.25), fractions (3/4) and scientific notation (1e-8) all work. If a term is missing, enter 0. The ± button flips the sign, which helps on phone keypads without a minus key.
      3. Read the roots in the result box. Exact answers use fractions, square roots and i; decimals are rounded to 10 significant digits.
      4. Follow the step-by-step solution, and use the graph to see where the parabola meets the x-axis.

      All calculations run locally in your browser; nothing you type is sent to a server.

      How the quadratic formula works

      A quadratic equation has the form ax² + bx + c = 0 with a ≠ 0. Its solutions, called roots, are given by the quadratic formula:

      x = −b ± √b² − 4ac2a

      Here a is the coefficient of x², b is the coefficient of x and c is the constant term. The expression under the square root, D = b² − 4ac, is the discriminant. The ± sign produces the two roots, one with plus and one with minus, and the whole numerator, including −b, is divided by 2a.

      Where the formula comes from

      The formula is what you get by completing the square on the general equation:

      1. Divide by a: x² + (b/a)x + c/a = 0
      2. Move the constant: x² + (b/a)x = −c/a
      3. Add (b/2a)² to both sides: x² + (b/a)x + b²/(4a²) = b²/(4a²) − c/a
      4. The left side is now a perfect square: (x + b/(2a))² = (b² − 4ac)/(4a²)
      5. Take the square root of both sides: x + b/(2a) = ±√(b² − 4ac)/(2a)
      6. Subtract b/(2a): x = (−b ± √(b² − 4ac))/(2a)

      Vertex, axis of symmetry and Vieta's formulas

      The graph of y = ax² + bx + c is a parabola that opens upward when a > 0 and downward when a < 0. Its vertex lies at x = −b/(2a), halfway between the roots, on the axis of symmetry. The vertex height is −D/(4a), which gives the vertex form y = a(x − h)² + k, and the graph crosses the y-axis at (0, c). Vieta's formulas link the roots to the coefficients: x₁ + x₂ = −b/a and x₁ · x₂ = c/a. The solver uses them as a final check.

      Precision and limits

      Exact answers come from exact arithmetic: decimals and fractions become ratios of whole numbers (0.1 is exactly 1/10), so the discriminant and the simplified roots are exact. Decimals use a numerically stable form of the formula. When b² is much larger than 4ac, −b and √D nearly cancel in one root and floating-point arithmetic loses digits, a problem described in David Goldberg's 1991 paper What Every Computer Scientist Should Know About Floating-Point Arithmetic. The solver computes q = −(b + sign(b)·√D)/2, then x₁ = q/a and x₂ = c/q. For 0.00000001x² + x + 1 = 0 it returns −1.00000001 and −99,999,999, while the textbook formula gives −1.0000000106 for the small root. Coefficients may be 0 or between 10⁻¹² and 10¹² in size.

      Examples

      Example 1: two rational roots

      Solve x² − 5x + 6 = 0. Here a = 1, b = −5 and c = 6, so D = (−5)² − 4·1·6 = 25 − 24 = 1. Because 1 is a perfect square, the roots are rational: x = (5 ± 1)/2, which gives x₁ = 2 and x₂ = 3. The factored form is (x − 2)(x − 3), and the vertex is (2.5, −0.25).

      Example 2: irrational roots that simplify

      Solve 2x² − 4x − 5 = 0. D = (−4)² − 4·2·(−5) = 16 + 40 = 56. Since 56 = 4·14, √56 = 2√14 and x = (4 ± 2√14)/4. Dividing the numerator and the denominator by 2 gives x = (2 ± √14)/2, so x₁ ≈ −0.8708286934 and x₂ ≈ 2.870828693. The vertex is (1, −7).

      Example 3: complex roots

      Solve x² + 2x + 5 = 0. D = 2² − 4·1·5 = 4 − 20 = −16, so there are no real roots: the parabola stays above the x-axis, with its lowest point at (−1, 4). Since √(−16) = 4i, x = (−2 ± 4i)/2 = −1 ± 2i, so x₁ = −1 − 2i and x₂ = −1 + 2i.

      What the discriminant tells you

      DiscriminantRootsGraph
      D > 0 and a perfect square*Two distinct rational rootsCrosses the x-axis twice
      D > 0, not a perfect squareTwo distinct irrational roots, p ± q√mCrosses the x-axis twice
      D = 0One real double root, x = −b/(2a)Touches the x-axis at the vertex
      D < 0Two complex conjugate roots, p ± qiNever reaches the x-axis

      *The perfect-square test applies when a, b and c are integers (or fractions).

      Other ways to solve a quadratic equation

      Common mistakes

      Frequently asked questions

      Can a quadratic equation have only one solution?

      Yes, when the discriminant is zero. Both roots then coincide at x = −b/(2a), which is called a double root, and the parabola touches the x-axis at its vertex. For example, x² + 2x + 1 = (x + 1)² has the double root x = −1.

      What does a negative discriminant mean?

      The equation has no real solutions, so its graph never crosses the x-axis. It still has two complex solutions, p ± qi, with p = −b/(2a) and q = √(−D)/(2|a|); with real coefficients they always form a conjugate pair.

      What happens if a = 0?

      The x² term disappears and the equation becomes linear, bx + c = 0, with the single solution x = −c/b. The solver says so and solves the linear equation instead. If b is also 0, there is no solution (c ≠ 0) or every x works (c = 0).

      How can I tell whether a quadratic can be factored?

      For integer coefficients, check the discriminant. If it is a perfect square (0, 1, 4, 9, 16 and so on), the roots are rational and the quadratic factors into linear factors with integer coefficients. If it is not, the roots are irrational or complex and factoring over the integers will not work.

      Can I enter fractions or decimals?

      Yes. Type values such as 3/4, −0.2 or 2.5e-3. They are treated as exact numbers, so 0.5x² − 4.5x + 2 = 0 still gets an exact answer, x = (9 ± √65)/2, found by multiplying the equation by 2 to clear the decimals.

      Related tools