Advertisement

Quadratic formula calculator

Enter the coefficients a, b and c of ax² + bx + c = 0. The roots and the discriminant update as you type.

Calculator

a multiplies x². It cannot be zero, or the equation is not quadratic.

Roots
2 and 3
Discriminant b² - 4ac
1.000000

Advertisement

How this calculator works

Every quadratic equation ax² + bx + c = 0 with a ≠ 0 can be solved with the quadratic formula. The discriminant b² - 4ac decides the kind of answer: positive gives two different real roots, zero gives one repeated root, and negative gives a complex conjugate pair. Roots are shown in ascending order for real solutions.

Formula

Δ = b² - 4ac and x = (-b ± √Δ) / (2a). When Δ < 0, x = -b/(2a) ± (√(-Δ) / (2|a|))i.

Worked example

For x² - 5x + 6 = 0, Δ = 25 - 24 = 1, so x = (5 ± 1)/2, which gives the roots 2 and 3. For x² - 4x + 4 = 0, Δ = 0 and the double root is 2. For x² + 2x + 5 = 0, Δ = -16 and the roots are -1 ± 2i.

Advertisement

Frequently asked questions

Why must a not be zero?

The formula divides by 2a. With a = 0 the equation collapses to bx + c = 0, a linear equation with at most one root, so it is not solved here.

What is a double root?

When the discriminant is exactly zero, both branches of the formula give the same value. The parabola touches the x axis at that single point.

How accurate are the roots?

Roots are shown with up to 6 significant digits and trailing zeros dropped. Floating-point arithmetic has finite precision, so very large or very small coefficients may not give reliable roots.

Sources

Advertisement