AngouriMath
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 — ornull where that could not be settled.
factor reduced to a single one, so that it has the same roots and each of them
once — or
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; ornull where expr is not a
polynomial invariable alone with rational coefficients, or
where its degree is above 32.
normalised to a positive leading coefficient and no common factor among its
coefficients; or
polynomial in
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.
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-freeAngouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online