0

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.

  • 1
    Is $n$ always an integer? – player3236 Sep 10 '20 at 18:48
  • 1
    Do you mean $\int_n^{n+1}\frac nx,dx$? – Angina Seng Sep 10 '20 at 18:50
  • 2
    If $n$ is an positive integer the integral is $n\int^{n+1}_n\frac{1}{x},dx=n\log(1+\tfrac1n)$ – Mittens Sep 10 '20 at 18:50
  • Note that $\lfloor x \rfloor = n$ almost everywhere between $n$ and $n+1$. – CyclotomicField Sep 10 '20 at 18:50
  • If $n$ is not an integer, start from @OliverDiaz 's answer, but split the integral into two parts, at the integer between $n$ and $n+1$ – Andrei Sep 10 '20 at 18:53
  • We also have the asymptotic formula $$ \begin{align} \scriptsize\int_0^x\frac{\lfloor t\rfloor}t,\mathrm{d}t &=\scriptsize x-\frac12\log(2\pi x)-\frac{6{x}^2-6{x}+1}{12x}-\frac{2{x}^3-3{x}^2+{x}}{12x^2}-\frac{30{x}^4-60{x}^3+30{x}^2-1}{360x^3}\ &\phantom{\ =}\scriptsize-\frac{6{x}^5-15{x}^4+10{x}^3-{x}}{120x^4}+\underbrace{\int_x^\infty\frac{6{t}^5-15{t}^4+10{t}^3-{t}}{30t^5},\mathrm{d}t}_{O\left(x^{-5}\right)}\ \end{align} $$ where ${x}=x-\lfloor x\rfloor$. – robjohn Sep 10 '20 at 22:50

3 Answers3

0

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.$$

Robert Shore
  • 23,332
0

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).$$

Mankind
  • 13,170
0

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.

player3236
  • 16,413