Is there a closed form for $$\int_{n}^{n+1} \frac{\lfloor x \rfloor}{x}dx$$
I found ln$(2)$ as my answer for n=1 from my calculator, but not sure how to find the general solution.
Is there a closed form for $$\int_{n}^{n+1} \frac{\lfloor x \rfloor}{x}dx$$
I found ln$(2)$ as my answer for n=1 from my calculator, but not sure how to find the general solution.
Assuming $n$ is an integer, $\lfloor x \rfloor = n$ throughout the range of integration (except at the right endpoint), so this is just
$$\int_n^{n+1} \frac nx ~ dx = n \ln \frac{n+1}{n} = \ln \left( 1+\frac 1n \right)^n.$$
If $n$ is an integer, then $\lfloor x\rfloor=n$ for $x\in [n,n+1)$. Thus $$\int_n^{n+1} \frac{\lfloor x\rfloor}{x}\ dx = \int_n^{n+1} \frac{n}{x}\ dx = n\int_n^{n+1} \frac{1}{x}\ dx.$$
At this point, I will let you consider if anything special happens for $n=0$, or if $n<0$, but for positive $n$, you get $$ = n\left(\ln(n+1) - \ln(n)\right) = n\ln\left(1+\frac{1}{n}\right).$$
For $n > 1$:
$$\begin{align}\int_n^{n+1}\frac {\lfloor x \rfloor} xdx&= \int_n^{\lfloor n+1 \rfloor}\frac {\lfloor x \rfloor} xdx+\int_{\lfloor n+1 \rfloor}^{n+1}\frac {\lfloor x \rfloor} xdx \\&=\int_n^{\lfloor n+1 \rfloor}\frac {\lfloor n \rfloor} xdx+\int_{\lfloor n+1 \rfloor}^{n+1}\frac {\lfloor n+1 \rfloor} xdx \\&= \lfloor n\rfloor\int_n^{\lfloor n+1 \rfloor}\frac 1 xdx+\lfloor n+1 \rfloor\int_{\lfloor n+1 \rfloor}^{n+1}\frac 1 xdx \\~\\&=\lfloor n \rfloor(\ln\lfloor n+1 \rfloor - \ln n) + \lfloor n+1 \rfloor(\ln (n+1)-\ln \lfloor n+1 \rfloor)\\~\\&=\lfloor n+1 \rfloor\ln(n+1)-\ln \lfloor n+1 \rfloor-\lfloor n \rfloor\ln n\end{align}$$
which reduces to the other answers when $n$ is an integer.