On Jul 11, 2009, at 4:39 PM, Minh Nguyen wrote: > On Sun, Jul 12, 2009 at 9:12 AM, Neal<[email protected]> wrote: >> >> Hi everyone, >> >> I thought I'd share the following: >> >> sage: assume(x>0) >> sage: solve([x^2-1],x) >> [x == -1, x == 1] >> >> Shouldn't it not give me the negative solution? Also: >> >> sage: assume(x == 1) >> sage: bool(x == 1) >> False > > We have been receiving many reports about problems with assume(). > Possibly related threads are: > > http://groups.google.com/group/sage-support/browse_thread/thread/ > baff0ea16acf049a/5bd6e591a1ea106d > http://groups.google.com/group/sage-support/browse_thread/thread/ > e959dd09ae737556/24fc75b2c4ea09db > http://groups.google.com/group/sage-support/browse_thread/thread/ > 1f7159d23e20f547/b8cd93dac11ef3f5 > http://groups.google.com/group/sage-devel/browse_thread/thread/ > 1e180a4fb2d42308/7ccf04f57070bd93 > http://groups.google.com/group/sage-devel/browse_thread/thread/ > cfbdcc9959ef5deb/2c44be3709189e4b > > Perhaps the problem can be traced to Maxima's assume() function.
I think it's not that Maxima's assume is bad, but that it doesn't do what people assume it does (pun intended). Primarily it's used for things like simplification (assume x > 0 means sqrt(x^2) == x) and this carries over to other things like integration. For example sage: assume(x>0) sage: solve(sqrt(x^2) + 1 == 0, x) [x == -1] The assume is applied in the simplify step, but not in solving. The answer is incorrect because it violates the assumption maxima used to compute it. It would probably be possible (and a good idea) to fix the solve command to filter out results that violate the running assumptions. - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
