Display option (default): the factors are written one after the other, with their exponent. Chainable, kept by clone.
Display option: the factors with a negative power are written in a fraction under the numerator. Chainable, kept by clone.
The factors with a negative power, as a new polyfactor with positive powers.
ASCIIMath rendering of the current state (terminal output, not chainable).
The factors with a positive power, as a new polyfactor.
Roots of every factor, sorted by value without duplicates. The roots of the denominator are included: they are the values where the expression is undefined.
LaTeX rendering of the current state (terminal output, not chainable).
Variables of all the factors.
Add one or more PolyFactors to this one.
Algorithm: compute the LCM of all denominators, scale each numerator by its complementary factor, then extract the GCD of the scaled numerators and collect the residuals into a single polynomial factor.
Full duplicate of this instance, including display state (selected form
and options set via as*** / with***). Distinct from copy.
Copy the mathematical state of another instance into this (display
state is NOT transferred — the receiver keeps its own formatting). Entry
point used when constructing/parsing from a same-type input. Distinct from
clone. Classes without a real implementation throw
NotImplementedError.
Sum of the degrees of the factors; a denominator counts negatively.
Optionalvariable: stringDerivative, by the product rule. The result is added with add, so it is factored again.
Expand the numerator and the denominator into polynoms. Returns a new polyfactor (numerator over denominator).
Divide by polyfactors: append their inverted factors. The result is not reduced.
Value of the expression for given values of its variables.
a dictionary {x: 2}, or one value for a single-variable expression.
true returns a number, otherwise the exact Fraction.
Value of the expression for given values of its variables.
a dictionary {x: 2}, or one value for a single-variable expression.
OptionalasNumeric: false
true returns a number, otherwise the exact Fraction.
Value of the expression for given values of its variables.
a dictionary {x: 2}, or one value for a single-variable expression.
OptionalasNumeric: boolean
true returns a number, otherwise the exact Fraction.
Factor the polynom of each factor, and return the result as a new polyfactor.
Optionalvariable: stringTrue when a factor contains the variable.
Negate every power: numerator and denominator are swapped.
True when both expressions are equal: their quotient, once the common factors are removed, reduces to one.
True when every factor is one.
True when a factor is zero.
Multiply by polyfactors, factors, polynoms or strings: append their factors. The result is not reduced.
Set the expression to 1.
Change the sign: add a factor -1, or remove it when it is already there.
Replace the content by a string, a polynom, a factor or another polyfactor.
Raise to a power: multiply the power of every factor.
Group the factors with the same base by adding their powers, remove the factors of power zero, and merge the monomial factors with an integer power.
N-th root: divide every power by value.
Reoarder the factors using :
Optionalvariable: stringSquare root: divide every power by 2.
Subtract polyfactors. The operands are negated, so they are modified: pass clones to keep them.
Set the expression to 0.
StaticfromBuild a polyfactor from factors, or from anything a factor accepts.
StaticfromBuild a polyfactor with one factor for the numerator and, when given, one for the denominator.
Optionaldenominator: InputAlgebra<Polynom>StaticfromBuild a polyfactor from a product of parenthesised terms, with at most one / for the denominator.
StaticgcdGreatest common divisor: every base shared by all the polyfactors, at its lowest power.
StaticlcmLeast common multiple: every base found in one of the polyfactors, at its highest power.
A polynomial expression in factored form: a list of Factors whose product is the value. A factor with a negative power belongs to the denominator. Built from a string (
"(x-1)(x+2)^2","(x+1)/(x-2)"), a polynom or factors. Operations modify the object and return it;clone()keeps the original.Example