# Limit takes too long

I want to compute the following limit

Limit[
Integrate[BetaRegularized[(2 h - h^2), (d - 1)/2, 1/2], {h, 0, 1}],
d -> Infinity
]


However, surprisingly, it takes too long. Is there any technique to simplify this task in such a way that Mathematica can accomplish it in a reasonable amount of time?

• 1) Why is it surprising that it takes a long time? Is this a known result? 2) Have you noticed that the integral itself returns unevaluated? – MarcoB Dec 21 '20 at 22:09
• @MarcoB I am to new to Mathematica, I was thinking it is simple. It is easy to analytically show that the function argument of the limit is asymptotic to $\sqrt{\frac{2}{\pi d}}$ for $d\to\infty$. – Penelope Benenati Dec 22 '20 at 17:44

We can change the variable 2h-h^2->z by hand.

Reduce[z == 2 h - h^2 && 1 > h > 0, h, Reals]


0 < z < 1 && h == 1 - Sqrt[1 - z]

1/D[2 h - h^2, h] /. h -> 1 - Sqrt[1 - z] // Simplify


1/(2 Sqrt[1 - z])

It means that the change variable is one to one and $$0, $$\mathrm{d}h=\frac{1}{2 \sqrt{1-z}}$$

Integrate[
BetaRegularized[z, (d - 1)/2, 1/2]*1/(2 Sqrt[1 - z]), {z, 0, 1}]


ConditionalExpression[2/((-1 + d) Beta[1/2 (-1 + d), 1/2]), Re[d] > -1]

Limit[%, d -> ∞]


0

So the result is $$0$$.

We can verify this result by NIntegrate.

With[{d = 100000000000},
NIntegrate[BetaRegularized[(2 h - h^2), (d - 1)/2, 1/2], {h, 0, 1},
AccuracyGoal -> 30, PrecisionGoal -> 50]]


0.

DiscretePlot[
NIntegrate[
BetaRegularized[(2 h - h^2), (d - 1)/2, 1/2], {h, 0, 1}], {d, 10,
100}, AxesOrigin -> {0, 0}, Joined -> False, Filling -> None]


• Not really sure that the first NIntegrate is showing what is claimed. You should set WorkingPrecision much higher than PrecisionGoal, say 100 (and why reduce the AccuracyGoal?). – Michael E2 Dec 22 '20 at 6:19
• @MichaelE2 There are no other meaning there,just avoid the warning message :) I do not understand the settings of precision. – cvgmt Dec 22 '20 at 6:36
• With WorkingPrecision -> 100, MaxRecursion -> 30, the value of the integral I got on WolframCloud was ~10^-6, which seemed a more reasonable result. With machine precision the integrand is not computed correctly (there are errors, which are probably caught by NIntegrate which probably increases the internal working precision automatically). But this morning on my laptop, I don't need MaxRecursion and the result is ~10^-998, which is even stronger evidence. I can't explain the difference with WC. The result 0., when it's unlikely to be exactly zero, tends to make me suspicious. – Michael E2 Dec 22 '20 at 14:16