Unexplained Integration error message

31 views
Skip to first unread message

Craig E Larson

unread,
Jul 22, 2014, 5:04:01 AM7/22/14
to sage-s...@googlegroups.com
I am getting an error that I don't understand for the following definite integral.

sage: integral(sqrt(1+(9*cos(3*x)^2)),0,pi/2)

This is definitely real on its domain and under the square-root is always positive. Nevertheless, I get the error:

"RuntimeError: ECL says: Error executing code in Maxima: sign: argument cannot be imaginary; found %i"

I can get an answer using "numerical_integral". But I would like to know if I'm missing something.

Thanks.

Dima Pasechnik

unread,
Jul 22, 2014, 5:59:47 AM7/22/14
to sage-s...@googlegroups.com
What version of Sage?
In Sage 6.3.beta6 I get an error too, but it seems to indicate a bug
in Maxima:

sage: integral(sqrt(1+(9*cos(3*x)^2)),0,pi/2)
#0:
intfudu(exp=%e^-(%i*?new\-var\-10199)*sqrt((22*%e^-(2*%i*?new\-var\-10199)+9*%e^-(4*%i*?new\-var\-10199)+9)*%e^(...,%voi=?new\-var\-10199)
#1:
extra_integrate(q=%e^-(%i*?new\-var\-10199)*sqrt((22*%e^-(2*%i*?new\-var\-10199)+9*%e^-(4*%i*?new\-var\-10199)+9)*%e^(...,x=?new\-var\-10199)
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call
last)
<ipython-input-4-21cb4ede47a7> in <module>()
....


>
> Thanks.
>

Craig E Larson

unread,
Jul 22, 2014, 10:48:52 AM7/22/14
to sage-s...@googlegroups.com

This behavior was on Cloud Sage:
 
'Sage Version 6.2.rc2, Release Date: 2014-05-04' 

Nils Bruin

unread,
Jul 22, 2014, 11:53:39 AM7/22/14
to sage-s...@googlegroups.com
On Tuesday, July 22, 2014 2:04:01 AM UTC-7, Craig E Larson wrote:
I am getting an error that I don't understand for the following definite integral.

sage: integral(sqrt(1+(9*cos(3*x)^2)),0,pi/2)

This is definitely real on its domain and under the square-root is always positive. Nevertheless, I get the error:
Maxima proper doesn't produce an error but doesn't do anything useful with the integral:

 (%i1) display2d: false;
(%o1) false
(%i2) integrate(sqrt(1+cos(x)^2),x,0,%pi);
(%o2) 'integrate(sqrt(cos(x)^2+1),x,0,%pi)

but when we load abs_integrate (which sage does) the error occurs:

(%i3) load(abs_integrate);
(%o3) "/usr/local/sage/sage-6.0/local/share/maxima/5.29.1/share/contrib/integration/abs_integrate.mac"
(%i4) integrate(sqrt(1+cos(x)^2),x,0,%pi);


sign: argument cannot be imaginary; found %i

One could consider reporting this upstream.

On the plus side: it's not caused by `domain: complex` this time.
Reply all
Reply to author
Forward
0 new messages