Integration – Integral Containing Floor Function and Derivative

ceiling-and-floor-functionsdefinite integralsimproper-integralsintegration

Let $n>1$ be a positive integer, and let $f:\mathbb{R} \rightarrow \mathbb{R}$ be continuously differentiable on the interval $[1,n]$. I want to calculate an integral of the form

$$
\int _1^n\lfloor u \rfloor f'(u) \mathrm d u
$$

I realise that I can set upper and lower bounds on the integral by writing $\lfloor x \rfloor = x – \lbrace x \rbrace$. However, I am hoping to find a precise numerical solution. My approach has been to use integration by parts, writing

$$\int_1^n \lfloor u \rfloor f'(u) \mathrm d u = nf(n)-f(1)-\int_1^n f(v) \frac{\delta}{\delta v} \lfloor v \rfloor \mathrm d v$$

(whilst noting that $\lfloor n \rfloor=n$). Clearly, $\frac{\delta}{\delta v} \lfloor v\rfloor$ is undetermined or infinite at integer values of $v$. I have tried to get round this by observing that, for sufficiently small $\epsilon$,

$$
\begin{align}
\int_1^n f(v) \frac{\delta }{\delta v} \lfloor v \rfloor \mathrm d v &= \sum_{i=2}^n \int_{i-1}^i f(v) \frac{\delta}{\delta v} \lfloor v \rfloor \mathrm d v \\
&= \lim_{\epsilon \rightarrow 0^+} \sum_{i=2}^n \int_{i-1}^{i-\epsilon} f(v) \frac{\delta}{\delta v}\lfloor v \rfloor \mathrm d v
\end{align}
$$

Since $\frac{\delta }{\delta v }\lfloor v\rfloor = 0$ over each closed interval $[i-1,i-\epsilon]$, it follows that

$$\int_1^n f(v) \frac{\delta}{\delta v} \lfloor v \rfloor \mathrm d v = 0$$

But this is wrong. As an example, set $f(x) := \sqrt{x}$, so that

$$
\begin{align}
\int_1^n \lfloor u \rfloor f'(u) \mathrm d u &= \int_1^n \lfloor u \rfloor \frac{1}{2 \sqrt{u}} \mathrm d u \\
&= n \sqrt{n} – 1 – \int_1^n \sqrt{v} \frac{\delta}{\delta v} \lfloor v \rfloor \mathrm d v \\
&\overset{?}{=} n \sqrt{n} – 1 – 0
\end{align}
$$

The output from Mathematica instantly disproves this last equality (assuming it is calculating the integral correctly). So:

  • What is wrong with this approach?
  • Any suggestions for how to calculate the original integral (i.e., with $f$ undefined)?

Or do I have to content myself with finding upper and lower limits?

Best Answer

$\int_1^{n} \lfloor u \rfloor f'(u)du=\sum\limits_{k=1}^{n-1}\int_k^{k+1} \lfloor u \rfloor f'(u)du=\sum\limits_{k=1}^{n-1}\int_k^{k+1} k f'(u)du=\sum\limits_{k=1}^{n-1}k[f(k+1)-f(k)]$.

This can also be written as $(n-1)f(n)-[f(1)+f(2)+\cdots+f(n-1)]$.