2
$\begingroup$

The following asymptotic

AsymptoticIntegrate[Sqrt[n^2 - k^2], {k, 1, n - 1}, {n, Infinity, 1}]

fails in 13.3 on Windows 10, returning the input. However, the following

Assuming[n >= 3, AsymptoticIntegrate[ Sqrt[n^2 - k^2], {k, 1, n - 1}, {n, Infinity, 1}]]

1/(6 n) + 1/(5 Sqrt[2] Sqrt[n]) - (2 Sqrt[2] Sqrt[n])/3 - n + ( n^2 \[Pi])/4

works well. What is the reason of it? I don't find any explanation in the documentation.

$\endgroup$
4
  • $\begingroup$ AsymptoticIntegrate[Sqrt[n^2 - k^2], {k, 1, n - 1}, {n, Infinity, 1}, PerformanceGoal -> "Quality"] also fails. $\endgroup$
    – user64494
    Commented Jan 23 at 7:18
  • $\begingroup$ The @Nasser's answer does not explain why AsymptoticIntegrate[Sqrt[n - k], {k, 1, n - 1}, {n, Infinity, 1}] works well, producing -(2/3) + 1/(4 Sqrt[n]) - Sqrt[n] + (2 n^(3/2))/3 $\endgroup$
    – user64494
    Commented Jan 23 at 10:08
  • $\begingroup$ I'm waiting for a rich-in-content answer. $\endgroup$
    – user64494
    Commented Jan 23 at 10:15
  • $\begingroup$ I'd like to add that Assuming[n >= - 30, AsymptoticIntegrate[ Sqrt[n^2 - k^2], {k, 1, n - 1}, {n, Infinity, 1}]] performs 1/(6 n) + 1/(5 Sqrt[2] Sqrt[n]) - (2 Sqrt[2] Sqrt[n])/3 - n + ( n^2 \[Pi])/4 . $\endgroup$
    – user64494
    Commented Jan 23 at 19:12

1 Answer 1

5
$\begingroup$

It seems because Integrate itself needs to know n is in integer domain.

Compare

Integrate[Sqrt[n^2 - k^2], {k, 1, n - 1}]

Which does not evaluate, with

Assuming[Element[n, Integers],  Integrate[Sqrt[n^2 - k^2], {k, 1, n - 1}]]

Which evaluates giving

Mathematica graphics

Hence your command becomes now

Assuming[Element[n, Integers], 
   AsymptoticIntegrate[Sqrt[n^2 - k^2], {k, 1, n - 1}, {n, Infinity, 1}]]

Mathematica graphics

V 14

$\endgroup$
14
  • $\begingroup$ Sorry, your attempt of the explanation is somewhat light-weighted: (i) Assuming[Element[n, PositiveReals], AsymptoticIntegrate[ Sqrt[n^2 - k^2], {k, 1, n - 1}, {n, Infinity, 1}]] works well; (ii) Integrate[Sqrt[n^2 - k^2], {k, 1, n - 1}, GenerateConditions -> False] performs 1/2 ((-1 + n) Sqrt[-1 + 2 n] - Sqrt[-1 + n^2] + n^2 ArcTan[(-1 + n)/Sqrt[-1 + 2 n]] - n^2 ArcTan[1/Sqrt[-1 + n^2]]). Thank you anyway. $\endgroup$
    – user64494
    Commented Jan 23 at 7:52
  • $\begingroup$ Moreover, even Assuming[Element[n, Reals], AsymptoticIntegrate[ Sqrt[n^2 - k^2], {k, 1, n - 1}, {n, Infinity, 1}]] and Assuming[Element[n, Reals], AsymptoticIntegrate[ Sqrt[n^2 - k^2], {k, 1, n - 1}, {n, -Infinity, 1}]] work. $\endgroup$
    – user64494
    Commented Jan 23 at 8:00
  • 1
    $\begingroup$ @user64494 OK, then use Assuming[Element[n, Reals]. Basically the issue is that Integrate needed to know it is not complex. I used Integers and found it to work. If Reals works, it leads to same conclusion. Integrate needed to know what domain n is in,. Did you really had to down vote me just for this? $\endgroup$
    – Nasser
    Commented Jan 23 at 8:16
  • 2
    $\begingroup$ @user64494 that is because when you add GenerateConditions -> False you are bypassing the code that caused it not to evaluate when no domain is given. It was hanging in the code which you told it not to evaluate. It is well know that GenerateConditions -> False can make many integrals not hang when they will otherwise will, since the default is GenerateConditions -> True. Of if they not hang, they will evaluate much faster when adding GenerateConditions -> False $\endgroup$
    – Nasser
    Commented Jan 23 at 8:47
  • 2
    $\begingroup$ @user64494 you want me to give a formula for saying that GenerateConditions->True can cause much more code to be evaluated and can sometime lead to hangs or slower evaluation? I've seen this many times. May be search can show some examples. But I have no time now to search for examples. But you can see this as reference what-exactly-does-generateconditions-do $\endgroup$
    – Nasser
    Commented Jan 23 at 9:54

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.