Discriminant[poly,var]
computes the discriminant of the polynomial poly with respect to the variable var.
Discriminant[poly,var,Modulusp]
computes the discriminant modulo
.
Discriminant
Discriminant[poly,var]
computes the discriminant of the polynomial poly with respect to the variable var.
Discriminant[poly,var,Modulusp]
computes the discriminant modulo
.
Details and Options
- The discriminant of a polynomial with leading coefficient one is the product over all pairs of roots
,
of
. - Discriminant takes the following options:
-
Method Automatic method to use Modulus 0 modulus to assume for integers - Typical possible values for Method are Automatic, "SylvesterMatrix", "BezoutMatrix", "Subresultants" and "Modular".
Examples
open all close allBasic Examples (1)
Scope (7)
Discriminant of a polynomial with numeric coefficients:
Discriminant[x ^ 10 - 5x ^ 7 - 3 x + 9, x]Discriminant of a general cubic:
Discriminant[a x ^ 3 + b x ^ 2 + c x + d, x]Discriminant of a general quintic:
Discriminant[Sum[Subscript[a, i]x ^ i, {i, 0, 5}], x]Discriminants are squares of differences of roots:
Discriminant[(x - a)(x - b)(x - c)(x - d), x]Discriminant over integers modulo 3:
Discriminant[x ^ 5 - x y + y ^ 2 - 1, x, Modulus -> 3]Discriminant over a finite field:
ℱ = FiniteField[17, 3];Discriminant[ℱ[1]x ^ 5 + ℱ[123]x y + ℱ[456], x]Compute the discriminant of a polynomial of degree
:
rpoly[n_] := RandomInteger[{-2 ^ 10, 2 ^ 10}, {n + 1}].x ^ Range[0, n]
SeedRandom[1234];
p = rpoly[1000];Discriminant[p, x]//Short//AbsoluteTimingOptions (4)
Method (1)
This compares timings of the available methods of discriminant computation:
Timing[Discriminant[x ^ 100 - 2x ^ 77 + 3x + 4, x, Method -> #]//Short]& /@ {Automatic, "Modular", "Subresultants", "BezoutMatrix", "SylvesterMatrix"}//ColumnTiming[Discriminant[a x ^ 10 + b x ^ 5 + (a + b)x + a b c, x, Method -> #]//Short]& /@ {Automatic, "Modular", "Subresultants", "BezoutMatrix", "SylvesterMatrix"}//ColumnModulus (3)
By default the discriminant is computed over the rational numbers:
Discriminant[a x ^ 3 + b x ^ 2 + c x + d, x]Compute the discriminant of the same polynomial over the integers modulo 2:
Discriminant[a x ^ 3 + b x ^ 2 + c x + d, x, Modulus -> 2]Compute the discriminant of the same polynomial over the integers modulo 3:
Discriminant[a x ^ 3 + b x ^ 2 + c x + d, x, Modulus -> 3]Applications (2)
Decide whether a polynomial has multiple roots:
Discriminant[x ^ 11 - 2x ^ 10 + x ^ 9 - 2x ^ 3 + 11x ^ 2 - 16x + 7, x]FactorSquareFree[x ^ 11 - 2x ^ 10 + x ^ 9 - 2x ^ 3 + 11x ^ 2 - 16x + 7]Discriminant[x ^ 11 - 2x ^ 10 + x ^ 9 - 2x ^ 3 + 11x ^ 2 - 16x - 7, x]FactorSquareFree[x ^ 11 - 2x ^ 10 + x ^ 9 - 2x ^ 3 + 11x ^ 2 - 16x - 7]Find the condition for a cubic to have multiple roots:
Solve[Discriminant[x ^ 3 + x + c , x] == 0, c]FactorSquareFree[x ^ 3 + x + c /. %, Extension -> Automatic]Properties & Relations (3)
The discriminant is zero if and only if the polynomial has multiple roots:
Discriminant[(x - 1)(x - 2)(x - 3), x]Discriminant[(x - 1)(x - 2)(x - 1), x]The discriminant can be represented in terms of roots as
:
x /. Solve[a x ^ 2 + b x + c == 0, x]Expand[a ^ (2 2 - 2)(%[[1]] - %[[2]]) ^ 2]Discriminant[a x ^ 2 + b x + c, x]Equation
relates Discriminant and Resultant:
f = 3x ^ 7 - 5x + 4;Resultant[f, D[f, x], x](-1) ^ (7 6 / 2)Coefficient[f, x, 7]Discriminant[f, x]Possible Issues (1)
Using exact coefficients, this indicates no common root:
Discriminant[(x - 1 + 10 ^ (-17))(x - 1), x]With approximate coefficients, this does indicate a common root:
Discriminant[(x - 1. + 10 ^ (-17))(x - 1), x]in this case, using higher precision resolves the problem:
Discriminant[(x - 1`20 + 10 ^ (-17))(x - 1), x]See Also
Related Guides
Text
Wolfram Research (2007), Discriminant, Wolfram Language function, https://reference.wolfram.com/language/ref/Discriminant.html (updated 2023).
CMS
Wolfram Language. 2007. "Discriminant." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/Discriminant.html.
APA
Wolfram Language. (2007). Discriminant. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Discriminant.html
BibTeX
@misc{reference.wolfram_2026_discriminant, author="Wolfram Research", title="{Discriminant}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/Discriminant.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_discriminant, organization={Wolfram Research}, title={Discriminant}, year={2023}, url={https://reference.wolfram.com/language/ref/Discriminant.html}, note=[Accessed: 13-June-2026]}