Asymptotics of $\displaystyle{\sum_{i=0}^n\sqrt{i(n-i)}}$ as $n\to+\infty$

asymptoticssequences-and-seriessingularityspecial functionstaylor expansion

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).$$

Best Answer

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 i}\oint_{(0+)}\frac{{\rm Li}_{-1/2}^2(z)}{z^{n+1}}\ dz$$ for $n\ge1$. Now ${\rm Li}_{-1/2}^2(z)$ is analytic on $\mathbb{C}\setminus \mathbb R_{\ge 1}$ and $O(\log z)$ as $z\to\infty$; thus the integral along the arc vanishes and we are left with, $$s(n)=\frac{1}{2\pi i}\oint_{\mathscr {H^+}}\frac{{\rm Li}_{-1/2}^2(z)}{z^{n+1}}{\ dz}$$ where $\mathscr{H^+}$ is the Hankel contour surrounding $[1,+\infty)$. Making the substitution $z\mapsto e^s$, $$s(n)=\frac{1}{2\pi i}\oint_\mathscr{H}e^{-ns}\operatorname{Li}_{-1/2}^2(e^s)\ ds$$ where $\mathscr{H}$ is the Hankel contour surrounding $[0,+\infty)$. Note that by $(25.12.12)$, $${\rm{Li}}^2_{-1/2}\left(e^s\right)=-\frac{\pi}{4}s^{-3}+\sqrt \pi \zeta \left( { - \frac{1}{2}} \right)( - s)^{ - 3/2} + F(s)$$ where $F(s)=o(1)$ as $s\to 0$. We can integrate these first two terms along the Hankel contour, $$-\frac{\pi}{4}\frac{1}{2\pi i}\oint_{\mathscr{H}}s^{-3}e^{-ns}\ ds=\frac{\pi}{4}\frac{1}{2!}\frac{d^2e^{-ns}}{ds^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 i}\oint_{\mathscr{H}}(-s)^{-3/2}e^{-ns}\ ds&=\frac{1}{\sqrt\pi}\zeta\left(-\frac{1}{2}\right)n^{1/2}\frac{1}{2i}\oint_{\mathscr{H}}(-t)^{-3/2}e^{-t}\ dt \\ &=-\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 i}\int_0^\infty e^{-nt}\lim_{\varepsilon\to 0}(F(t+i\varepsilon)-F(t-i\varepsilon))\ dt,$$ 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 + { i}\varepsilon ) - F(t - { i}\varepsilon )) = - 2{ 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}-\frac{1}{\sqrt \pi}\sum_{k=1}^\infty\frac{\Gamma(k-1/2)}{\Gamma(k+1)}\zeta\left(-\frac{1}{2}-k\right)\frac{1}{n^{k-1/2}}$$ as $n\to+\infty$.

Related Question