finding bounds for $\int_0^X\lfloor x^2\rfloor \, dx$

$\newcommand{\d}{\text{d}}$Assuming $X$ is an integer, we have :

$\begin{align} I(X)&=\int_0^X\lfloor x^2\rfloor\d x\\ &=\sum_{n=0}^{X^2-1}\int_{\sqrt{n}}^{\sqrt{n+1}}\lfloor x^2\rfloor\d x\\ &=\sum_{n=0}^{X^2-1}(\sqrt{n+1}-\sqrt{n})n\\ &=\sum_{n=0}^{X^2-1}n\sqrt{n+1}-\sum_{n=0}^{X^2-1}n\sqrt{n}\\ &=\sum_{n=1}^{X^2}(n-1)\sqrt{n}-\sum_{n=1}^{X^2-1}n\sqrt{n}\\ &=X(X^2-1)-\sum_{n=1}^{X^2-1}\sqrt{n}. \end{align}$

Now, according to Is there any way to approximate a sum of square roots , we have : $$\frac{2}{3}N^{3/2}\leqslant\sum_{n=1}^N\sqrt{n}\leqslant\frac{2}{3}\left[(N+1)^{3/2}-1\right],$$

which can be used with $N=X^2-1$ to provide : $$X(X^2-1)-\frac{2}{3}(X^3-1)\leqslant I(X)\leqslant X(X^2-1)-\frac{2}{3}(X^2-1)^{3/2}.$$

Now, in the case where $X$ is not necessarily an integer, by assuming that $X\geqslant0$, we have $\lfloor X\rfloor\leqslant X<\lfloor X\rfloor+1$, from which we obtain : $$I(\lfloor X\rfloor)\leqslant I(X)<I(\lfloor X\rfloor+1).$$

In the end, the previous bounds can be used to provide : $$\lfloor X\rfloor(\lfloor X\rfloor^2-1)-\frac{2}{3}(\lfloor X\rfloor^3-1)\leqslant I(X)\leqslant (\lfloor X\rfloor+1)\left[(\lfloor X\rfloor+1)^2-1\right]-\frac{2}{3}\left[(\lfloor X\rfloor+1)^2-1\right]^{3/2}.$$


If the two are equal then $(X^2+1)^{3/2}-\sum_{i=1}^{X^2+1}\sqrt{i} =X^3-\sum_{i=1}^{X^2}\sqrt{i} $ so $(X^2+1)^{3/2}-X^3 =\sqrt{X^2+1} $ which is true only at $X = 0$. For example, for $X=1$ this is $1 =\sqrt{2}^3-\sqrt{2} =\sqrt{2} $.