# How to calculate the derivative of $\int_0^x \left(\frac{1}{t}-[\frac{1}{t}]\right)dt$ at $x=0$?

Let $$F(x):=\int_0^x \left(\frac{1}{t}-[\frac{1}{t}]\right)dt$$ ,where $$[\frac{1}{t}]$$ is the largest integer no more than $$\frac{1}{t}$$.Prove $$F'(0)=\frac{1}{2}$$.

I have tried in this way: \begin{aligned} \lim_{n\to\infty}nF\left(\frac{1}{n}\right)&=\lim_{n\to\infty}n\sum_{k=n}^\infty\int_\frac{1}{k+1}^\frac{1}{k}\left(\frac{1}{t}-\left[\frac{1}{t}\right]\right)dt\\&=\lim_{n\to\infty}n\sum_{k=n}^\infty\int_\frac{1}{k+1}^\frac{1}{k}\left(\frac{1}{t}-k\right) dt\\&=\lim_{n\to\infty}n\sum_{k=n}^\infty \left(\ln(1+\frac{1}{k})-\frac{1}{k+1}\right)\\&=\lim_{n\to\infty}n\sum_{k=n}^\infty \left(\frac{1}{k}-\frac{1}{k+1}\right)\\&=1. \end{aligned} Please give me some ideas,thank you!

• $$\lim_{n\to\infty}n\sum_{k=n}^\infty (\ln(1+\frac{1}{k})-\frac{1}{k+1})=\lim_{n\to\infty}n\sum_{k=n}^\infty (\frac{1}{k}-\frac{1}{2k^2}+O(\frac{1}{k^3})-\frac{1}{k+1})$$ May 21, 2019 at 11:23
• Get it! Thank you.
– ling
May 21, 2019 at 11:50

With the help of reuns,I can complete the proof. \begin{aligned} \lim_{n\to\infty}nF\left(\frac{1}{n}\right)&=\lim_{n\to\infty}n\sum_{k=n}^\infty\int_\frac{1}{k+1}^\frac{1}{k}\left(\frac{1}{t}-\left[\frac{1}{t}\right]\right)dt\\&=\lim_{n\to\infty}n\sum_{k=n}^\infty\int_\frac{1}{k+1}^\frac{1}{k}\left(\frac{1}{t}-k\right) dt\\&=\lim_{n\to\infty}n\sum_{k=n}^\infty \left(\ln(1+\frac{1}{k})-\frac{1}{k+1}\right)\\&=\lim_{n\to\infty}n\sum_{k=n}^\infty \left(\frac{1}{k}-\frac{1}{2k^2}-\frac{1}{k+1}\right)\\&=\frac{1}{2}. \end{aligned} Since $$\frac{1}{n}=\sum_{k=n}^\infty \frac{1}{k(k+1)}<\sum_{k=n}^\infty \frac{1}{k^2}<\sum_{k=n}^\infty \frac{1}{k(k-1)}=\frac{1}{n-1}$$ and $$\frac{1}{n^3}\leq\sum_{k=n}^\infty\frac{1}{k^3}\leq\frac{1}{n}\sum_{k=n}^\infty\frac{1}{k^2}<\frac{1}{n(n-1)}.$$ Thanks to Martin R for reminding.

The following part is by Adam Latosiński, I just modified the typographical errors.Thanks for his help!

We still need to show that $$\lim\limits_{x\rightarrow 0} \frac{F(x)}{x} = \frac{1}{2}$$ also when we approach by a sequence with $$x\neq\frac{1}{n}$$. Let $$n=[ 1/x]$$, so that $$\frac{1}{n+1}, that is $$n\le\frac{1}{x}<{n+1}$$. We have \begin{align} \left|\frac{F(1/n)}{1/n} - \frac{F(x)}{x}\right| &\le \left|\frac{F(1/n)}{1/n} - \frac{F(1/n)}{x}\right| + \left|\frac{F(1/n)}{x} - \frac{F(x)}{x}\right| \\ &\le F(1/n) \left|n-\frac{1}{x}\right| + (n+1) |F(1/n)-F(x)| \\ &\le F(1/n) + (n+1) \int_{x}^{\frac{1}{n}} \Big(\frac{1}{t}- \left[\frac{1}{t}\right]\Big) dt \\ &\le F(1/n) + (n+1) \int_{x}^{\frac{1}{n}} 1 \,dt \\ &\le F(1/n) + (n+1)(\frac{1}{n}-\frac{1}{n+1}) \rightarrow 0\end{align} which proves that $$\lim_{x\rightarrow 0} \frac{F(x)}{x} = \lim_{n\rightarrow\infty} nF(\frac{1}{n}) = \frac12$$

• You should justify why the $O(\frac{1}{k^3})$ terms can be ignored. May 21, 2019 at 12:13
• I think we still need to show that $\lim_{x\rightarrow 0} F(x)/x = \frac12$ when we approach by a sequence with $x\neq \frac{1}{n}$. May 21, 2019 at 13:05

By the Stolz-Cesaro theorem $$\begin{eqnarray} \lim_{n\to\infty}n F\left(\frac{1}{n}\right) &=&\lim_{n\to\infty}\frac{F\left(\frac1n\right)}{\frac1n}\\ &=&\lim_{n\to\infty}\frac{F\left(\frac1{n+1}\right)-F\left(\frac1n\right)}{\frac1{n+1}-\frac1n}\\ &=&-\lim_{n\to\infty}n(n+1)\int^{\frac{1}{n+1}}_{\frac{1}{n}} \left(\frac{1}{t} - n\right)dt \\ &=&-\lim_{n\to\infty}n(n+1)\int^{\frac{1}{n+1}}_{\frac{1}{n}} \left(\frac{1}{t} - n\right)dt \\ &=&-\lim_{n\to\infty}n(n+1)\left[\ln\left(\frac{n}{n+1}\right)-\frac1{n+1}\right] \\ &=&\frac12. \end{eqnarray}$$

