Skip to main content
Viva Calculator

Discriminant Calculator

Calculate discriminant and roots of quadratic equations

Calculate Discriminant
Quadratic Equation: ax² + bx + c = 0

Method and source check

Last checked:

Automated source and implementation review, including worked examples and documented numerical limits. This review does not provide professional advice or specialist approval.

Method

For ax²+bx+c=0 with a nonzero, compute Δ=b²−4ac. Treat |Δ|≤2×Number.EPSILON×max(|b²|,|4ac|) as zero to handle roundoff; near this threshold classification is approximate. Use a stable q-based quadratic formula for distinct real roots and overflow-safe division for repeated and complex roots. Reject unsupported derived overflow or nonzero products that underflow to zero.

Δ = b² − 4ac

x = (−b ± √Δ)/(2a)

Variables and units

a
nonzero quadratic coefficient
b
linear coefficient
c
constant coefficient
Δ
discriminant

Worked example

For x²−3x+2=0, Δ=1 and the roots are 2 and 1; for x²+1=0, Δ=−4 and roots are ±i.

Limitations

Root components use six significant digits for display; this is not a guarantee of accuracy. Coefficients and the computed discriminant retain their numerical precision.

  • Computed irrational roots are approximate, not exact symbolic expressions.
  • The input must describe a quadratic equation (a ≠ 0).
  • A near-zero discriminant within the relative floating-point error threshold is reported as a repeated root, not as an exact proof of root count. Roots are numerical approximations.
  • Δ>0: two distinct real roots.
  • Δ=0: one repeated real root.
  • Δ<0: two complex conjugate roots.
  • a=0.1,b=0.6,c=0.9 is treated as Δ=0 with repeated root −3.
  • a=1,b=0,c=−1e-8 retains Δ=4e-8 and roots ±0.0001.
  • a=1,b=±1e8,c=1 preserves the small root ∓1e-8 using stable quadratic arithmetic.
  • a=1e308,b=1,c=1e-308 retains nonzero complex root components −5e-309 and ±8.66025e-309.

Sources

How to Use

  1. Enter coefficient 'a' (the coefficient of x²)
  2. Enter coefficient 'b' (the coefficient of x)
  3. Enter coefficient 'c' (the constant term)
  4. Review the type of roots based on the discriminant

Calculate discriminant and roots of quadratic equations

Calculate the discriminant of a quadratic equation and find its roots. Method: For ax²+bx+c=0 with a nonzero, compute the discriminant and use its sign to classify roots; compute real or complex roots with the quadratic formula.

The discriminant tells us whether the roots are real or complex, and whether they are distinct or repeated, without actually solving the equation.

Interpreting the Discriminant

Discriminant ValueType of RootsGraph Behavior
Δ > 0Two distinct real rootsParabola crosses x-axis at two points
Δ = 0One repeated real rootParabola touches x-axis at one point (vertex)
Δ < 0Two complex conjugate rootsParabola does not cross x-axis

The Quadratic Formula

Once you know the discriminant, you can find the roots using the quadratic formula:

x = (-b ± √Δ) / (2a)

Where:

  • x represents the roots of the equation
  • a, b, c are the coefficients from ax² + bx + c = 0
  • Δ is the discriminant (b² - 4ac)
  • ± means there are two solutions (unless Δ = 0)

Understanding Complex Roots

When the discriminant is negative, the roots are complex numbers. Complex roots always come in conjugate pairs: a + bi and a - bi.

For example, if Δ = -16, then √Δ = 4i, where i is the imaginary unit (i² = -1). The roots would be calculated as x = (-b ± 4i) / (2a).

Worked scenario

  • Quadratic graph: x²−3x+2=0 → Δ=1; x=1,2.

Method, example, rounding, and limits

Method: For ax²+bx+c=0 with a nonzero, compute the discriminant and use its sign to classify roots; compute real or complex roots with the quadratic formula.

Worked example: a=1, b=−3, c=2 → Δ=1, x₁=2, x₂=1; a=1, b=0, c=1 → Δ=−4, x=±i.

Rounding: Root components use six significant digits; this is display precision, not guaranteed accuracy. Coefficients and the discriminant retain their computed precision.

Limit: Roots are numerical approximations. A computed |Δ| ≤ 2 × ε × max(|b²|, |4ac|), with ε = Number.EPSILON ≈ 2.22 × 10⁻¹⁶, is treated as zero and reported as a repeated root. Near this threshold the classification is not an exact proof of the root count. Nonfinite calculations are rejected.

Reference: OpenStax. https://openstax.org/books/college-algebra-2e/pages/2-5-quadratic-equations Goldberg, Oracle: https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html

Frequently Asked Questions

What does a discriminant of zero mean?
A discriminant of zero means the quadratic equation has exactly one real root (a repeated root). Graphically, this means the parabola just touches the x-axis at its vertex.
Can the discriminant be negative?
Yes, a negative discriminant means the quadratic equation has two complex conjugate roots. The parabola doesn't cross the x-axis in this case.
Why must coefficient 'a' be non-zero?
If a = 0, the equation becomes bx + c = 0, which is linear, not quadratic. The discriminant is specifically defined for quadratic equations where the highest power is x².
How is the discriminant used in the quadratic formula?
The discriminant appears under the square root in the quadratic formula: x = (-b ± √Δ) / (2a). Its value determines whether we're taking the square root of a positive, zero, or negative number, which affects the nature of the roots.