## #200 defint/limit infinite loop

closed
nobody
4
2008-02-17
2002-12-22
No

integrate(1/(x^5-1),x,1,inf) appears to get into an infinite
loop inside \$limit (over 4 hours CPU).

## Discussion

• Stavros Macrakis - 2002-12-22

Logged In: YES
user_id=588346

Sorry,. I forgot to mention that this is under 5.5
GCL/Windows 2000.

• Stavros Macrakis - 2002-12-22
• priority: 5 --> 4

• Robert Dodier - 2006-04-09
• labels: --> Lisp Core - Integration

• Raymond Toy - 2007-06-13

Logged In: YES
user_id=28849
Originator: NO

FWIW, this still happens in 5.12 cvs.

What's happening is that maxima has computed the antiderivative correctly and is now trying to carefully substitute in the limits of integration to make sure everything is on the right sheet. This is basically done in take-principal and intsubs.

I don't understand why maxima does the limit essentially twice like limit(anti,x,1+eps,plus) - limit(anti,x,1-eps,minus). This seems to be where maxima is getting stuck. If it were to finish, maxima would then go and take the limit as eps goes to zero from above.

Perhaps if the pole is at one of the limits of integration as it is here, maxima should do something else? I think the current code assumes the pole is within the integration interval.

• Raymond Toy - 2007-06-19

Logged In: YES
user_id=28849
Originator: NO

If IN-INTERVAL in defint.lisp is slightly modified to use ASK-GREAT instead of ASK-GREATEQ, where ASK-GREAT checks if x > y instead of x >= y, then maxima quickly says the integral is divergent. I think this is correct since 1/(x^5-1) has a partial fraction expansion of 1/5/(x-1) + <stuff>.

Do not know if this change is the correct change or not.

• Dan Gildea - 2008-02-17
• status: open --> closed

• Dan Gildea - 2008-02-17

Logged In: YES
user_id=1797506
Originator: NO

Commented out call to \$logcontract from take-principal in
defint.lisp rev 1.55. \$logcontract was causing size of antiderivative to blow up.
No ill effects in test suite.

(%i12) integrate(1/(x^5-1),x,1,inf) ;
Integral is divergent
-- an error. To debug this try debugmode(true);
(%i13) integrate(1/(x^5-1),x,0,inf) ;
Principal Value
(%o13) (2*sqrt(2*sqrt(5)+10)*atan((sqrt(5)-3)*sqrt(2*sqrt(5)+10)/(4*sqrt(5)))
+2*sqrt(10-2*sqrt(5))*atan(sqrt(10-2*sqrt(5))*(sqrt(5)+3)/(4*sqrt(5)))
-sqrt(2)*sqrt(sqrt(5)+5)*%pi-sqrt(2)*sqrt(5-sqrt(5))*%pi)
/20