Why does Maxima say these expressions are not equivalent?

249 Views Asked by At

If I compare two expressions in Maxima, it tells me they are equivalent, as expected:

(%i25) is(equal( sqrt(2)*sqrt(5), sqrt(10) ));
(%o25)                               true

But if I multiply each expression by a constant, it then tells me they're not equivalent any more:

(%i26) is(equal( sqrt(2)*sqrt(5)*2, sqrt(10)*2 ));
(%o26)                               false

Surely they must still be equivalent if I do the same thing to both expressions? If I try adding a constant instead of multiplying, it returns true as expected:

(%i27) is(equal( sqrt(2)*sqrt(5)+2, sqrt(10)+2 ));
(%o27)                               true

version info

(%i2) build_info(); 
(%o2) Maxima version: "5.32.1" 
      Maxima build date: "2014-01-10 01:52:55" 
      Host type: "x86_64-unknown-linux-gnu" 
      Lisp implementation type: "GNU Common Lisp (GCL)" 
      Lisp implementation version: "GCL 2.6.10"
1

There are 1 best solutions below

0
On BEST ANSWER

Interestingly enough

is(equal( sqrt(2)*sqrt(5)*7, sqrt(10)*7 ));  

will evaluate to true as will

is(equal( sqrt(2)*sqrt(5)*c, sqrt(10)*c ));  

is(equal(a,b)) tries to simplify a-b and gives true when a-b equals zero. Problem with $\sqrt{2}*\sqrt{5}*2$ is that it simplifies to
$ 2^\frac{3}{2} \sqrt{5} $ which then confuses maxima (obviously a bug)