AngouriMath

Navigation

← Back to list of members

Discriminant​(AngouriMath.​Entity,​AngouriMath.​Entity.​Variable)

 Method (no overloads)

Summary

The discriminant of a polynomial with respect to one variable — vanishing
exactly where it has a repeated root in that variable — or
null where that could not be settled.

Parameter "expr"

The polynomial.

Parameter "variable"

The variable to take the discriminant in.

Returns

A polynomial in the remaining variables, or null under the
same conditions as Resultant(AngouriMath.Entity,AngouriMath.Entity,AngouriMath.Entity.Variable) — this is
(-1)^(n(n-1)/2) Res(f, f') / lc(f), so it declines wherever that
resultant does.

Remarks

The sign convention is the usual one, so that a quadratic gives
b^2 - 4ac rather than its negative, and a cubic x^3 + px + q gives -4p^3 - 27q^2. For a polynomial with real coefficients the sign
counts real roots up to degree three: a quadratic has two where it is positive
and none where it is negative, and a cubic three and one respectively. It stops
deciding at degree four.

Example

Console.WriteLine(MathS.Polynomials.Discriminant("a * x ^ 2 + b * x + c", "x"));
// -4 * a * c + b ^ 2
            
Console.WriteLine(MathS.Polynomials.Discriminant("x ^ 3 - 3 * x + 1", "x"));
// 81               -- positive, so all three roots are real
            
Console.WriteLine(MathS.Polynomials.Discriminant("x ^ 2 - 2 * x + 1", "x"));
// 0                -- a repeated root

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online