Looks like the comment sign in line 738 is the culprit: the code raises an unconditional exception since the "if" has been commented out. If true you could just remove the "#", see if it works, create a patch and open a ticket for this.

I wonder why it works the first time, though...

Cheers,
Christian

On 03/01/2013 08:39 AM, Jan Groenewald wrote:
Sage 5.7 on Ubuntu 12.04.2

sage: integral(e^(-abs(x))/cosh(x),x,-infinity,infinity)
2*log(2)
sage: integral(e^(-abs(x))/cosh(x),x,-infinity,infinity)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
...
<snip>
...
/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.pyc in sr_integral(self, *args) 737 # in pexpect interface, one looks for this - e.g. integrate(1/x^3,x,-1,3) gives a principal value
    738 #            if "divergent" in s or 'Principal Value' in s:
--> 739                 raise ValueError, "Integral is divergent."
    740             elif "Is" in s: # Maxima asked for a condition
    741                 j = s.find('Is ')

ValueError: Integral is divergent.
sage:

It runs fine in maxima repeatedly...

0 jan@muizenberg:/var/autofs/misc/home/jan$sage --maxima
;;; Loading #P"/usr/lib/sagemath/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/usr/lib/sagemath/local/lib/ecl/sockets.fas"
;;; Loading #P"/usr/lib/sagemath/local/lib/ecl/defsystem.fas"
;;; Loading #P"/usr/lib/sagemath/local/lib/ecl/cmp.fas"
Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
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) integral(e^(-abs(x))/cosh(x),x,-infinity,infinity);
                              1
(%o1)         integral(---------------, x, - infinity, infinity)
                        abs(x)
                       e       cosh(x)
(%i2)  integral(e^(-abs(x))/cosh(x),x,-infinity,infinity);
                              1
(%o2)         integral(---------------, x, - infinity, infinity)
                        abs(x)
                       e       cosh(x)
(%i3)

Regards,
Jan
--
.~.
  /V\ Jan Groenewald
 /( )\ www.aims.ac.za <http://www.aims.ac.za>
 ^^-^^
--
You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to