Integrating the floor of a function

174 Views Asked by At

The integral that I'm trying to simplify is this: (both $x$ and $c$ are natural numbers, if that helps)

$$ \mathrm{F}\left(x,c\right) \equiv \int_{0}^{c}\left\lbrace\vphantom{\LARGE A}% \left\lfloor 10^{-\lfloor t \rfloor} x \right\rfloor - 10\left\lfloor 10^{-\lfloor t \rfloor - 1}x\right\rfloor \right\rbrace^{2}\, \mathrm{d}t $$

I know this is fairly ugly, please let me know if I need to modify it for the question. Thank you.

Edit: This integral came from the following sum:

$$ \sum_{n = 0}^{c}\left\lbrace\vphantom{\LARGE A}% \left\lfloor 10^{-n} x \right\rfloor - 10\left\lfloor 10^{-n - 1}x \right\rfloor \right\rbrace^{2} $$

Is there a way to simplify either that does not lead to a different sum ?.

2

There are 2 best solutions below

1
On

As $\lfloor t\rfloor$ remains constant between two integers, you can rewrite the integral as a simple sum

$$\int_0^c \left(\left\lfloor 10^{-\lfloor t \rfloor} x \right\rfloor -10\left\lfloor 10^{-\lfloor t \rfloor-1}x \right\rfloor \right)^2 dt=\sum_{t=0}^{c-1} \left(\left\lfloor 10^{-\lfloor t \rfloor} x \right\rfloor -10\left\lfloor 10^{-\lfloor t \rfloor-1}x \right\rfloor \right)^2.$$

Now you can find the relation of the summand to the decimal representation of $x$.

2
On

The integrand is $$ f(x,t) = \left\lfloor 10^{-\lfloor t \rfloor} x \right\rfloor -10\left\lfloor 10^{-\lfloor t \rfloor-1}x \right\rfloor $$ so for $x \in \mathbb{N}$, $x = (d_{m-1}\dotsb d_0)_{10}$ this gives $$ f(x,t)\vert_{t\in[0,1)} = \left\lfloor x \right\rfloor -10\left\lfloor 10^{-1}x \right\rfloor = d_0 $$ which is the last digit of $x$. Further $$ f(x,t)\vert_{t\in[1,2)} = \left\lfloor 10^{-1} x \right\rfloor -10\left\lfloor 10^{-2}x \right\rfloor = d_1 $$ to $$ f(x,t)\vert_{t\in[m-1,m)} = \left\lfloor 10^{-(m-1)} x \right\rfloor -10\left\lfloor 10^{-(m-1)-1}x \right\rfloor = d_{m-1} $$ and $$ f(x,t)\vert_{t\in[m,m+1)} = \left\lfloor 10^{-m} x \right\rfloor -10\left\lfloor 10^{-m-1}x \right\rfloor = 0 $$ This gives $$ F(x,c) = \int\limits_0^c f(x,t)^2 \,dt = \sum_{i=0}^{c-1} \left( f(x,t)\vert_{t\in[i,i+1)} \right)^2 = \begin{cases} \sum\limits_{i=0}^{c-1} d_i^2 & ; c \le m \\ \sum\limits_{i=0}^{m-1} d_i^2 & ; c > m \end{cases} $$