Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Get denominator with hold=True

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?

Get denominator with hold=True

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?