Let $n$ be a positive integer and $p>0$. Define $$ f_{n,p}(t) = \frac{(p \ln t - 1) (\sin^{2n} t)}{t^{p+1}}, $$ and I was trying to look at the behaviour of $$ \sqrt{n}\lim_{p\to 0^+}\int_0^\infty f_{n,p}(t)dt $$ when $n\to\infty$.

I evaluated the following three integrals: $$ \sqrt{n}\int_\pi^\infty f_{n,p}(t)dt,\quad \sqrt{n}\int_0^\infty f_{n,p}(t)dt,\quad \sqrt{n}\int_0^\pi f_{n,p}(t)dt $$ for some specific value of large $n$ and small $p>0$ and got the following results in MMA 12.1.1 (version June 9, 2020):

With[{n = 20000, p = 0.0000001}, NIntegrate[Sqrt[n] (p Log[t] - 1) Sin[t]^(2 n)/t^(p + 1), 
   {t, Pi, Infinity}, MaxRecursion -> 40]]
With[{n = 20000, p = 0.0000001}, NIntegrate[Sqrt[n] (p Log[t] - 1) Sin[t]^(2 n)/t^(p + 1), 
   {t, 0, Infinity}, MaxRecursion -> 40]]
With[{n = 20000, p = 0.0000001}, NIntegrate[Sqrt[n] (p Log[t] - 1) Sin[t]^(2 n)/t^(p + 1), 
   {t, 0, Pi}, MaxRecursion -> 40]]

The sum of the first and the third integral should be the second, so something is wrong here.

The third integral looks correct because I can manually calculate that $$ \lim_{n\to\infty} \lim_{p\to 0^+} \sqrt{n}\int_0^\pi f_{n,p}(t)dt = -\frac{2}{\sqrt{\pi}} = -1.128379\cdots, $$ which agrees with the numerical integration result. The second integral is probably wrong and I have no idea of what the correct value of the first integral should look like but I think it should be positive.

Is there some workaround to obtain at least consistent results for the three integrals?


Background of the problem. The problem is related to https://math.stackexchange.com/questions/2827591/alternate-proof-for-weighted-alternating-shifted-central-binomial-sum-relation Instead of $k^s$ in the sum, it is $\ln k$ in my problem, that is, I was looking at the sum $$ S_n = \sum_{k=1}^n (-1)^k \binom{2n}{n+k}\ln k. $$ I wish to show that $S_n / 2^{2n} >c/\sqrt{n}$ for some constant $c>0$ and all sufficiently large $n$. Following a similar approach to the answer in the link above, this boils down to showing that $$ \lim_{p\to 0^+} p \int_0^\infty f_{n,p}(t) dt > -\frac{c}{\sqrt n} $$ for some positive constant $c < \frac{1}{\sqrt{\pi}}(\gamma+\ln 2)\approx 0.7167$. I have managed to prove this analytically.


For a given value of $n$, Mathematica is able to evaluate the integral analytically (the answer is complicated, involving gamma and polygamma functions). So I did

 Sin[t]^(2 n)/t^(1 + p) (p Log[t] - 1), {t, 0, Infinity}, 
 Assumptions -> 0 < p < 1], p -> 0], {n, 10}]]
{-0.635181422730739, -0.551179369011369, -0.521962044454548, \
-0.507143476307785, -0.498189412540769, -0.492195004661885, \
-0.487901432379977, -0.484674935869789, -0.482161769590284, \

which makes me think what I wanted to show is true.

  • $\begingroup$ Also look at "Advanced Numerical Integration" under the NIntegrate help and search this forum for "highly oscillating integrals" for more help. $\endgroup$
    – Dominic
    Commented Jan 6, 2021 at 12:13
  • $\begingroup$ I believe your integrand becomes positive here: With[{n = 20000, p = 0.0000001}, Solve[(p Log[t] - 1) == 0, t]]. You might ponder the size of the that abscissa and how to integrate the spikes that occur every Pi along the t axis. You'd need millions of digits of precision. $\endgroup$
    – Michael E2
    Commented Jan 6, 2021 at 17:26

1 Answer 1


The main part of your integrand is Sin[t]^40000. This produces an infinity of very sharp peaks. Here is part of the graph:

enter image description here

I doubt if there is a purely numerical algorithm, that can integrate this from 0 to infinity.

Does this integrand appear in a real problem or is it rather a made up contraption to fool numerical routines. In the first case, some analytical method is needed and you may explain the problem. In the second case, it is not worth the time.

  • $\begingroup$ It does arise from a real problem. I was trying to prove a sum involving binomial coefficients is positive and this is somewhat an integral representation of that sum. Let me update my main post. $\endgroup$
    – user58955
    Commented Jan 6, 2021 at 11:28
  • 1
    $\begingroup$ Your claim that S[n]/2^(2n) > c/Sqrt[n] already fails for n==1, because Log[1]==0 $\endgroup$ Commented Jan 6, 2021 at 12:22
  • 1
    $\begingroup$ Sorry, I mean for sufficiently large $n$ $\endgroup$
    – user58955
    Commented Jan 6, 2021 at 12:49

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.