t2=x.mul(1/(x^2-x),hold=True) t2.denominator()
results in x-1 instead of x*(x-1) or x^2-x. Is there any other way to obtain x^2-x?
1 | initial version | asked 2021-04-25 22:05:18 +0100 Anonymous |
t2=x.mul(1/(x^2-x),hold=True) t2.denominator()
results in x-1 instead of x*(x-1) or x^2-x. Is there any other way to obtain x^2-x?
t2=x.mul(1/(x^2-x),hold=True)
t2.denominator()I am struggling to get the denominator of an expression defined with hold=True
.
The expression is a quotient with a common factor in the numerator and denominator.
I don't want the common factor to be cleared out.
Example:
sage: t2 = x.mul(1 / (x^2 - x), hold=True)
sage: t2
x/(x^2 - x)
sage: t2.denominator()
x - 1
This results in x-1 x - 1
instead of x*(x-1) x*(x - 1)
or x^2-x. x^2 - x
.
Is there any other way to obtain x^2-x?x^2 - x
?