Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#2095 closed defect (invalid)

Simplification sometimes is wrong in Sage

Reported by: moretti Owned by: gfurnish
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: calculus Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

sage: plot(arcsin(sin(x)))

plots a straight line.

sage: x/x
1
sage: assume(x<0)
sage: sqrt(x)^2
x

Change History (6)

comment:1 Changed 7 years ago by was

Which is "sometimes wrong"? The first two examples look fine to me. For the third, we're totally screwed -- or -- we just don't understand Maxima, since it's just the native behavior of Maxima:

sage: !maxima
Maxima 5.13.0 http://maxima.sourceforge.net
Using Lisp CLISP 2.41 (2006-10-13)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
(%i1) assume(x<0);
(%o1)                               [x < 0]
(%i2) sqrt(x)^2;
(%o2)                                  x

comment:2 Changed 7 years ago by moretti

These are examples pointed out by Peter Jipsen... the second one I think is okay. The first one could be problematic, but Robert pointed out that it works fine if you use fast_eval. For the third, I think we are screwed. There is the command

domain:real;
real

domain:complex;
complex

in maxima, however the *only* effect that this seems to have on Maxima is if domain is real, sqrt(x2) returns abs(x).

Perhaps this should be changed to an enhancement. Assume() is currently only there as a workaround to Maxima's interactive behavior; it would be nice if Sage were smarter about assumptions on symbolic variables.

comment:3 Changed 7 years ago by mabshoff

  • Milestone set to sage-2.10.2

comment:4 Changed 6 years ago by gfurnish

  • Owner changed from was to gfurnish
  • Status changed from new to assigned

comment:5 Changed 6 years ago by was

  • Resolution set to invalid
  • Status changed from assigned to closed

We're being stupid. Clearly sqrt(x)^2 should equal x NO MATTER what x is. Period. No matter what you assume about x it has to be the case the "sqrt(x)" is something that when squared gives x. That's the definition of "square root".

comment:6 Changed 6 years ago by mabshoff

  • Milestone changed from sage-2.11 to sage-duplicate/invalid
Note: See TracTickets for help on using tickets.