# Integral of the fractional part of $\frac1x$ multiplied by $x$ on interval $(a,b), a\ge 0$.

I'm interested in finding the value of

1. the integral of $\left\{\frac{1}{x}\right\}\cdot x$ (the fractional part of $\dfrac{1}{x}$ multiplied by $x$) on the interval $(a,b), a\ge 0$
2. the integral of $\left\{\frac{1}{x}\right\}$ (fractional part of $\dfrac{1}{x}$) on the interval $(a,b), a\ge 0$

NOTE: $\left\{x \right\}= x-\left\lfloor x \right\rfloor$

Thanks

-
It would be helpful if you clarified your question. When you say "the fractional part of 1/x multiplied by x", do you mean $(\frac{1}{x} - \lfloor{\frac{1}{x}}\rfloor)x$? Also, can you tell us how you've attempted this or where the problem cropped up? –  Alex Becker Apr 13 '11 at 7:49
it is well know formula for integral of fract(1/x) on (0,1), given by Euler-mascheroni constant. I'm arriving to a integral on (0,a) with 'a' depending on a parameter, its value is < 1. Moreover, I'm arriving to find an expression/calculate a similar integral from xfract(1/x) on (0,a), with no idea how to do it. –  user9532 Apr 13 '11 at 19:37

A hint: Your integrands misbehave at the points $x_k$ where $1/x$ is an integer $k$. Therefore split each of the integrals (1) and (2) up in a sum of integrals over intervals $[x_{k+1},x_k]$.
For positive integers $n$, $$\int_{1/(n+1)}^{1/n} x \text{frac}(1/x)\ dx = \int_{1/(n+1)}^{1/n} x (1/x - n)\ dx = \frac{1}{2n(n+1)^2}$$ so $$\int_0^{1/n} x \text{frac}(1/x)\ dx = \sum_{j=n}^\infty \frac{1}{2j(j+1)^2} = \frac{1}{2n} - \frac{\Psi(1,n+1)}{2}$$ If $b > 0$ and $n = \lfloor 1/b \rfloor$, $$\int_0^b x \text{frac}(1/x)\ dx = \frac{1}{2(n+1)} - \frac{\Psi(1,n+2)}{2} + \int_{1/(n+1)}^b x (1/x - n-1)\ dx = \frac{1 - (b(n+1)-1)^2}{2(n+1)} - \frac{\Psi(1,n+2)}{2}$$ and $\int_a^b x \text{frac}(1/x)\ dx = \int_0^b x \text{frac}(1/x)\ dx - \int_0^a x \text{frac}(1/x)\ dx$.