#2546 solve with repeated equations gives a wrong answer


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)!


  • Rupert Swarbrick

    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?

      • Rupert Swarbrick

        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

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks