Indefinite integral from floor of $x$ I want to calculate $\displaystyle \int [x] dx$ where $[]$ is floor function. 

I don't know if it is just $kx+C$ for $x \in [k, k+1)$ and $(k+1)x+C$ for $x =k+1$ or I'm missing something
$$ \int _0^y [x] dx = \sum _{i=0}^{[y]-1} i + [y] \int _{[y]}^y dx $$

$$ = \frac 12 [y]([y]-1) + [y](y-[y])  $$
$$ \int _0^y [x] dx = \sum _{i=0}^{[y]-1} i + [y] \int _{[y]}^y dx $$

$$ = \frac 12 [y]([y]-1) + [y](y-[y])  $$