Get denominator with hold=True
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
instead of x*(x - 1)
or x^2 - x
.
Is there any other way to obtain x^2 - x
?