Sage/Maxima simplification bug

1 view
Skip to first unread message

TMcLarnan

unread,
Aug 2, 2009, 3:39:56 PM8/2/09
to sage-support
Friends,

I've been bitten by the Sage bug, and have become wildly enthusiastic
about Sage. It's all I ever wanted! (He said somewhat
hyperbolically.)

Yesterday, however, I also got bitten by a Sage bug involving
simplification:

{{{

sage: var('a b')
(a, b)

sage: sqrt(a^2).simplify_radical()
abs(a)

sage: sqrt(a^2 - 2*a*b + b^2).simplify_radical()
-a + b

}}}

Obviously I'm expecting the result abs(a-b). Equally obviously, this
breaks a whole lot of basic calculations. Using assume() to assert
that a > b does not change the result of the calculation.

The problem seems to be an old one inside Maxima. radcan() is
Maxima's equivalent to simplify_radical(), and it behaves just the
same way:

{{{

(%i1) radcan(sqrt(a^2));
(%o1) abs(a)

(%i2) radcan(sqrt(a^2 - 2*a*b + b^2));
(%o2) b - a

}}}

I'll file a bug ticket on the Sage developers' wiki and will see what
the Maxima mailing list has to say. Obviously this can't be a new
problem for them, so I assume it must be an issue without an easy fix.

In specific instances, one can sometimes spot this issue and do that
particular part of the simplification by hand, but with complicated
expressions that may not be possible.

Does anyone know of a general work-around until the good people who
develop Maxima find a proper fix?

Tim McLarnan
Reply all
Reply to author
Forward
0 new messages