TITLE: Closed form for $\int_0^x \{1/t \}\,\mathrm{d}t$, $x \in \mathbb{R}_+$ and related.
QUESTION [5 upvotes]: After some tests I think that

Conjecture 1 Let $x \in \mathbb{R}_+$ then
  $$
\int_{0}^{x}\left\{\,1 \over t\,\right\}\,{\rm d}t
= 1 - \gamma  + H_{\left\{1/x\right\}} - x\left\lfloor\, 1/x\,\right\rfloor
+ \log\left(\,x\,\right)
$$

Where $\{x\} = x - \left\lfloor\, x\,\right\rfloor$ is the fractional part of a number, and $H_{n} = \sum_{k=1}^{n} 1/n$ is the sum of the $n$ first harmonic numbers. I have confirmed the result above for integral for $x\geq 1$. It reduces to
$$
\int_0^x \left\{1 \over t\right\}\,{\rm d}t
= 1 - \gamma + \log\left(\,x\,\right)\,, \qquad x \geq 1
$$
Does the above result hold for $x \in \left(\,0,1\,\right)$ ? Does the more general integral
$$
\int_{0}^{x}\left\{\,1 \over t\,\right\}^{p}\,{\rm d}t
= 1 - \gamma
$$
Where $x \in \mathbb{R}$ and $p \geq 1$ have a similar closed form?
I know the case with $p \geq 1$ and $x=1$ has been solved.

REPLY [5 votes]: First thing set $y=1/t$ and $n=\lfloor 1/x\rfloor$ (for simplicity), then  $$\begin{aligned}f(x)= \int_0^x \left\{ \frac{1}{t} \right\}\,\mathrm{d}t &= \int_{1/x}^{\infty} \frac{\{y\}}{y^2} \ \mathrm{d}y = \left(\sum_{k=n+1}^{\infty} \int_k^{k+1} \frac{x-k}{x^2} \ \mathrm{d}y\right) +\int_{1/x}^{n+1} \frac{y-n}{y^2} 
\end{aligned}$$ Integrate simply to get : $$\begin{aligned} f(x)&=n \left(\frac{1}{n+1}-x\right)+\log (n+1)+\log (x)+ \sum_{k=n+1}^{\infty} \ln (k+1) -\log k - \frac{1}{k+1} \\ &=n \left(\frac{1}{n+1}-x\right)+\log (n+1)+\log (x)+H_{n+1}-\log (n+1) -\gamma \\   &=n \left(\frac{1}{n+1}-x\right)+\log (x)+H_{n+1}-\gamma \end{aligned}$$ 
Now, feel free to substitute $n=\lfloor 1/x\rfloor$ and maybe simplify the expression using some integer part identities.