The formula for the integral of the floor function, and ceiling function from $0$ to $x$. I would like to know whether my observations have led me to the right path. Ok, so suppose we wanted to integrate $\int_{0}^{x}$ $\lfloor x \rfloor dx$. How would one find a formula for such a function?
Well, if you graph this function, you obtain these steps. Now what an integral would do is find the area underneath those steps. (It is like Riemann integration). Also if one graphs this function, you can observe that the area of each rectangle is $n^2$, for any value of $n$ on the $x$-axis. So we have that $\int_{0}^{x}$ $\lfloor x \rfloor dx$ =$\sum_{n=0}^{x} n^2$=$\frac{x(x+1)(2x+1)}{6}-1$, and the $-1$ came from the fact that $\lfloor x \rfloor$=$0$, for $x$$\in$$[0,1)$.
Now using this fact, we can also conclude that the integral of the ceiling function is $\frac{x(x+1)(2x+1)}{6}-1$. (More generally if we are integrating on an interval $[a,b]$, we have the value of the integral of the floor function is $\frac{b(b+1)(2b+1)}{6}-1-(\frac{a(a+1)(2a+1)}{6}-1)$).

The area of rectangle standing over the interval $[n,n+1]$ where $n$ is integer, is $\color{red}{n \times 1 = n}$, not $n^2$.
Hence
$$\int_{0}^{x} \lfloor x \rfloor dx = \int_{0}^{\lfloor x \rfloor} \lfloor x \rfloor dx + \int_{\lfloor x \rfloor}^{x} \lfloor x \rfloor dx$$
$$ = \sum _{n=0}^{\color{blue}{\lfloor x \rfloor-1}} n + \int_{\lfloor x \rfloor}^{x} \lfloor x \rfloor dx$$
$$=\frac{\lfloor x \rfloor(\lfloor x \rfloor -1)}{2} + \lfloor x \rfloor \{x\}$$
where $\{x\} = x - \lfloor x \rfloor$, is the fractional part of $x$.
Can you similarly find the other integral?
$$\int_{0}^{x} \lceil x \rceil dx = \ldots$$
