Evaluate the following integral $ \int_1^{\infty} \frac{\lbrace x\rbrace-\frac{1}2}{x} dx$ $$\int_1^{\infty} \frac{\lbrace x\rbrace-\frac{1}2}{x} dx$$
Here $\lbrace\cdot\rbrace$ denotes the fractional part.
I found this challenging integral, and I'm curious about the solution, so I decided to do some efforts to solve it, but sadly I didn't, any hints?
Attempts:
\begin{align}
\int_1^{\infty} \frac{\lbrace x\rbrace-\frac{1}2}{x} dx&=\int_1^{\infty} \frac{1\lbrace x\rbrace-1}{2x} dx\\
&=\int_1^{\infty}\frac{\lbrace x\rbrace}{x}-\frac{1}{2x}dx\\
&=\int_1^\infty \frac{x-\lfloor x\rfloor-1}{x}-\frac{1}{2x}dx\\
&=\int_1^\infty \frac{x-\lfloor x\rfloor-1}{x} dx -\int_1^\infty \frac{dx}{2x}
\end{align}
I thought about this property:
$$\int_0^\infty \varphi (x) dx=\lim_{a\to \infty} \int_0^a \varphi(x) dx$$
So I applied it only for the second fraction because its antiderivative was easy enough, and here's what I've got:
\begin{align}
\int_1^\infty \frac{dx}{2x}&=\lim_{a\to \infty} \int_1^a \frac{dx}{2x}\\
&=\lim_{a\to \infty}\frac{\ln (x)}{2}\bigg\vert_0^a\\
&=\lim_{a\to \infty}\frac{\ln (a)}2 -\frac{\ln (0)}{2}
\end{align}
And here I felt that I'm wrong I can't get $\infty -\infty$, So any thoughts or hints, I'll be thankfull!

This function is not integrable in the Lebesgue sense, so you can only evaluate the Cauchy principal value.
That is, what you want to evaluate is the limit $$\lim_{M \rightarrow +\infty} \int_1^M \frac{\{x\}-\frac12}xdx.$$
It is easy to see that it suffices to take the limit for integer values of $M$. We first compute, for every positive integer $k$:
$$\int_k^{k + 1}\frac{\{x\}-\frac12}xdx = \int_k^{k + 1}\frac{x- k-\frac12}xdx = 1 - \left(k + \frac 1 2\right) (\ln(k + 1) - \ln k).$$
We then take the sum:
$$\int_1^{M + 1} \frac{\{x\}-\frac12}xdx = \sum_{k = 1}^M\left(1 - \left(k + \frac 1 2\right) (\ln(k + 1) - \ln k)\right).$$
This simplifies to: $$M - \left(M + \frac12\right)\ln(M + 1) + \ln M!$$ which, by Stirling's formula, converges to $\ln\frac{\sqrt{2\pi}}e\approx-0.0810614668$.
