AngouriMath

Navigation

PolynomialFactoring


← Back to list of classes

Description

Summary

Factors a polynomial in one variable into linear factors with whole roots:
x^2 + 2x + 1 becomes (x + 1)^2, and
x^3 - 6x^2 + 11x - 6 becomes (x - 1)(x - 2)(x - 3).

Remarks

Deliberately narrow, on two counts.
Rational roots only. Factoring through every root would answer
(x - i)(x + i) for x^2 + 1 and (x - sqrt(2))(x + sqrt(2)) for
x^2 - 2, which is not what anyone means by factoring those.
And only when the polynomial splits completely into whole roots. A partly factored
answer is not obviously better than the sum it came from, and fractional roots turn
up mostly in the output of calculus, where the expanded form is the conventional
one: the antiderivative of x^2 + x reads better as x^3/3 + x^2/2 than
as x^2 * (x + 3/2) / 3.
What comes out of here is a candidate, not a decision. The simplifier keeps it
alongside the other forms it has found and picks between them by its complexity
metric, which is why x^2 - 1 stays as it is while (x + 1)^2 wins.

Members

























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