Question: to simplify or not simplify before calling integrate?

Is this a valid behvior by int?   

int(A,x,method=_RETURNVERBOSE) hangs.

But  int(simplify(A),x,method=_RETURNVERBOSE) returns in few seconds with "default" result same as int(A,x)

Should this have happen? I try to avoid calling simplify unless neccessary because it can add csgn's and signums and so on to the result. 

But the question is: Should one really need to simplify the integrand to get the result in this example? Does this mean one should call simplify on the integrand to avoid the hang that can show up? 

This only happens when using method=_RETURNVERBOSE 

Just trying to find out if this is normal behavior and can be expected sometimes.

25844

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

restart;

25844

A:=exp(-1/2*cos(2*x))*exp(-sin(x)^2);
int(A,x);

exp(-(1/2)*cos(2*x))*exp(-sin(x)^2)

exp(1/2)*exp(-1)*x

int(A,x,method=_RETURNVERBOSE);  #hangs

int(simplify(A),x,method=_RETURNVERBOSE)

["default" = x*exp(-1/2), "risch" = x*exp(-1/2), "orering" = x*exp(-sin(x)^2-(1/2)*cos(2*x)), FAILS = ("gosper", "lookup", "derivativedivides", "norman", "trager", "meijerg", "elliptic", "pseudoelliptic", "parallelrisch", "parts")]

 

 

Download why_int_hang_unless_simplify_june_15_2024.mw

Please Wait...