Doubt on Integration

$$\int_0^4 \lfloor x/2 \rfloor \ d(x-\lfloor x \rfloor)$$

I don't get how we convert the given differential element into normal dx differential element.

I plotted the graphs of $$\lfloor x/2 \rfloor$$ and $$x-\lfloor x \rfloor$$ and tried to integrate along the graph of differential element function according to it answer comes to 0.

But the answer comes to 2

Just help in conversion of differential element the rest I can do

• Do you have the necessary theory with you to ascertain why the first integral even "makes sense"? – астон вілла олоф мэллбэрг Mar 22 at 4:57
• I am dealing with such type of problem for first time. I think the integral means we are taking the integral (area) of $$\lfloor x/2 \rfloor$$ along the graph of $$x-\lfloor x \rfloor$$ – Dhruv Deshmukh Mar 22 at 5:22
• Good guess but you have not got it right. You are actually performing a Riemann-Stieltjes integral, which is something that gives the expression some sense. The point is, if you don't know how to make sense of the expression then you can't be expected to solve it, right? Coming to the question , the way to solve this integral would be to break $[0,4]$ into $[0,1],[1,2],[2,3],[3,4]$ inside which $x - \lfloor x\rfloor$ restricts to $x,x-1,x-2$ and $x-3$ respectively. Now within each of these you can apply a change of variable. – астон вілла олоф мэллбэрг Mar 22 at 5:30
• @астонвіллаолофмэллбэрг The Riemann-Stieltjes integral doesn't exist though, even in the generalized sense (where we require the existence of a partition $P_\epsilon$ s.t. the approximating sum over any refinement of $P_\epsilon$ differs from $I$ by less than $\epsilon$). The reason is that $f$ and $g$ are discontinuous from the same side. – Maxim Mar 22 at 12:18
• @астонвіллаолофмэллбэрг You cannot ignore the contributions from the jumps of $g$ (the individual terms $f(\xi_i) (g(x_{i + 1}) - g(x_i))$ that do not tend to zero when $\operatorname{mesh}(P) \to 0$). – Maxim Mar 22 at 15:20

$$x-\lfloor x\rfloor$$ is the fractional part function, $$\{x\}$$. For $$x\in[m,m+1),\{x\}=x-m$$, where $$m\in\Bbb Z$$.
The integrand is $$0$$ in $$[0,2)$$ and $$1$$ in $$[2,4)$$. Your integral is$$\int_2^3d(x-2)+\int^4_3d(x-3)=2$$
• @Dhruv Yes, and use the fact $d(x-m)=dx$ – Shubham Johri Mar 22 at 7:55