Endless loop during definte integral



I think the 200+ lines of %i3 is another bug.  I have had that before when entering more than one command on the same line.  In your 
case if you don't try that it works fine.

(%i1) display2d:false;

(out1) false
(%i2) f(x):=1/(%pi*x^4+%pi*x^2+%pi)$

(%i3) integrate(f(x-1)*x^3,x,minf,inf);
Principal Value
(out3) 4*sqrt(3)/3
(%i4) f(x):=1/(%pi*x^4+%pi*x^2+%pi)$

(%i5) integrate(f(x-1)*x^3,x,minf,inf);
Principal Value
(out5) 4*sqrt(3)/3
(%i6)


----- Original Message ----- 
From: "reyssat" <eric.reyssat at math.unicaen.fr>
To: "Richard Hennessy" <rich.hennessy at verizon.net>
Cc: "Maxima List" <maxima at math.utexas.edu>
Sent: Monday, March 30, 2009 5:06 AM
Subject: Re: [Maxima] Endless loop during definte integral


Richard Hennessy a ?crit :
> I get an endless loop in the definite integral but not the indefinite integral in the following case.  The answer should be 
> integral
> does not converge, I am pretty sure.  I don't know if anything like this has been reported before.
>
> (%i1) f2(x):=(2*sigma^(3/2))/(%pi*x^4+2*%pi*sigma*x^2+%pi*sigma^2)$
> (%i2) integrate(f2(a*x-b)*x^3,x,minf,inf);
> Is  sigma  positive, negative, or zero?
> p;
> Is  sigma  positive or negative?
> p;
> Is  a b  positive, negative, or zero?
> p;
> Maxima encountered a Lisp error:
>  Console interrupt.
> Automatically continuing.
> To reenable the Lisp debugger set *debugger-hook* to nil.
> (%i3) display2d:false;
>
> (%o3) false
> (%i4) integrate(f2(a*x-b)*x^3,x);
> Is  sigma  positive or negative?
> p;
> (%o4) 2*sigma^(3/2)
> 
> *(log(a^2*x^2-2*a*b*x+sigma+b^2)/(2*%pi*a^4)+(3*b*sigma+b^3)*atan((2*a^2*x-2*a*b)/(2*a*sqrt(sigma)))/(2*%pi*a^4*sigma^(3/2))
>                                                     -((3*a*b*sigma-a*b^3)*x-sigma^2+b^4)
> 
> /(2*%pi*a^6*sigma*x^2-4*%pi*a^5*b*sigma*x+2*%pi*a^4*sigma^2+2*%pi*a^4*b^2*sigma))
> (%i5) build_info();
>
> Maxima version: 5.17.1
> Maxima build date: 19:10 12/18/2008
> host type: i686-pc-mingw32
> lisp-implementation-type: GNU Common Lisp (GCL)
> lisp-implementation-version: GCL 2.6.8
>
> (%o5)
> (%i6)
>
> Rich
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>

Hi Richard,

I simplified your example (sigma=a=b=1), and got the same problem, but I
suspect the loop to be very long although not endless : if you change
the middle term in f, replacing   2*%pi  by   %pi , then the value is
computed but takes a while (20 seconds).

Here is what I obtain :
- first try (middle term = %pi*x^2) : I get the right answer after 200
lines of unexpected "(%i3)(%i3)...(%i3)(%i3)" and 20 seconds.
- second try (same command as (%i2)) : I get the right answer after 20
seconds but no junk.
- third try (middle term = 2*%pi*x^2) : "endless" loop (more than 8
minutes).


(%i1) display2d:false;
(%o1) false
(%i2) f(x):=1/(%pi*x^4+%pi*x^2+%pi)$  integrate(f(x-1)*x^3,x,minf,inf);
(%i3) (%i3) (%i3) (%i3) (%i3) (%i3) (%i3) (%i3) (%i3) (%i3) (%i3)
......  [ about 200 lines of (%i3)  here] .....
(%i3) (%i3) (%i3) (%i3) (%i3) (%i3) (%i3) (%i3) (%i3) (%i3) (%i3)
Principal Value
(%o3) 4*sqrt(3)/3
(%i4) f(x):=1/(%pi*x^4+%pi*x^2+%pi)$  integrate(f(x-1)*x^3,x,minf,inf);
Principal Value
(%o5) 4*sqrt(3)/3
(%i6) f(x):=1/(%pi*x^4+2*%pi*x^2+%pi)$  integrate(f(x-1)*x^3,x,minf,inf);
Maxima encountered a Lisp error:

 Console interrupt.

Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.
(%i8) build_info();
Maxima version: 5.17.1
Maxima build date: 19:10 12/18/2008
host type: i686-pc-mingw32
lisp-implementation-type: GNU Common Lisp (GCL)
lisp-implementation-version: GCL 2.6.8

Eric Reyssat