#2546 solve with repeated equations gives a wrong answer

None
open
nobody
5
2013-05-24
2013-02-11
Dima Pasechnik
No

With the release of Maxima (as well as with 5.29.1), one gets
(%i1) solve([sin(x)=cos(x), sin(x)=cos(x)],x);
(%o1) []

(%i2) solve([sin(x)=cos(x)],x);
(%o2) [sin(x) = cos(x)]

That is, repeating an equation changes the result (to a wrong one, too)!

Discussion

  • What's going on is that we don't remove duplicate equations in $solve. Then we call SSOLVE on a single equation or SOLVEX on multiple equations. The two behave differently when they can't find a solution. I'm inclined to think that this behaviour is not a bug: after all, Maxima is failing to say anything useful in either case. I'll put a question to the mailing list about it in a second.

     
    • Dima Pasechnik
      Dima Pasechnik
      2013-02-16

      Well, in the case of two equations it returns an empty set, i.e. no solutions, right? This looks like a bug, no?

       
      • I think this shows that we need to improve the documentation for solve(). An empty list as a return value means that solve couldn't find any solutions, not that none exist (this sort of gets written up in the documentation for algsys, but I agree that's not good enough)

         
  • Robert Dodier
    Robert Dodier
    2013-05-24

    • labels: --> Lisp Core - Solving equations