<s>[INST] Showing $\int_{0}^{2022}x^{2}-\lfloor{x}\rfloor\lceil{x}\rceil dx = 674$ It is from the 2022 MIT Integration Bee Question 3 states as follows:
$$\int_{0}^{2022}x^{2}-\lfloor{x}\rfloor\lceil{x}\rceil dx$$
I know that the answer is $674$, but I do not know the process and the steps to derive this solution. Can someone please help?
 [/INST] To keep things simple, let's limit the integration to the interval $(n, n+1)$. where $n \in \mathbb{Z}$.
$$\int_n^{n+1} x^2 - \lfloor x \rfloor \lceil x \rceil dx $$
$$= \int_n^{n+1} x^2 - n (n + 1) dx $$
$$= \left(\frac{1}{3}x^3 - n (n + 1)x\right)\Bigg|_{n}^{n+1} $$
$$= \left(\frac{1}{3}(n+1)^3 - n (n + 1)^2\right) - \left(\frac{1}{3}n^3 - n^2 (n + 1)\right)$$
$$= \frac{1}{3}n^3 + n^2 + n + \frac{1}{3} - n^3 - 2n^2 - n - \frac{1}{3}n^3 + n^3 + n^2 $$
$$= \frac{1}{3} $$
Gee, sure is convenient that all of those $n$'s cancel out and we're left with a constant.
So all we have to do is add up the integral value $\frac{1}{3}$ over $2022$ of these $1$-unit intervals, to get $2022 / 3 = 674.$
</s>