3
$\begingroup$

Bug introduced in 13.1, persisting through 13.2.1.


h[i_] = i^(-11./10);
d = 50;
eval[int_] := Print["Value=", N[Activate[int] /. s -> d]];
int = Inactive[Integrate][Exp[-s h[i]]/d, {i, 1, d}];
eval@int;
int = IntegrateChangeVariables[int, hi, hi == h[i]];
eval@int;

It prints

Value=0.230237
Value=-0.00252577

I could work around the other bug by negating the result, but this one seems more serious.

Manual change of variables works with some warnings

gi[y_] = First@SolveValues[h[x] == y, x];
arg = -D[gi[y], y]*Exp[-s y]/d;
Integrate[arg /. s -> d, {y, h[d], h[1]}]    (* 0.230237 *)
$\endgroup$
1
  • 1
    $\begingroup$ With h[i_] = i^(-11/10) it gives Value=0.230237 and Value=-0.230237. $\endgroup$ Mar 9 at 7:52

1 Answer 1

3
$\begingroup$

The wrong integral region is caused by failure of convergence of NMinValue.

MinValue[{x,1.<=1./x^(10/11.)<=50.&&x∈Reals},x]

To bypass it, change the method e.g.

SetOptions[MinValue,Method->"SimulatedAnnealing"]

then

h[i_] = i^(-11./10);
d = 50;
eval[int_] := Print["Value=", N[Activate[int] /. s -> d]];
int = Inactive[Integrate][Exp[-s h[i]]/d, {i, 1, d}];
eval@int;
int = IntegrateChangeVariables[int, hi, hi == h[i]];
eval@int;

enter image description here


Some of the Messages are suppressed by default. To locate the bug we can use trick like

Block[{Quiet=#&},
  On[General::stop];
  your code here
]

and then see if some errors have been hidden...

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.