Ask Your Question

Revision history [back]

There is an option

sage: t2.denominator(normalize=False)                                                                                                                                                          
x^2 - x

There is an optionTo find out about the possible extra arguments of a method you could access its documentation with a question mark. Here

sage: t2.denominator?
Docstring:     
   Return the denominator of this symbolic expression

   INPUT:

   * "normalize" -- (default: "True") a boolean.

   If "normalize" is "True", the expression is first normalized to
   have it as a fraction before getting the denominator.

   If "normalize" is "False", the expression is kept and if it is not
   a quotient, then this will just return 1.

Hence in your situation you could do

sage: t2.denominator(normalize=False)                                                                                                                                                          
x^2 - x