Using $$\{x\}=x-\lfloor x\rfloor$$ and substituting $$t\mapsto\frac1t$$, then integrating by parts (multiple times for higher precision), we get \begin{align} \int_0^x\left(\frac1t-\left\lfloor\frac1t\right\rfloor\right)\mathrm{d}t &=\int_{1/x}^\infty\left(\frac1{2t^2}+\frac{\{t\}-\frac12}{t^2}\right)\mathrm{d}t\\ &=\frac x2+\int_{1/x}^\infty\frac1{t^2}\,\mathrm{d}\left(\tfrac12\{t\}^2-\tfrac12\{t\}+\tfrac1{12}\right)\\ &=\frac x2-x^2\left(\tfrac12\left\{\tfrac1x\right\}^2-\tfrac12\left\{\tfrac1x\right\}+\tfrac1{12}\right)+\int_{1/x}^\infty\frac{\{t\}^2-\{t\}+\tfrac16}{t^3}\,\mathrm{d}t\\[6pt] &=\frac x2-x^2\left(\tfrac12\left\{\tfrac1x\right\}^2-\tfrac12\left\{\tfrac1x\right\}+\tfrac1{12}\right)+O\!\left(x^3\right) \end{align} Therefore, $$\lim_{x\to0}\frac1x\int_0^x\left(\frac1t-\left\lfloor\frac1t\right\rfloor\right)\mathrm{d}t=\frac12$$

I have a solution that utilises the digamma function:

\begin{align} F(\frac{1}{n}) &= \sum_{k=n}^\infty \int_{\frac{1}{k+1}}^{\frac{1}{k}} (\frac{1}{t} - k)dt = \\ &= \sum_{k=n}^\infty \int_{k}^{k+1} \frac{s - k}{s^2} ds = \\ &= \sum_{k=n}^\infty \int_{0}^{1} \frac{s}{(s+k)^2} ds = \\ &= \sum_{k=0}^\infty\int_{0}^{1} s \frac{1}{(s+k+n)^2} ds = \\ &= \int_{0}^{1} s \,\psi'(s+n) ds = \\ &= [s\psi(s+n)]_{s=0}^1 - \int_{0}^{1} \psi(s+n) ds = \\ &= \psi(n+1) - [\ln \Gamma(s+n)]_{s=0}^1 = \\ &= \psi(n+1) - \ln \frac{\Gamma(n+1)}{\Gamma (n)} = \\ &= \psi(n+1) - \ln n\end{align} For large $$n$$ we have Stirling formula $$\ln\Gamma(n+1) = (n+\frac12)\ln n - n + \mathcal O(n^{-1})$$, so $$\psi (n+1) = \ln n + \frac{1}{2n} + \mathcal O(n^{-2})$$, which gives $$\lim_{n\rightarrow\infty} nF(\frac{1}{n}) = \frac12$$ We still need to show that $$\lim_{x\rightarrow 0} \frac{F(x)}{x} = \frac{1}{2}$$ also when we approach by a sequence with $$x\neq\frac{1}{n}$$. Let $$n=\lfloor 1/x\rfloor$$, so that $$\frac{1}{n+1}, that is $$n\le\frac{1}{x}<\frac{1}{n+1}$$. We have \begin{align} \left|\frac{F(1/n)}{1/n} - \frac{F(x)}{x}\right| &\le \left|\frac{F(1/n)}{1/n} - \frac{F(1/n)}{x}\right| + \left|\frac{F(1/n)}{x} - \frac{F(x)}{x}\right| \le \\ &\le F(1/n) \left|n-\frac{1}{x}\right| + \frac{1}{n} |F(1/n)-F(x)| \le \\ &\le F(1/n) + \frac{1}{n} \int_{x}^{\frac{1}{n}} \Big(\frac{1}{t}- \lfloor\frac{1}{t}\rfloor\Big) dt \le \\ &\le F(1/n) + \frac{1}{n} \int_{x}^{\frac{1}{n}} 1 \,dt = \\ &\le F(1/n) + \frac{1}{n}(\frac{1}{n}-\frac{1}{n+1}) \rightarrow 0\end{align} which proves that $$\lim_{x\rightarrow 0} \frac{F(x)}{x} = \lim_{n\rightarrow\infty} nF(\frac{1}{n}) = \frac12$$

• The asymptotic for $\ln \Gamma(x)$ doesn't imply directly the one for $\Gamma'(x)/\Gamma(x)$ May 21, 2019 at 13:59
i) Consider $$A_n :=\int^{\frac{1}{n-1}}_{ \frac{1}{n} } \ \frac{1}{x}\ dx - (n-1) \bigg[ \frac{1}{n-1} - \frac{1}{n}\bigg]$$
Hence $$F(\frac{1}{n-1})=A_n +A_{n+1}+\cdots$$
So $$A_n\bigg[ \frac{1}{n-1} - \frac{1}{n}\bigg]^{-1} \rightarrow \frac{1}{2}$$
so that $$\frac{F(\frac{1}{n-1}) }{ \frac{1}{n-1} } \rightarrow \frac{1}{2}$$
ii) $$\frac{F(\frac{1}{n} )}{\frac{1}{n-1}}\leq \frac{F(x)}{x} \leq \frac{F(\frac{1}{n-1} )}{\frac{1}{n}}$$ where $$\frac{1}{n}\leq x<\frac{1}{n-1}$$