How would you go about solving integral of a floor? The particular problem I have is:
$\int \,\left\lfloor\frac{1}{x}\right\rfloor\, dx$
How would you go about solving integral of a floor? The particular problem I have is:
$\int \,\left\lfloor\frac{1}{x}\right\rfloor\, dx$
The function:
$\left\lfloor\frac{1}{x}\right\rfloor$
is equal to $n$ on the interval $\left(\frac{1}{n+1},\frac{1}{n}\right)$,so if we try to determine the integral from $t>0$ to $1$, we can let $n=\left\lfloor\frac{1}{t}\right\rfloor$ and we have constant value $1$ on range $(\frac{1}{2},1)$, constant value $2$ on range $(\frac{1}{3},\frac{1}{2})$, etc. So since $t<\frac{1}{n}$, we get terms for each interval $(\frac{1}{k+1},\frac{1}{k})$ when $k
$\int_t^1 \,\left\lfloor\frac{1}{x}\right\rfloor\, dx = 1 - t{\left\lfloor\frac{1}{t}\right\rfloor} + \sum_{i=2}^{\left\lfloor\frac{1}{t}\right\rfloor}\frac{1}{i}$
The indefinite integral, then, is the opposite of this:
$x\left\lfloor\frac{1}{x}\right\rfloor - \sum_{i=2}^{\left\lfloor\frac{1}{x}\right\rfloor}\frac{1}{i} + C$