# Asymptotic of $\sum_{n = 1}^{N}\frac{1}{n}$ versus $\sum_{1 \leq n \leq x}\frac{1}{n}$

Consider the series $\sum_{n = 1}^{N}\frac{1}{n}$. It is well known that we have the asymptotic: $$\sum_{n = 1}^{N}\frac{1}{n} = \log N + \gamma + \frac{1}{2N} + \frac{1}{12N^{2}} + O(N^{-3}).$$

My question: Consider the similar sum $F(x) = \sum_{1 \leq n \leq x}\frac{1}{n}$. Note that $F(N) = \sum_{n = 1}^{N}\frac{1}{n}$. Then does $F$ has the same asymptotic above? That is, is $$F\sum_{1 \leq n \leq x}\frac{1}{n} = \log x + \gamma + \frac{1}{2x} + \frac{1}{12x^{2}} + O(x^{-3})?$$ I think this should be true, but the only thing I can come up with is to look at $F(\lfloor x \rfloor)$ and use the asymptotic for $\sum_{n = 1}^{\lfloor x \rfloor}\frac{1}{n}$ but I am unsure how to compare $\log x$ and $\log \lfloor x \rfloor$ in a way that the error that occurs is $O(x^{-3})$.

Let $g(x)$ denote any $C^2$ function such that $$g(x)=\log x + \gamma+\frac{1}{2x}+\frac{1}{12x^2}+O(x^{-3})$$ Then $g'(x)= \frac{1}{x}-\frac{1}{2x^2}+O(x^{-3})$ and $g''(x)=-\frac{1}{x^2}+O(x^{-3})$, so the Taylor Series gives: $$g(x)=g(\lfloor x\rfloor)+\{x\}\left(\frac{1}{x}-\frac{1}{2x^2}\right)-\frac{1}{2}\left(\frac{\{x\}}{x}\right)^2+O(x^{-3})$$ Therefore by a density argument, we have the following growth of $F(\lfloor x\rfloor)$: $$F(\lfloor x\rfloor)=\log x + \gamma + \left(\frac{1}{2}-\{x\}\right)\frac{1}{x} +\left(\frac{1}{12}-\frac{\{x\}+\{x\}^2}{2}\right)\frac{1}{x^2}+O(x^{-3})$$
• In a similar manner, you can go out to any number of terms and your "coefficients" will just be polynomials in terms of the fractional part $\{x\}$. Commented Jan 16, 2015 at 5:11
Note that $$\log x - \log \lfloor x \rfloor=\log x - \log\left(x - [x]\right)=-\log\left(1-\frac{[x]}{x}\right)=\frac{[x]}{x}+O(x^{-2}),$$ where $[x]$ is the fractional part of $x$, and is clearly $O(1)$. That is, the oscillations around the smooth curve $\log x$ contribute already at the same order as $1/x$. Therefore, the best you can say is that $$F(x)=\log x + \gamma + O(x^{-1}).$$
• @pre-kidney: Yes, but only if you include non-polynomials like $[x]$ in the coefficients. If you're going to allow non-polynomials, you may as well just replace $N$ by $\lfloor x \rfloor$ in the original asymptotic expansion, right? Commented Jan 16, 2015 at 5:11
• The idea is that $\{x\}$ is something small which you can control. For instance you could take $x\to\infty$ of the form $x=n+\frac{1}{2}$. It seems like this is what was intended in the question. Commented Jan 16, 2015 at 5:14