Maple bug? How to calculate the asymptotic expansion of the generalised harmonic function?

89 Views Asked by At

If I run the following command in Maple

asympt(harmonic(n, 1/2), n, 1)

the output is $$-\frac{1}{\sqrt{\frac{1}{n}}}+\zeta\left(\frac{1}{2}\right)+O\left(\sqrt{\frac{1}{n}}\right).$$ Is this a bug? Why is the answer negative? My understanding is that harmonic(n,1/2) calculates the following sum $$H_n^{(1/2)}=\sum_{k=1}^n\frac{1}{k^{1/2}},$$ so why does Maple give a negative expansion?

2

There are 2 best solutions below

7
On BEST ANSWER

Looking at the documentation of the harmonic function of two arguments, it's defined as harmonic(a,z)=$\zeta(z)-\zeta(0,z,a+1)$. For $\mathrm{Re}(z)>1$, $\zeta(z)=\sum_{k=1}^\infty \frac{1}{k^z}$ and $\zeta(n,z,v)=\frac{\partial^n}{\partial z^n} \sum_{k=0}^\infty \frac{1}{(k+v)^z}$.

Thus for $\mathrm{Re}(z)>1$ harmonic(n,z)=$\sum_{k=1}^\infty \frac{1}{k^z} - \sum_{k=0}^\infty \frac{1}{(k+n+1)^z}$.

"Formal simplification" of this expression for positive integer $n$ appears to result in $\sum_{k=1}^n \frac{1}{k^z}$ which is what you actually want to get. But "formal simplification" is not how this function is defined for $\mathrm{Re}(z) \leq 1$. It is instead defined by analytic continuation of the two zeta functions separately.

0
On

For the most general case $$H_n^{(p)}=n^{-p} \left(-\frac{n}{p-1}+\frac{1}{2}-\frac{p}{12 n}+O\left(\frac{1}{n^3}\right)\right)+\zeta (p)$$ So, if $p=\frac 12$ $$H_n^{\left(\frac{1}{2}\right)}=2 \sqrt{n}+\zeta \left(\frac{1}{2}\right)+\frac{1}{2\sqrt{{n}}}+O\left(\frac{1}{n^{3/2}}\right)=2 \sqrt{n}+\zeta \left(\frac{1}{2}\right)+O\left(\frac{1}{n^{1/2}}\right) $$