1
$\begingroup$
RegIntegral[Integrate[e_, {t_, 0, Infinity}]] := 5
RegSum[Sum[e_, {t_, 0, Infinity}]] := 5

RegIntegral[Integrate[Exp[3 x], {x, 0, Infinity}]]
RegSum[Sum[Exp[3 x], {x, 0, Infinity}]]

The only difference is in the first case we use sum, in the second case, integral. The tech support said it works as it should, and in the secnd case I get infinite loop.

I think, it is a bug.

$\endgroup$
1
  • $\begingroup$ Please write an informative title. Yours says nothing about the content of your question. $\endgroup$ Aug 25, 2023 at 18:57

1 Answer 1

5
$\begingroup$

Note that Sum has the attribute HoldAll, while Integrate does not. This means that the definition of RegSum has Infinity and not what Infinity evaluates to. The evaluation of Infinity:

Infinity //FullForm

DirectedInfinity[1]

Your definition:

DownValues[RegSum] //FullForm

List[RuleDelayed[HoldPattern[RegSum[Sum[Pattern[e,Blank[]],List[Pattern[t,Blank[]],0,Infinity]]]],5]]

Note the presence of Infinity.

When Sum evaluates and realizes that it does not converge, it returns a Sum expression where Infinity has been replaced with DirectedInfinity[1]:

Sum[Exp[3 x], {x, 0, Infinity}] //FullForm

Sum::div: Sum does not converge.

Sum[Power[E,Times[3,x]],List[x,0,DirectedInfinity[1]]]

This means that your definition, which is expecting Infinity doesn't fire because the upper limit is instead DirectedInfinity[1].

A possible workaround is to use:

RegSum[Sum[e_,{t_,0,DirectedInfinity[1]}]]:=5
$\endgroup$
1
  • $\begingroup$ I absolutely do not understand your explanation, but it works! $\endgroup$
    – Anixx
    Aug 25, 2023 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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