AngouriMath

Navigation

← Back to list of members

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

 Method (no overloads)

Summary

The square-free part of a polynomial — the same polynomial with every repeated
factor reduced to a single one, so that it has the same roots and each of them
once — or null where that could not be settled.

Parameter "expr"

The polynomial.

Parameter "variable"

The variable it is a polynomial in.

Returns

The polynomial divided by its greatest common divisor with its own derivative,
normalised to a positive leading coefficient and no common factor among its
coefficients; or null where expr is not a
polynomial in variable alone with rational coefficients, or
where its degree is above 32.

Remarks

Univariate, and over the rationals. This is what to take before looking for
roots: the multiplicities are the part a root-finder gets wrong, and dividing
them out costs one greatest common divisor.

Example

Console.WriteLine(MathS.Polynomials.SquareFreePart("(x - 1) ^ 3 * (x + 2) ^ 2", "x"));
// x ^ 2 + x - 2    -- which is (x - 1)(x + 2)
            
Console.WriteLine(MathS.Polynomials.SquareFreePart("x ^ 2 + 1", "x"));
// x ^ 2 + 1        -- already square-free

























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