Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sage not always understanding i=sqrt(-1) - Maxima bug probably #6423

Closed
sagetrac-drkirkby mannequin opened this issue Jun 26, 2009 · 12 comments
Closed

Sage not always understanding i=sqrt(-1) - Maxima bug probably #6423

sagetrac-drkirkby mannequin opened this issue Jun 26, 2009 · 12 comments

Comments

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented Jun 26, 2009

Vladimir Bondarenko (a developer of software to test computer algebra systems - see http://www.cas-testing.org/ ), had been playing with http://demo.sagenb.org/ and noted the following:

exp(-x^i).integral(x,0,1)  returns

Traceback (click to the left for traceback)
...
Is %i an integer?

Ouch! Any Sage comments?

When I reported his on sage-devel, William Stein said:

''A large amount of the symbolic functionality that uses Maxima has
issues like this, but unfortunately there is basically nothing we can do about it, except continue with projects to rewrite the parts of Sage that call Maxima so that they don't call Maxima. So this class of bugs should be very good motivation to continue to work on
implementing symbolic integration ourselves (and/or further improving sympy!).''

He then went on to say he wanted it reported as a TRAC bug but was busy, so I have done it on his behalf.

I don't feel able to comment much more on this, and personally don't intend trying to fix it (outside my knowledge), so I've just reported it.

Can someone else add appropriate priority, milestones, keywords etc, as this is completely outside my comfort zone.

David Kirkby

Upstream: Fixed upstream, in a later stable release.

Component: calculus

Author: Karl-Dieter Crisman

Reviewer: Robert Marik

Merged: sage-4.3.1.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/6423

@aghitza aghitza changed the title Sage not always understanding i=sqrt(-1) - Maxima bug proably Sage not always understanding i=sqrt(-1) - Maxima bug probably Jul 5, 2009
@aghitza aghitza added this to the sage-4.1.1 milestone Jul 5, 2009
@aghitza
Copy link

aghitza commented Aug 24, 2009

comment:2

This is fixed by the spkg and patch at #6699. I will put up a patch with a doctest here when #6699 gets merged.

@aghitza aghitza assigned aghitza and unassigned burcin Aug 24, 2009
@kcrisman
Copy link
Member

comment:3

Unfortunately, it seems not. From uw.sagenb.org:

sage: exp(-x^i).integral(x,0,1)
Traceback (most recent call last):
...
TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(i>0)' before integral or limit evaluation, for example):
Is %i an integer?
sage: maxima.eval('integrate(exp(-x^%i),x,0,1);')
Traceback (most recent call last):
...
ValueError: Computation failed since Maxima requested additional constraints (try the command 'assume(i>0)' before integral or limit evaluation, for example):
Is %i an integer?

This also was verified on a local installation.

@kcrisman
Copy link
Member

comment:4

Just FYI, this is now FIXED in the latest CVS of Maxima.

Maxima 5.19post http://maxima.sourceforge.netusing Lisp SBCL 1.0.24
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) integrate(exp(-x^%i),x,0,1);
                       %i gamma_incomplete(- %i, - log(x + 1))
(%o1) %i (%i (limit   (---------------------------------------
              x -> 0-                     2
   %i gamma_incomplete(%i, - log(x + 1))    %i gamma_incomplete(%i, 1)
 - -------------------------------------) + --------------------------
                     2                                  2
   %i gamma_incomplete(- %i, 1)
 - ----------------------------)
                2
              gamma_incomplete(%i, - log(x + 1))
 + limit   (- ----------------------------------
   x -> 0-                    2
   gamma_incomplete(- %i, - log(x + 1))    gamma_incomplete(%i, 1)
 - ------------------------------------) + -----------------------
                    2                                 2
   gamma_incomplete(- %i, 1)
 + -------------------------)
               2
(%i2) 

Of course, now we'll have to deal with nounforms and gamma_incomplete translation, but hopefully that won't be too big of a hurdle.

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Nov 23, 2009

Upstream: Fixed upstream, but not in a stable release.

@kcrisman
Copy link
Member

comment:6

Using Maxima 5.20.1 with Sage 4.3.alpha1:

sage: exp(-x*i).integral(x,0,1)
I*e^(-I) - I

So if that is mathematically correct, sounds like it's fixed. The following link http://www.wolframalpha.com/input/?i=integrate+e%5E%28-x*I%29+from+0+to+1 indicates it is, as well as just using the FTC. Now we just need the spkg and to put a doctest here.

See #7748 for getting a symbolic incomplete gamma, which we would also need regardless of that.

@kcrisman
Copy link
Member

Changed upstream from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.

@kcrisman
Copy link
Member

comment:7

This patch depends on the spkg at #7745, but should still apply (with fuzz) if one doesn't apply the patch there.

@kcrisman
Copy link
Member

Author: Karl-Dieter Crisman

@kcrisman
Copy link
Member

Based on 4.3.alpha1

@robert-marik
Copy link
Mannequin

robert-marik mannequin commented Dec 23, 2009

comment:8

Attachment: trac_6423-exp.patch.gz

Positive review! Tested on 4.3.rc0 and got only errors which have been reported on sage-devel and are not relevent to this ticket. Tested together with #7745 and #4142.

Positive review, thanks for upgrading.

@robert-marik
Copy link
Mannequin

robert-marik mannequin commented Dec 23, 2009

Reviewer: Robert Marik

@mwhansen
Copy link
Contributor

mwhansen commented Jan 4, 2010

Merged: sage-4.3.1.alpha0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants