If we did not automatically cancel numerical powers when negative
powers are involved, it would be a mess.

simplify() actually does more than this, by the way, as it calls
cancel(), which removes all common zeros from the numerator and
denominator.

If you want to keep track of this, you'll have to use evaluate=False
and build up the expression manually.

Aaron Meurer

On Jan 11, 2012, at 1:51 AM, Joachim Durchholz <[email protected]> wrote:

> Am 11.01.2012 04:32, schrieb Chris Smith:
>> On Wed, Jan 11, 2012 at 4:43 AM, Joachim Durchholz<[email protected]>  
>> wrote:
>>
>>> f/g will be x, which is continuous. So yes, in this case, the
>>> simplification changes the result.
>>>
>> Since x**2/x is automatically simplified, we should probably automatically
>> simplify x**2.0/x.
>
> x²/x has a discontinuity for x=0, and x does not, hence x²/x is not the same 
> as x. (I suspect it might even be possible to "prove" 1=0 if you allow 
> removing 0/0 from a product. Division by zero tends to be nasty like that, 
> but I haven't checked.)
>
> However, (if x = 0 then 0 else x²/x) is the extension by continuity of x²/x, 
> and is indeed equal to x.
>
> So:
> Simplifying (x**2/x if x != 0 else 0) and (x**2/x if x != 0 else x) to x is 
> valid.
> Simplifying extend_by_continuity(x**2/x) to x is valid (assuming a 
> hypothetical function extend_by_continuity).
> simplify(x**2/x, extend_by_continuity=true) could be defined to return a 
> simplified expression that may, at the discretion of simplify(), have been 
> extended by continuity.
>
> But simplifying x**2 to x in the general case is invalid.
> If simplify does that without being told to do that, that's a bug.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to