I have to calculate $$I=\int _0^1\left\{nx\right\}^2dx , \:\:\:\:\: n \in \mathbb N, n \ge 1$$ Where {a} is $frac(a)$.
I know that $\left\{nx\right\}^2 = (nx - [nx])^2$ so
$$I\:=\int _0^1\:\left(n^2x^2-2nx\left[nx\right]+\left[nx\right]^2\right)dx=\frac{n^2}{3}-2n\int _0^1\:x\left[nx\right]dx+\int _0^1\:\left[nx\right]^2dx$$ What can I do next ? In my mind, because $x \in [0, 1] \implies [nx] = 0$ but the final answer is $\frac{1}{3}$.

