Hello,
Version: sage 4.6.1
I'm quite a newbie with Sage but I'm really impressed by this powerful software.
Since an hour, I'm on a stupid problem:
sage: sqrt(2)*sqrt(3)
sqrt(2)*sqrt(3)
sage: sqrt(2)*sqrt(3)-sqrt(6)
sqrt(2)*sqrt(3)-sqrt(6)
I would expect results sqrt(6) and 0...
I try with the command simplify() but it doesn't do anything.
That's very odd because:
sage: sqrt(75)+2*sqrt(48)
13*sqrt(3)
(Here it simplifies the operation)
Can anyone help me ?
Thanks in advance
lo�c
> In the above Sage session, you declared two symbolic expressions. So
> it is possible to use methods defined on symbolic expressions other
> than simplify(). In the present case, you want to use the
> simplify_radical() method to simplify radicals:
Thanks.
However...
I am surprised that simplify is sufficient on symbolic variables
denoting positive numbers:
sage: assume(x>0, y>0)
sage: (sqrt(x)*sqrt(y)-sqrt(x*y)).simplify()
0
sage: (sqrt(2)*sqrt(3)-sqrt(2*3)).simplify()
sqrt(2)*sqrt(3) - sqrt(6)
I am particularly surprised by:
sage: (sqrt(x)*sqrt(y)-sqrt(x*y)).subs(x=2)
0
sage: (sqrt(x)*sqrt(y)-sqrt(x*y)).subs(x=2, y=3).simplify()
sqrt(2)*sqrt(3) - sqrt(6)
(We did not even need the call to simplify when substituting only x=2.)
Is it reasonable to consider the last example a bug?
Of course, the answer sage gives is correct, but it is certainly not the
behaviour I would expect.
Regards
Johan