Percentages and Math

Quadratic Equation Solver

Enter a, b and c to get the roots, discriminant, vertex and factored form with the steps shown.

Your numbers

Result

Two real roots

x1 = 1, x2 = 2

x^2 - 3x + 2 = 0

Discriminant (D)
1
Root x1
1
Root x2
2
Factored form
(x - 1)(x - 2)
Vertex
(1.5, -0.25)
Axis of symmetry
x = 1.5
Parabola opens
Upward (minimum at the vertex)
y-intercept
2
Sum of roots (-b / a)
3
Product of roots (c / a)
2
How this was calculated
  1. Standard form: x^2 - 3x + 2 = 0 with a = 1, b = -3, c = 2.
  2. Discriminant D = b^2 - 4ac = (-3)^2 - 4(1)(2) = 1.
  3. D > 0, so there are two distinct real roots.
  4. Stable formula: q = -(b + sign(b) x sqrt(D)) / 2, then x1 = q / a and x2 = c / q. This avoids subtracting nearly equal numbers when b is large.
  5. The roots are rational, so the equation factors as (x - 1)(x - 2) = 0.
  6. Vertex: h = -b / 2a = 3/2 (1.5), and k = c - b^2 / 4a = -1/4 (-0.25). Vertex form: y = (x - 1.5)^2 - 0.25.

Next step

How to use the quadratic equation solver

  1. Write your equation as ax² + bx + c = 0 and enter a, b and c. Decimals and negatives are fine.
  2. Read the roots, which are real numbers or a complex pair.
  3. Check the discriminant, vertex, axis of symmetry and factored form. Open the steps to see how each value was found.

Formula

D = b^2 - 4ac

x = (-b +/- sqrt(D)) / (2a)

Vertex: h = -b / (2a), k = c - b^2 / (4a)

Stable form: q = -(b + sign(b) x sqrt(D)) / 2, x1 = q / a, x2 = c / q

The two forms give the same roots. The stable form avoids subtracting two nearly equal numbers, which can wipe out the digits of the smaller root.

Worked examples

x² - 3x + 2 = 0: D = 9 - 8 = 1, so x = (3 ± 1) / 2 gives x = 1 and x = 2. It factors as (x - 1)(x - 2). The vertex is h = 1.5 and k = 2 - 9/4 = -0.25.

x² + 2x + 5 = 0: D = 4 - 20 = -16. There are no real roots, and the roots are -1 ± 2i.

x² - 2x + 1 = 0: D = 0, so there is one repeated root, x = 1, and the factored form is (x - 1)².

x² + 100000000x + 1 = 0: the large root is about -100,000,000. The product of the roots is c / a = 1, so the small root is 1 / (-100,000,000) = -1e-8. The stable formula keeps it, while the textbook formula returns a value with no correct digits.

What the discriminant tells you

When D is positive there are two distinct real roots and the parabola crosses the x-axis twice. When D is zero it touches the axis once at its vertex. When D is negative it never crosses, and the roots are a complex conjugate pair. The tool computes D exactly from your decimal digits, so a value that should be zero is never reported as a tiny positive or negative number.

Factoring and exact roots

If D is a perfect square and the coefficients are decimals or whole numbers, the roots are rational and the tool shows them as exact fractions along with a factored form such as 2(x - 1/2)(x - 1). Otherwise the roots are irrational, and the quadratic does not factor over the rationals, so decimals are shown to 10 significant digits.

Vertex, axis and shape

The vertex is the turning point of the parabola, at x = -b / 2a. The parabola opens upward when a is positive, with a minimum at the vertex, and downward when a is negative, with a maximum. The sum of the roots is -b / a and the product is c / a, which gives a quick check on any answer. For right triangles that lead to quadratics, see the Pythagorean theorem calculator, and for evaluating expressions use the scientific calculator.

If a is zero

Then the equation is linear, bx + c = 0, and has one solution x = -c / b. The tool says so instead of dividing by zero. If both a and b are zero there is either no solution or every x works.

Assumptions and limits

  • Coefficients can be up to 1e12 in size with at most 12 decimal places, so the discriminant can be computed exactly.
  • Complex roots are shown as a real part plus or minus an imaginary part with i.
  • Roots are shown to 10 significant digits. Exact fractions appear when the roots are rational.
  • The factored form is shown only when the roots are rational.
  • Everything is computed in your browser and nothing is stored.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

What is the quadratic formula?

For ax² + bx + c = 0 with a not zero, x equals negative b plus or minus the square root of b squared minus 4ac, all over 2a. It finds every root, real or complex.

What does it mean when the discriminant is negative?

The square root of a negative number is not real, so the equation has no real solutions. The parabola does not meet the x-axis, and the two roots are complex numbers that are conjugates of each other.

How can I check my roots by hand?

Add them and compare with -b / a, then multiply them and compare with c / a. For x² - 3x + 2 the roots 1 and 2 add to 3 and multiply to 2, which matches.

Why does the calculator not use the textbook formula directly?

When b is much larger than a and c, subtracting b and the square root of D cancels almost every digit. The stable version computes the large root first and gets the small one from the product of roots, so both are accurate.

Can I solve equations that are not in standard form?

Move every term to one side first so the right side is zero, then collect the x² terms, the x terms and the constants into a, b and c.