Integrate the GIF 
Solve $$\int_0^1 f(x)= \left[\frac1{3x}\right] - \frac13\left[\frac1x\right]\text dx$$ where $[x]$ represents greatest integer less than or equal to $x$. 

My attempt
I substituted $3x$ with $t$, to get $$\int_0^1\frac13\left[\frac1x\right]$$ from which if we subtract the second thing, we get $$\int_1^3 \frac13\left[\frac1x\right]=0$$ 
But the answer given is $$-\frac13\ln3$$
Please can you help me understand where I have gone wrong
 A: You cannot split the integral as  a difference of the   integrals for the two terms. This is because $\int_0^{1} [\frac  1 x] dx$ does not exist nor does $\int_0^{1} [\frac  1 {3x}] dx$. Both these integrals are divergent since $\sum \frac  1 n=\infty$ as seen by spltting the integrals into $(\frac  1{n+1}, \frac 1 n)$ in the first case and $(\frac  3{n+1}, \frac 3 n)$ in the second case. 
A: $$I=\int_{0}^{1} \left(\left[\frac{1}{3x}\right]-\frac{1}{3}\left[\frac{1}{x}\right]\right) dx$$ $$=\lim_{n \rightarrow \infty}\sum_{k=0}^{n} \left(\int_{1/(3k)}^{1/(3k+1)} (k-k)~dx+\int_{1/(3k+1)}^{1/(3k+2)} (k-k+1/3)~ dx+ \int_{1/(3k+2)}^{1/(3k+3)} (k-k+2/3) ~dx  \right)$$
$$=\sum_{k=0}^{k=n} \left(-\frac{1}{3}. \frac{1}{3k+1}-\frac{1}{3}.\frac{1}{3k+1} +\frac{2}{3}.\frac{1}{3k+3}\right)$$
$$I=\lim_{n \rightarrow \infty} -\frac{2}{9}[\psi(n-2/3)+\psi(n-1/3)-2\psi(n)]+\frac{1}{9}[\psi(2/3)+\psi(1/3)-2 \psi(1)].$$
Here, we have used the properties of PolyGamma (psi) function as $\psi(x+n)=\psi(x)+\sum_{k=0}^{n-1}\frac{1}{x+k}.$ Next we use: $\psi(1)=-\gamma ,\psi(1/3)=-\gamma-\frac{\pi}{2}\sqrt{\frac{1}{3}}-\frac{3}{2} \ln 3, \psi(2/3)= -\gamma+\frac{\pi}{2}\sqrt{\frac{1}{3}}-\frac{3}{2} \ln 3.$ 
Here, $\gamma$ is the Euler constant. $\lim_{n\rightarrow \infty} [\psi(z+n)-\psi(n)]=0.$
Finally, we get $I=-\frac{1}{3}\ln 3.$
A: As rightly signalled K.R. Murthy the integral cannot be separated as such. 
We shall take the limit for the lower index going to zero as
$$
\eqalign{
  & \int_0^1 {f(x)dx}  = \mathop {\lim }\limits_{a\; \to \;0^{\, + } } 
 \int_a^1 {\left( {\left\lfloor {{1 \over {3x}}} \right\rfloor
  - {1 \over 3}\left\lfloor {{1 \over x}} \right\rfloor } \right)dx}  =   \cr 
  &  = \mathop {\lim }\limits_{a\; \to \;0^{\, + } } \int_a^1 {\left\lfloor {{1 \over {3x}}} \right\rfloor dx} 
  - \mathop {\lim }\limits_{a\; \to \;0^{\, + } } {1 \over 3}\int_a^1 {\left\lfloor {{1 \over x}} \right\rfloor dx}  =   \cr 
  &  = \mathop {\lim }\limits_{a\; \to \;0^{\, + } } {1 \over 3}\int_a^1 {\left\lfloor {{1 \over {3x}}} \right\rfloor d\left( {3x} \right)}
  - \mathop {\lim }\limits_{a\; \to \;0^{\, + } } {1 \over 3}\int_a^1 {\left\lfloor {{1 \over x}} \right\rfloor dx}  =   \cr 
  &  = {1 \over 3}\mathop {\lim }\limits_{a\; \to \;0^{\, + } } \int_{3a}^3 {\left\lfloor {{1 \over y}} \right\rfloor d\left( y \right)}
  - \mathop {\lim }\limits_{a\; \to \;0^{\, + } } {1 \over 3}\int_a^1 {\left\lfloor {{1 \over x}} \right\rfloor dx}  =   \cr 
  &  = {1 \over 3}\mathop {\lim }\limits_{a\; \to \;0^{\, + } }
 \left( {\int_{3a}^\infty  {\left\lfloor {{1 \over x}} \right\rfloor d\left( x \right)}
  - \int_3^\infty  {\left\lfloor {{1 \over x}} \right\rfloor d\left( x \right)}
  - \int_a^\infty  {\left\lfloor {{1 \over x}} \right\rfloor dx}
  + \int_1^\infty  {\left\lfloor {{1 \over x}} \right\rfloor dx} } \right) =   \cr 
  &  = {1 \over 3}\mathop {\lim }\limits_{a\; \to \;0^{\, + } } \left( {\int_1^3 {\left\lfloor {{1 \over x}} \right\rfloor dx}
  - \int_a^{3a} {\left\lfloor {{1 \over x}} \right\rfloor dx} } \right) =   \cr 
  &  =  - {1 \over 3}\mathop {\lim }\limits_{a\; \to \;0^{\, + } } \int_a^{3a} {\left\lfloor {{1 \over x}} \right\rfloor dx}  =   \cr 
  &  =  - {1 \over 3}\mathop {\lim }\limits_{a\; \to \;0^{\, + } } \int_a^{3a} {\left( {{1 \over x}
 - \left\{ {{1 \over x}} \right\}} \right)dx}  =   \cr 
  &  =  - {1 \over 3}\mathop {\lim }\limits_{a\; \to \;0^{\, + } } \left( {\ln {{3a} \over a}
 - \int_a^{3a} {\left\{ {{1 \over x}} \right\}dx} } \right) =   \cr 
  &  =  - {1 \over 3}\mathop {\lim }\limits_{a\; \to \;0^{\, + } } \left( {\ln {{3a} \over a}
 - \int_a^{3a} {\left( {0 \le \left\{ {{1 \over x}} \right\} < 1} \right)dx} } \right) =   \cr 
  &  =  - {1 \over 3}\ln 3 = {1 \over 3}\ln \left( {{1 \over 3}} \right) \cr} 
$$
