How do I calculate the integral of $\lfloor1/x\rfloor$ from $x=\frac{1}{n+2}$ to $x=\frac{1}{n}$? How do I calculate integral : $$\int_{\frac{1}{n+2}}^{\frac{1}{n}}\lfloor1/x\rfloor dx$$ where $\lfloor t\rfloor$ means the integer part (I believe that's how it should be translated) or floor function of $t$.
 A: Use the interpretation of the integral as the area under a curve between the limits of integration.
I assume here that $n$ is a positive integer.
Then
$$\tfrac1{n+2}<x<\tfrac1{n+1} \implies n+1<\tfrac1x<n+2\implies[\tfrac1x]=n+1$$
and
$$\tfrac1{n+1}<x<\tfrac1{n} \implies n<\tfrac1x<n+1\implies[\tfrac1x]=n$$
and these two intervals have width
$$\tfrac1{n+1}-\tfrac1{n+2}=\tfrac1{(n+1)(n+2)}$$
and
$$\tfrac1{n}-\tfrac1{n+1}=\tfrac1{n(n+1)}$$
respectively. The area is the sum of the areas of two rectangles:
$$\int_{\frac1{n+2}}^{\frac1{n}} [\tfrac1x]\;dx=(n+1)\cdot\tfrac1{(n+1)(n+2)}+n\cdot\tfrac1{n(n+1)}$$
$$=\boxed{\tfrac1{n+2}+\tfrac1{n+1}}$$
(Note that the value of the integrand on the boundaries of these intervals doesn't affect the value of the integral, so we use strict inequality for convenience.)
A: Make the substitution $\frac{1}{x}=t$ then your integral turns into
$$\int_n^{n+2}\frac{\lfloor t\rfloor}{t^2} dt$$
Now just split the integral into two intervals $n$ to $n+1$ and $n+1$ to $n+2$ assuming $n$ is an integer.
A: I think this should be possible,to solve by decomposing the integrale from $1/(n+2)$ to $1/(n+1)$ and so on. On each of these Integrals, your function should be constant.
