>From the docstrings:

sage: x.simplify?
   Return a simplified version of this symbolic expression.

   Note: Currently, this just sends the expression to Maxima and
     converts it back to Sage.

   See also: "simplify_full()", "simplify_trig()",
     "simplify_rational()", "simplify_rectform()"
     "simplify_factorial()", "simplify_log()", "simplify_real()",
     "simplify_hypergeometric()", "canonicalize_radical()"

Not very informative, ... and Maxima's simplifications are numerous, 
complex and somewhat difficult to follow.

sage: x.simplify_full?
   Apply "simplify_factorial()", "simplify_rectform()",
   "simplify_trig()", "simplify_rational()", and then "expand_sum()"
   to self (in that order).


Note that you have also:

sage: assumptions()
[]
sage: ((x^2+x)/x).collect_common_factors()
x + 1
sage: x.collect_common_factors?
   This function does not perform a full factorization but only looks
   for factors which are already explicitly present.

   Polynomials can often be brought into a more compact form by
   collecting common factors from the terms of sums. This is
   accomplished by this function.

and

sage: ((x^2+x)/x).canonicalize_radical()
x + 1
sage: x.collect_common_factors?
   This function does not perform a full factorization but only looks
   for factors which are already explicitly present.

   Polynomials can often be brought into a more compact form by
   collecting common factors from the terms of sums. This is
   accomplished by this function.

And, indeed, these functions do more or less undocumented assumptions...

HTH,


Le vendredi 1 novembre 2019 23:40:28 UTC+1, Robert Samal a écrit :
>
> I observed the following weird behavior of the symbolic engine. 
>
> sage: x/x
> 1
> sage: x^2/x
> x
> sage: (x^2+x)/x
> (x^2 + x)/x
> sage: assume(x>0)
> sage: assume(x,'real')
> sage: assumptions()
> [x > 0, x is real]
> sage: (x^2+x)/x
> (x^2 + x)/x
>
> To clarify: first, I consider the first two simplifications slightly 
> incorrect (x/x is undefined if x=0, or possibly if x is in some weird 
> algebraic structure). However, if x/x==1 and x^2/x==x then I wonder why 
> simplification of (x^2+x)/x is not done?
>
> In this case, .simplify() does not help, .full_simplify() does. In my 
> original example though, .full_simplify() did something crazy, so I was led 
> to this. 
>
> In general, is there some explanation regarding which simplifications one 
> can expect to be done automatically and which by the two 
> simplify-functions? 
>
> Thanks!
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/4e9ce2b7-eba5-4e3f-957f-54326a017c55%40googlegroups.com.

Reply via email to