15

I am studying a bit of asymptotics and for practice I decided to find the asymptotic of the following, $$s(n)=\sum_{i=0}^n\sqrt{i(n-i)}$$ as $n\to\infty$. This comes directly from this post, where @Gary provided some hints in the comments: $${\rm Li}_{-1/2}^2(z)=\left(\sum_{n=0}^\infty \sqrt nz^n\right)\left(\sum_{n=0}^\infty \sqrt n z^n\right)=\sum_{n=0}^\infty\underbrace{\sum_{i=0}^n \sqrt{i(n-i)}}_{s(n)}z^n$$ but I am unable to finish the problem with this method as I don't know how to find the $n$th Maclaurin coefficient. Feel free to also use any other methods to find the asymptotics (maybe Euler-Maclaurin), but such an answer will preferably come after the original issue is resolved. As a bonus, a derivation of the complete asymptotic expansion of $s(n)$ will also be nice to see.

Sorry for the long question. To outline:

  1. How to find the $n$th Maclaurin Coefficient?
  2. Alternative methods to find asymptotics?
  3. Complete asymptotic expansion?

My attempt is below.


By $(25.12.12)$, $$\begin{align*}{\rm{Li}}_{-1/2}(z)&=\frac{\sqrt\pi}{2}(-\log\left(z\right))^{-3/2}+\sum_{n=0}^\infty\frac{\zeta(-1/2-n)}{n!}\log^n(z) \end{align*}$$ which by Taylor's formula, $$\begin{align*} {\rm Li}_{-1/2}^2(z)&=-\frac{\pi}{4\log^3(z)}+\sum_{n=0}^\infty(-1)^n\sqrt\pi\frac{\zeta(-1/2-n)}{n!}(-\log(z))^{n-3/2}+F(z) \\ &=\frac{\pi}{4(1-z)}+\sum_{n=0}^\infty(-1)^n\sqrt\pi\frac{\zeta(-1/2-n)}{n!}(-\log(z))^{n-3/2}+G(z) \end{align*}$$ as $z\to1$, where $F(z),G(z)$ are holomorphic at $z=1$. Expanding the first term by its geometric series, $$\sum_{n=0}^\infty\left(s(n)-\frac{\pi}{4}\right)z^n=\sum_{n=0}^\infty(-1)^n\sqrt\pi\frac{\zeta(-1/2-n)}{n!}(-\log(z))^{n-3/2}+G(z)$$ as $z\to 1$. Now the RHS is, $$\sqrt\pi\zeta(-1/2)(-\log(z))^{-3/2}-\sqrt\pi\zeta(-3/2)(-\log(z))^{-1/2}+O\left(\sqrt{\log(z)}\right)$$ as $z\to1$, which by Taylor's formula, $$\sqrt\pi\zeta(-1/2)(1-z)^{-3/2}+\sqrt\pi\left(\zeta(-3/2)-\frac{3}{4}\zeta(-1/2)\right)(1-z)^{-1/2}+O\left((1-z)^{1/2}\right)$$ as $z\to1$. Now all that is left is to extract the $n$th Maclaurin coefficient of the function above as, $$s(n)=[z^n]{\rm Li}_{-1/2}^2(z).$$

