# How to integrate the following floor function?

I need to calculate the following integral, $$\int_{1}^{10}\frac{x-\lfloor x \rfloor }{x^2} dx$$.

So I did this-

$$\int_{1}^{10}\frac{x-\lfloor x \rfloor }{x^2} dx=\int_{1}^{10}\frac{1 }{x} dx-\int_{1}^{10}\frac{\lfloor x \rfloor}{x^2}dx.$$ Now my problem is with the second integral. How can I calculate this? I have tried to looking for examples here but in all those example there only the floor function is involved not a denominator part as I have. So how can I do this? Please help.

• Cut it into 9 integrals: $\int_1^2+\int_2^3+\ldots+\int_9^{10}$ – Nathaniel B Jul 6 '16 at 1:48
• Why I need to do that? Can you elaborate a bit more? – Harry Potter Jul 6 '16 at 1:49
• For $x\in[1,2)$, $\lfloor x\rfloor=1$. – vadim123 Jul 6 '16 at 1:50
• Over each of the nine intervals, the floor function reduces to a constant term. i.e. $\int_1^2\lfloor x\rfloor /x^2~dx=\int_1^21/x^2~dx$, $\int_2^3\lfloor x\rfloor /x^2~dx=\int_2^32/x^2~dx$, $\int_3^4\lfloor x\rfloor /x^2~dx=\int_3^43/x^2~dx$, etc. – Nathaniel B Jul 6 '16 at 1:52
• ok got it @NathanielB – Harry Potter Jul 6 '16 at 1:53

You need to compute integrals of the form $\displaystyle \int_n^{n+1} \dfrac{\lfloor x \rfloor}{x^2} dx$. You get
$\displaystyle \int_1^{10} \dfrac{\lfloor x \rfloor}{x^2}dx = \int_1^2 \dfrac{\lfloor x \rfloor}{x^2}dx + \int_2^3 \dfrac{\lfloor x \rfloor}{x^2}dx + \cdots + \int_9^{10} \dfrac{\lfloor x \rfloor}{x^2}dx$
• I got $\int_n^{n+1} \dfrac{n}{x^2} dx= \dfrac{1}{n+1}$. Can you double check the factor "2"? – mike Jul 6 '16 at 2:12