# Integration involving fractional part function

Find the value of $$\int_{0}^{1}{(\{2x\}-1)(\{3x\}-1)}dx$$ where $\{x\}$ denotes the fractional part function. $\{x\}=x-[x]$ ,where $[x]$ denotes the greatest integer function.

My try :: Since there are two partial fraction functions, $\{2x\}$ has discontinuity only at $x=1/2$ and $\{3x\}$ has discontinuities at the points $x=1/3$ and $x= 2/3$ within $(0,1)$. So I have to break the integration limits accordingly. How can I go forward and reach the solution. Any suggestion will be helpful.

The idea is good, the calculations are quite messy :)

$y=(\{2 x\}-1) (\{3 x\}-1)$ on $[0,1]$

becomes

$y=1-\{2 x\}-\{3 x\}+\{2 x\}\{3 x\}$

where

$\left\{ {2x} \right\} = \left\{ {\begin{array}{*{20}{l}} {2x,\;0 \leqslant x \leqslant \frac{1}{2}} \\ {2x - 1,\frac{1}{2} < x \leqslant 1\;} \end{array}} \right.$

$\left\{ {3x} \right\} = \left\{ {\begin{array}{*{20}{l}} {3x,\;0 \leqslant x \leqslant \frac{1}{3}} \\ {3x - 1,\;\frac{1}{3} < x \leqslant \frac{2}{3}} \\ {3x - 2,\;\frac{2}{3} < x \leqslant 1} \end{array}} \right.$

$\left\{ {2x} \right\}\left\{ {3x} \right\} = \left\{ {\begin{array}{*{20}{l}} {6{x^2}}&{0 \leqslant x \leqslant \frac{1}{3}} \\ {2x\left( {3x - 1} \right)}&{\frac{1}{3} < x \leqslant \frac{1}{2}} \\ {\left( {2x - 1} \right)\left( {3x - 1} \right)}&{\frac{1}{2} < x \leqslant \frac{2}{3}} \\ {\left( {2x - 1} \right)\left( {3x - 2} \right)}&{\frac{2}{3} < x \leqslant 1} \end{array}} \right.$

So the integral must be calculated on each interval for each function

$$\int_0^1 1 \, dx- \left(\int_0^{\frac{1}{2}} 2 x \, dx+\int_{\frac{1}{2}}^1 (2 x-1) \, dx\right)-\left(\int_0^{\frac{1}{3}} 3 x \, dx+\int_{\frac{1}{3}}^{\frac{2}{3}} (3 x-1) \, dx+\int_{\frac{2}{3}}^1 (3 x-2) \, dx\right)\\ +\left(\int_0^{\frac{1}{3}} 6 x^2 \, dx+\int_{\frac{1}{3}}^{\frac{1}{2}} \left(6 x^2-2 x\right) \, dx+\int_{\frac{1}{2}}^{\frac{2}{3}} \left(6 x^2-5 x+1\right) \, dx+\int_{\frac{2}{3}}^1 \left(6 x^2-7 x+2\right) \, dx\right)=\frac{19}{72}$$

Hope this helps

• Wonderfully explained @Raffaele. Thanks a lot. Aug 25, 2017 at 0:10

Your idea is good. After you have broken up the integral in parts you can actually write down $\{x\}$ more explicitly. For example let $x\in[1,\frac{3}{2}]$, then $$\{x\}=x-[x]=x-1,$$ since $[x]=1$. Then you can integrate as usual.