bob
  • 3,079
  • 4
    Using this, we have $$\frac{S(n)}{n^2}= \frac{1}{n^2}\sum_{i=0}^n\sqrt{i(n-i)}= \frac{1}{n}\sum_{i=0}^n\sqrt{\frac{i}{n}\left(1-\frac{i}{n}\right)}=...$$ considering $f(x)=\sqrt{x(1-x)}$ $$...=\frac{1}{n}\sum_{i=0}^nf\left(\frac{i}{n}\right)$$ As a result $$\frac{S(n)}{n^2} \to \int_0^1f(x)dx=\frac{\pi}{8}, n\to\infty$$ So $$S(n) \sim \frac{\pi}{8} \cdot n^2$$ Does this work? – rtybase Aug 16 '23 at 09:24
  • @rtybase. Yes, this works as an alternative method to the one I've outlined in my question. This doesn't allow for the higher order asymptotics though. – bob Aug 16 '23 at 10:54
  • Except for the very first term of the asymptotic expansion, namely $\frac{\pi}{8}n^2$, I believe the problem is too dangerously close to https://en.wikipedia.org/wiki/Gauss_circle_problem to be simple to tackle. – Jack D'Aurizio Aug 16 '23 at 18:21
  • Heuristically, $S(n) \sim \frac \pi 8 n^2- k \sqrt n$ where $k\sim \frac 3 7$ – Claude Leibovici Aug 17 '23 at 06:00
  • @ClaudeLeibovici. Gary finds the coefficient of the second term, $$2\zeta\left(-\frac{1}{2}\right)\approx 0.415772$$ which is indeed close to your approximate, $$-k=-\frac{3}{7}\approx-0.428571$$ – bob Aug 17 '23 at 10:11
  • This shows you how to get the asymptotic expansion. – J.G. Aug 17 '23 at 10:17
  • 1
    Use the Cauchy integral formula for the Maclaurin coefficients and proceed as I did here. – Gary Aug 18 '23 at 00:41
  • @Gary. I am having trouble using the Hankel contour. Could you guide me on how to find where ${\rm Li}{-1/2}^2(z)$ is analytic on, and it's asymptotic behaviour as $z\to\infty$? I just applied Cauchy's integral formula. $$s(n)=\frac{1}{2\pi i}\oint{(0+)}\frac{{\rm Li}_{-1/2}^2(z)}{z^{n+1}}\ dz$$ – bob Aug 18 '23 at 05:29
  • Never mind, I think I got it. – bob Aug 18 '23 at 06:29
  • @Gary. After collapsing the contour back to the positive real axis, how do I extract the contribution from the origin? I tried using Cauchy's integral formula but it gives me a divergent result. – bob Aug 18 '23 at 08:24
  • @AkivaWeinberger. It seems weird that the $\frac{1}{\sqrt\pi}$ term only appears after the third term. I may have to recheck my work. – bob Aug 21 '23 at 17:24
  • @bob I think the error is mine; it should cancel with the offset Gamma term in the numerator. Let me double-check. – Akiva Weinberger Aug 21 '23 at 17:31
  • 1
    @JackD'Aurizio Given the final answer \begin{align} s(n)\sim{}&\frac\pi8n^2-2\zeta\left(-\frac12\right)\sqrt n-\zeta\left(-\frac32\right)\frac1{\sqrt n}\ &-\frac14\zeta\left(-\frac52\right)\frac1{n\sqrt n}-\frac18\zeta\left(-\frac72\right)\frac1{n^2\sqrt n}\ &-\frac5{64}\zeta\left(-\frac92\right)\frac1{n^3\sqrt n}-\frac7{128}\zeta\left(-\frac{11}2\right)\frac1{n^4\sqrt n}-\dotsb, \end{align} does this impact the Gauss problem at all? – Akiva Weinberger Aug 21 '23 at 17:37
  • 2
    Here's a Desmos graph with the asymptotic expansion. Slide around the $n$ slider to see how $f(n)$ (exact) and $g(n)$ (asymptotic) match. https://www.desmos.com/calculator/tpknap1vcq – Akiva Weinberger Aug 21 '23 at 18:08
  • @AkivaWeinberger. Thank you, that is very neat. – bob Aug 21 '23 at 18:11
  • @Gary. Starting from the expansion in terms of $(1-z)^{\alpha}$ in the OP and expanding those terms using the asymptotic form of their coefficients found in the link you provided me previously, we have

    $$\sqrt{\pi}\zeta(-1/2)\left(\frac{2}{\sqrt \pi}n^{1/2}+\frac{3}{4\sqrt{\pi}}n^{-1/2}+O(n^{-3/2})\right)+\sqrt{\pi}\left(\zeta(-3/2) -\frac{3}{4}\zeta(-1/2)\right)\left(\frac{1}{\sqrt{\pi }}n^{-1/2}+O(n^{-3/2})\right)+O(n^{-3/2})$$ i.e., $$2\zeta(-1/2)n^{1/2}\color{red}{+}\zeta(-3/2)n^{-1/2}+O(n^{-3/2})$$

    which is a sign error. Would you mind lending me some help?

    – bob Jun 27 '24 at 22:10
  • @bob WolframAlpha tells me that $$ \operatorname{Li}_{ - 1/2}^2 (z) = \frac{\pi}{4}(1 - z)^{-3} - \frac{3\pi}{8}(1 - z)^{-2} + \sqrt{\pi} \zeta\left( - \tfrac{1}{2} \right)(1 - z)^{-3/2} \+ \frac{\pi}{8}(1 - z)^{-1} - \sqrt{\pi} \left( \zeta\big( - \tfrac{3}{2} \big) + \tfrac{3}{4}\zeta \left( - \tfrac{1}{2} \right) \right)(1 - z)^{-1/2} + \mathcal{O}(1) $$ as $z\to 1$. – Gary Jun 28 '24 at 00:24
  • @Gary. Seems like I've completely flunked my expansion in the OP. May I see the wolfram code you used? – bob Jun 28 '24 at 09:18
  • @bob Indeed, since your have $1/\log^3 z$ and $\log z \sim z-1$ near $z=1$, you ought to have $1/(1-z)^3$, which you do not. Tell WolframAlpha "Expand (PolyLog[-1/2, 1-w])^2 about w=0" and ask to show more terms. You can then replace $w$ by $1-z$. – Gary Jun 28 '24 at 09:59
  • @Gary. Yes, I see my mistake now. I was trying "Series[PolyLog[-1/2, z]^2, {z, 1, 0}]" which gave me a complicated result. In this case, why is it preferable to expand $\operatorname{Li}{-1/2}(1-w)$ about $w=0$ instead of $\operatorname{Li}{-1/2}(z)$ about $z=1$? Intuitively, since we require an expansion in terms of $(1-z)^{\alpha}$, I expected an expansion about $1$. But from your comment it seems like it's better to expand about $0$, then later shift the expansion. I feel like I am missing something fundamentally. – bob Jun 28 '24 at 10:38
  • @bob It is because of the brach-cut. Mathematica is not so good with multi-valued functions. It tries to expand in fractional powers of $z-1$ instead of $1-z$. – Gary Jun 28 '24 at 11:23
  • @Gary. I see. Your insights always amaze me. Thank you! – bob Jun 28 '24 at 11:37

