🧮
🧮 Math & statistics

Quadratic Equation Solver (ax² + bx + c = 0)

Results update as you type.

Your numbers

Understanding the quadratic equation solver — concept and principle

A quadratic equation has the form ax² + bx + c = 0 with a ≠ 0. Its graph is a parabola, and its roots are the x-values where the parabola crosses or touches the x-axis. Quadratics appear in projectile motion, area and optimisation problems and break-even analysis. This solver gives both roots (real or complex), the discriminant, the vertex of the parabola and the type of roots.

Solving x² − 3x + 2 = 0 with the quadratic formulaWith −b = 3, square root of the discriminant 1 and 2a = 2, x = (3 ± 1) ÷ 2 gives 2 and 1; the parabola crosses the axis there.x² − 3x + 2 = 012vertex (1.5, −0.25)−b = 3√(b² − 4ac) = √1 = 12a = 2(3 ± 1) ÷ 2x = 2, x = 1D = 9 − 8 = 1 > 0 → two real roots
The formula’s three pieces give the two points where the parabola crosses zero.

How it is calculated

If you enter a = 0 the equation is linear, and the solver returns x = −c/b instead.

The principle

The formula comes from completing the square. Divide by a and rewrite: x² + (b/a)x = −c/a. Add (b/2a)² to both sides so the left side becomes a perfect square: (x + b/2a)² = (b² − 4ac)/(4a²). Taking the square root of both sides gives x + b/2a = ±√D/(2a), which is the quadratic formula. The discriminant is the quantity under the square root, so its sign decides whether real square roots exist.

Worked example

  1. Inputs: a = 1, b = −3, c = 2, so the equation is x² − 3x + 2 = 0.
  2. D = (−3)² − 4 × 1 × 2 = 9 − 8 = 1.
  3. √D = 1, so x = (3 ± 1) ÷ 2, giving 2 and 1.
  4. Vertex x = −(−3) ÷ 2 = 1.5; vertex y = 2 − 9 ÷ 4 = −0.25, so the vertex is (1.5, −0.25).
  5. D > 0, so there are two real roots. Check: (x − 1)(x − 2) = x² − 3x + 2.

How to read the result

The sum of the roots is −b/a and their product is c/a (Vieta's formulas): here 2 + 1 = 3 and 2 × 1 = 2. If a > 0 the parabola opens upward and the vertex is its minimum; if a < 0 it opens downward and the vertex is a maximum. A discriminant close to zero means the two roots are close together and are sensitive to small changes in the coefficients.

Common mistakes

Keep in mind: Results are computed in floating-point arithmetic. When b² is much larger than 4ac, one root can lose accuracy through cancellation, so verify critical values by substituting them back into the equation.

Frequently asked questions

What if the discriminant is negative?

The equation has no real roots; the parabola stays entirely above or below the x-axis. The roots are complex conjugates p ± qi.

Can I factor instead of using the formula?

Yes, when the roots are rational. Look for two numbers whose product is ac and sum is b. The formula always works.

How do I find the axis of symmetry?

It is the vertical line x = −b/(2a), which passes through the vertex and lies halfway between the roots.

Sources: M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions, NBS Applied Mathematics Series 55, §3.8.1 · W. H. Press et al., Numerical Recipes, Cambridge University Press, §5.6 Quadratic and Cubic Equations

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

</> Add this calculator to your website (free)

Copy this code into your blog or site. It is free to use; please keep the credit link.

Preview
🧮 All math & statistics tools →🌍 Calculators by country →