Estimating $\sum n^{-1/2}$ Could someone please explain me how does one obtain the following estimate:
$$
\sum_{n \leq X} n^{-1/2} = \frac12 X^{1/2} + c + O(X^{-1/2}),
$$
where $c$ is some constant.
Thank you very much!
PS As pointed out in the comments, $1/2$ in front of $X^{1/2}$ is a typo... I would like an answer with the correct coefficient here.
 A: $$\sqrt{n+1}-\sqrt{n}=\frac{1}{\sqrt{n+1}+\sqrt{n}}=\frac{1}{2\sqrt{n}}-\frac{1}{2\sqrt{n}\left(\sqrt{n}+\sqrt{n+1}\right)^2}$$
hence the claim follows just by creative telescoping/ the Hermite-Hadamard inequality, but the first term of the asymptotics should be $\color{red}{2}\cdot\,X^{1/2}$. In such a case, $c=\zeta\left(\frac{1}{2}\right)$.
A: You can use the Euler McLaurin formula which gives us the estimate
$$ 2 \sqrt{n} + K + \frac{1}{2\sqrt{n}} + \mathcal{O}(n^{-3/2})$$
It can be shown by other means that $K = \zeta(\frac{1}{2})$.
A: Denote $f(x)=x^{-1/2}, \ S_n=\sum_{k=1}^nf(k)$. Using the mean value theorem we obtain that $f(x)=f(k)+(x-k)f'(x_k)$, for $x\in[k,k+1]$ where $x_k\in(k,k+1)$, thus 
\begin{align*}
\int_{1}^{n+1}f(x)dx-S_n=\sum_{k=1}^n\int_{k}^{k+1}(f(x)-f(k))dx=\sum_{k=1}^n\int_{k}^{k+1}(x-k)f'(x_k)dx=\frac{1}{2}\sum_{k=1}^nf'(x_k).
\end{align*}
Since
\begin{align*}
\int_{1}^{n+1}f(x)dx=2n^{1/2}-2
\end{align*}
and
\begin{align*}
\Big|\sum_{k=n+1}^{\infty}f'(x_k)\Big|\leq\int_{n}^{\infty}|f'(x)|dx= f(n)=n^{-1/2}
\end{align*}
we obtain
\begin{align*}
S_n=2n^{1/2}-2-\frac{1}{2}\sum_{k=1}^{\infty}f'(x_k)+\sum_{k=n+1}^{\infty}f'(x_k)=2n^{1/2}+c+O(n^{-1/2}).
\end{align*}
Comment: to get better expression for c use Taylor formula of second order: $f(x)=f(k)+(x-k)f'(k)+(x-k)^2/2f''(k)$.