2 Answers2

7

Derivation of full asymptotic expansion (thank you @Gary)

Using the $n$th coefficient extraction operator $[z^n]$, $$\begin{align*}s(n)&=\sum_{i=0}^n\sqrt{i(n-i)}=[z^n]\left(\sum_{n=0}^\infty \sqrt nz^n\right)\left(\sum_{n=0}^\infty \sqrt n z^n\right)=[z^n]{\rm Li}_{-1/2}^2(z)\end{align*}$$ therefore by Cauchy's integral formula, $$s(n)=\frac{1}{2\pi {\rm i}}\oint_{(0+)}\frac{{\rm Li}_{-1/2}^2(z)}{z^{n+1}}\ {\rm d}z$$ for $n\ge1$. Now ${\rm Li}_{-1/2}^2(z)$ is analytic on $\mathbb{C}\setminus \mathbb R_{\geqslant 1}$ and $\mathcal O(\log ^{-1/2}|z|)$ as $z\to\infty$; thus the integral along the arc vanishes and we are left with, $$s(n)=\frac{1}{2\pi {\rm i}}\oint_{\mathscr {H^+}}\frac{{\rm Li}_{-1/2}^2(z)}{z^{n+1}}{\ {\rm d}z}$$ where $\mathscr{H^+}$ is the Hankel contour surrounding $[1,+\infty)$. Making the substitution $z= {\rm e}^s$, $$s(n)=\frac{1}{2\pi {\rm i}}\oint_\mathscr{H}{\rm e}^{-ns}\operatorname{Li}_{-1/2}^2({\rm e}^s)\ {\rm d}s$$ where $\mathscr{H}$ is the Hankel contour surrounding $[0,+\infty)$. Note that by $(25.12.12)$, $${\rm{Li}}^2_{-1/2}\left({\rm e}^s\right)=-\frac{\pi}{4}s^{-3}+\sqrt \pi \zeta \left( { - \frac{1}{2}} \right)( - s)^{ - 3/2} + F(s)$$ where $F(s)=\mathcal O(s^{-1/2})$ as $s\to 0$. We can integrate these first two terms along the Hankel contour, $$-\frac{\pi}{4}\frac{1}{2\pi {\rm i}}\oint_{\mathscr{H}}s^{-3}{\rm e}^{-ns}\ {\rm d}s=\frac{\pi}{4}\frac{1}{2!}\frac{{\rm d}^2{\rm e}^{-ns}}{{\rm d}s^2}\bigg{|}_{s=0}=\frac{\pi}{8}n^2$$ which is the leading order term, and with a change of variables $t=ns$ the next asymptotic term is, $$\begin{align*}\sqrt\pi\zeta\left(-\frac{1}{2}\right)\frac{1}{2\pi {\rm i}}\oint_{\mathscr{H}}(-s)^{-3/2}{\rm e}^{-ns}\ {\rm d}s&=\frac{1}{\sqrt\pi}\zeta\left(-\frac{1}{2}\right)n^{1/2}\frac{1}{2{\rm i}}\oint_{\mathscr{H}}(-t)^{-3/2}{\rm e}^{-t}\ {\rm d}t \\ &=-\frac{1}{\sqrt\pi}\zeta\left(-\frac{1}{2}\right)n^{1/2}\Gamma\left(-\frac{1}{2}\right) \\ &=2\zeta\left(-\frac{1}{2}\right)n^{1/2} \end{align*}$$ where the Hankel representation of the $\Gamma$ function and the well known value $\Gamma(-1/2)=-2\sqrt\pi$ was used. Now collapsing the contour back to the positive real line, $$s(n)=\frac{\pi}{8}n^2+2\zeta\left(-\frac{1}{2}\right)n^{1/2}+\frac{1}{2\pi {\rm i}}\int_0^{+\infty} {\rm e}^{-nt}\lim_{\varepsilon\to 0^+}(F(t+{\rm i}\varepsilon)-F(t-{\rm i}\varepsilon))\ {\rm d}t,$$ with $$F(s) = ( - s)^{ - 3/2} \sum\limits_{k = 1}^\infty {\sqrt \pi \frac{{\zeta ( - 1/2 - k)}}{{k!}}s^k } + H(s)$$ as $s\to 0$, where $H(s)$ is analytic at the origin. Taking the limit as $\varepsilon\to 0^+$, $$ \lim_{\varepsilon\to 0^+}(F(t + { {\rm i}}\varepsilon ) - F(t - { {\rm i}}\varepsilon )) = - 2{ {\rm i}}\sqrt \pi \sum\limits_{k = 1}^\infty {\frac{{\zeta ( - 1/2 - k)}}{{k!}}t^{k - 3/2} } $$ hence by Watson's lemma we obtain the complete asymptotic expansion, $$s(n)\sim\frac{\pi}{8}n^2+2\zeta\left(-\frac{1}{2}\right)n^{1/2}+2\sum_{k=1}^\infty\binom{k-3/2}{k}\frac{\zeta\left(-1/2-k\right)}{n^{k-1/2}}$$ as $n\to+\infty$.

