# Why doesn't AsymptoticIntegrate work?

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.

• AsymptoticIntegrate[Sqrt[n^2 - k^2], {k, 1, n - 1}, {n, Infinity, 1}, PerformanceGoal -> "Quality"] also fails. Commented Jan 23 at 7:18
• 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 Commented Jan 23 at 10:08
• I'm waiting for a rich-in-content answer. Commented Jan 23 at 10:15
• 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 . Commented Jan 23 at 19:12

## 1 Answer

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

Hence your command becomes now

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


V 14

• 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. Commented Jan 23 at 7:52
• 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. Commented Jan 23 at 8:00
• @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? Commented Jan 23 at 8:16
• @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 Commented Jan 23 at 8:47
• @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 Commented Jan 23 at 9:54