bob
  • 3,079
  • We have $$ {\mathop{\rm Li}\nolimits} _{ - 1/2}^2 ({\rm e}^s ) = - \frac{\pi }{4}s^{ - 3} + \sqrt \pi \zeta \left( { - \frac{1}{2}} \right)( - s)^{ - 3/2} + o(1) $$ as $s\to 0$. For the first two terms we can compute the integrals along the Hankel contours: $$
    • \frac{\pi }{4}\frac{1}{{2\pi {\rm i}}}\oint_\mathscr{H} {s^{ - 3} {\rm e}^{ - ns} {\rm d}s} = - \frac{\pi }{4}\left[ {\frac{1}{{2!}}\frac{{{\rm d}^2 {\rm e}^{ - ns} }}{{{\rm d}s^2 }}} \right]_{s = 0} = \frac{\pi }{8}n^2

    $$

    – Gary Aug 21 '23 at 00:35
  • and $$ \sqrt \pi \zeta \left( { - \frac{1}{2}} \right)\frac{1}{{2\pi {\rm i}}}\oint_\mathscr{H} {( - s)^{ - 3/2} {\rm e}^{ - ns} {\rm d}s} = \frac{1}{{\sqrt \pi }}\zeta \left( { - \frac{1}{2}} \right)n^{1/2} \frac{1}{{2{\rm i}}}\oint_\mathscr{H} {( - t)^{ - 3/2} {\rm e}^{ - t} {\rm d}t}\ = - \frac{1}{{\sqrt \pi }}\zeta \left( { - \frac{1}{2}} \right)n^{1/2} \Gamma \left( { - \frac{1}{2}} \right) = 2\zeta \left( { - \frac{1}{2}} \right)n^{1/2} $$ – Gary Aug 21 '23 at 00:36
  • Then you integrate the terms hidden in $o(1)$ by collapsing the contour to the positive real line and using Watson's lemma. – Gary Aug 21 '23 at 00:38
  • @Gary. When I take the second derivative of $e^{-ns}$ wrt $s$, I get $n^2 e^{-ns}$, hence a sign error for the first term. What am I missing? – bob Aug 21 '23 at 04:54
  • My mistake, the $-$ sign is not needed after the first $=$ sign. – Gary Aug 21 '23 at 05:44
  • @Gary. I am trying my best but I cannot figure out how you found the series expansion for $f(t)$ required for Watsons lemma in your answer. Could you help me in my answer? – bob Aug 21 '23 at 07:18
  • Note that what remains after getting the first two terms is $$ \int_0^{ + \infty } {{\rm e}^{ - nt} \frac{1}{{2\pi {\rm i}}}\mathop {\lim }\limits_{\varepsilon \to 0} (F(t + {\rm i}\varepsilon ) - F(t - {\rm i}\varepsilon )){\rm d}t} $$ with $$ F(s) = ( - s)^{ - 3/2} \sum\limits_{n = 1}^\infty {\sqrt \pi \frac{{\zeta ( - 1/2 - n)}}{{n!}}s^n } + H(s) $$ near the origin. Here $H(s)$ is analytic at $s=0$. You found this in your original post with $H(s)$ corresponding to $F(\mathrm{e}^s)$ there. – Gary Aug 21 '23 at 07:30
  • @Gary. I see it now, I was confusing myself with too many functions. How do I deal with the limit $\epsilon\to 0$? – bob Aug 21 '23 at 08:57
  • Can you see that the limit of that difference is $$ \mathop {\lim }\limits_{\varepsilon \to 0} \left[ {( - (t + i\varepsilon ))^{ - 3/2} - ( - (t - i\varepsilon ))^{ - 3/2} } \right]\sum\limits_{n = 1}^\infty {\sqrt \pi \frac{{\zeta ( - 1/2 - n)}}{{n!}}t^n } ;? $$ (note that $H(s)$ is single-valued). The limit in front of the sum should not be difficult. – Gary Aug 21 '23 at 10:05
  • 1
    @Gary. Thank you for writing it out like that, its much simpler than I thought. I should now have no more questions, and will write up the complete asymptotic expansion after I come back from dinner. Thanks again. – bob Aug 21 '23 at 10:09
  • 1
    @Gary. Sorry for the delay. Does my result look correct? – bob Aug 21 '23 at 16:48
  • @bob The coefficient of $n^{-3/2}$, which according to you should be $-\frac14\zeta\left(-\frac52\right)\approx-0.002129$, doesn't seem to check out numerically. – Akiva Weinberger Aug 21 '23 at 17:46
  • @AkivaWeinberger. What should the correct numerical value be? – bob Aug 21 '23 at 17:49
  • 2
    @bob Never mind!! Your value is correct. I simply didn't use enough decimal places for the $\sqrt n$ coefficient, and this was messing up values downstream. I was using $6$ decimal places, but for $n\approx800$ (where I was testing) I needed $10$. – Akiva Weinberger Aug 21 '23 at 17:55
  • You may add that $$ \mathop {\lim }\limits_{\varepsilon \to 0} (F(t + {\rm i}\varepsilon ) - F(t - {\rm i}\varepsilon )) = - 2{\rm i}\sqrt \pi \sum\limits_{k = 1}^\infty {\frac{{\zeta ( - 1/2 - k)}}{{k!}}t^{k - 3/2} } . $$ – Gary Aug 21 '23 at 23:57
  • 1
    @Gary. I will do. Thank you! – bob Aug 22 '23 at 04:16
  • @Gary. Sorry for digging up this old post many times, but is $F(s)=o(1)$ as $s\to 0$ true? Since $$F(s) = ( - s)^{ - 3/2} \sum\limits_{n = 1}^\infty {\sqrt \pi \frac{{\zeta ( - 1/2 - n)}}{{n!}}s^n } + H(s)$$ as $s\to 0$ (for single valued $H(s)$), so I think there is a $(-s)^{-1/2}$ term. However, even if that is the case, I think Watson's lemma can still be applied here so it is not a big issue. – bob Sep 03 '24 at 10:46
  • 1
    Yes, Watson's lemma requires much less than $o(1)$: https://dlmf.nist.gov/2.3.ii – Gary Sep 03 '24 at 22:36
  • Alternatively, you can just separate the first term, compute that integral exactly, and apply Watson for the rest. – Gary Sep 04 '24 at 02:32
  • @Gary. Thank you, I get the sufficient conditions now. But how are we allowed to apply Watson from the second term? Since our series is $\sum a_k t^{k-3/2}$, using the notation by DLMF, we require $\mu = 1$ but that implies $\lambda=-1/2$, however it is assumed $\lambda$ is positive. – bob Sep 04 '24 at 06:35
  • 1
    @bob $$ \sum\limits_{k = 1}^\infty {\frac{{\zeta ( - 1/2 - k)}}{{k!}}t^{k - 3/2} } = \sum\limits_{k = 0}^\infty {\frac{{\zeta ( - 3/2 - k)}}{{(k + 1)!}}t^{(2k - 1)/2} } , $$ so $$ \lambda = 1,\quad \mu = 2,\quad a_{2k} = \frac{{\zeta ( - 3/2 - k)}}{{(k + 1)!}},\quad a_{2k + 1} = 0. $$ – Gary Sep 04 '24 at 09:58
3

The expansion in my OP from almost a year ago is wrong. The correct expansion is

$$\operatorname{Li}_{-1/2}^2 (z)=\frac{\pi}{4}(1-z)^{-3}-\frac{3\pi}{8}(1-z)^{-2}+\sqrt\pi \zeta(-1/2)(1-z)^{-3/2} \\ +\frac{\pi}{8}(1-z)^{-1}-\sqrt{\pi}\left(\zeta(-3/2)+\frac{3}{4}\zeta(-1/2)\right)(1-z)^{-1/2}+O(1)$$

as $z\to 1$, and singularity analysis via replacing the $(1-z)^{-\alpha}$ terms by asymptotic forms of their coefficients found on page 388 in this book shows that the $n$th Maclaurin coefficient of this is

$$ \frac{\pi}{4}\left(\frac{1}{2}n^2+\frac{3}{2}n+1\right)-\frac{3\pi}{8}\left(n+1\right)+\sqrt{\pi}\zeta(-1/2)\left(\frac{2}{\sqrt{\pi}}n^{1/2}+\frac{3}{4\sqrt\pi} n^{-1/2}+O(n^{-3/2})\right) \\ +\frac{\pi}{8}\left(1\right)-\sqrt{\pi}\left(\zeta(-3/2)+\frac{3}{4}\zeta(-1/2)\right)\left( \frac{1}{\sqrt\pi} n^{-1/2}+O(n^{-3/2})\right)+O(n^{-1}) $$

as $n\to +\infty$, i.e.,

$$s(n) =\frac{\pi}{8} n^2+2\zeta\left(-\frac{1}{2}\right)n^{1/2} -\zeta\left(-\frac{3}{2}\right)n^{-1/2} +O(n^{-1})$$

as $n\to +\infty$.

bob
  • 3,079