Estimate $ \int_\sqrt{n}^{\sqrt{n+1}} \sin (2\pi x^2) \; dx$ using the Trapezoid rule As a follow-up to my previous question.  What is the integral of $\sin (2\pi x^2)$ as $x \in [\sqrt{n}, \sqrt{n+1}]$ we get this:
$$ \int_\sqrt{n}^{\sqrt{n+1}} \sin (2\pi x^2) \; dx \tag{$\ast$}$$
Since $\sin 2\pi n = 0$ for all $n \in \mathbb{Z}$ this integral should be close to zero.  I could approximate by adding over the four corners:
$$
\int_\sqrt{n}^{\sqrt{n+1}} \sin (2\pi x^2) \; dx \approx \frac{1}{4} \left[  \sin (2\pi n) +  \sin 2\pi (\sqrt{n}+ \frac{1}{4})^2
+   \sin 2\pi (\sqrt{n}+ \frac{1}{2})^2 +   \sin 2\pi (\sqrt{n}+ \frac{3}{4})^2\right]
 $$
This might be hard to estimate since we get unpredictible terms like.  And I may have misaplied the trapezoid rule
$$ \sin 2\pi (n + \frac{1}{2} \sqrt{n} + \frac{1}{4})$$
if we place the mesh and $\sqrt{n} < \sqrt{n + \frac{1}{4}} < \sqrt{n + \frac{1}{2}}< \sqrt{n + \frac{3}{4}}< \sqrt{n + 1}$ the trapeoid rule is:
$$\tiny \sin(2\pi n ) \frac{ \sqrt{n+\tfrac{1}{4}} - \sqrt{n}}{2}
+ \sin (2\pi \sqrt{n + \frac{1}{4}})\left[ \sqrt{n+ \frac{1}{2} }- \sqrt{n}\right]
+ \sin (2\pi \sqrt{n + \frac{1}{2}})\left[ \sqrt{n+ \frac{3}{4} }- \sqrt{n+ \frac{1}{4}} \right]
+ \sin (2\pi \sqrt{n + \frac{3}{4}})\left[ \sqrt{n+ \frac{1}{2} }- \sqrt{n+ 1}\right]
+ \sin (2\pi \sqrt{n + 1})\left[ \frac{\sqrt{n+ \frac{3}{4} }- \sqrt{n+ 1}}{2} \right] $$
I think there is a mistake what should the trapezoid rule be?  Maybe if I said:
$$ \sqrt{n+ \frac{1}{4}} - \sqrt{n} = \sqrt{n} \left( \sqrt{1 + \frac{1}{4} } - 1 \right)= \frac{\sqrt{n}}{8} $$
Then after fixing all my mistakes I get something of order $\frac{1}{\sqrt{n}}$.  How does this look?
\begin{eqnarray}\small \int \dots dx &\approx& \frac{1}{8} \left[ \sqrt{n }\cdot 0
+ 2\sqrt{n + \tfrac{1}{4}}\cdot 1
+ 2\sqrt{n + \tfrac{1}{2}}\cdot 0
+ 2\sqrt{n + \tfrac{3}{4}}\cdot (-1)
+ \sqrt{n+1}\cdot 0\right] \\ \\
&=& \frac{1}{4} \left[ \sqrt{n+ \frac{1}{2}} - \sqrt{n + \frac{3}{4}}\right] = O(\frac{1}{\sqrt{n}})\end{eqnarray}

Setting $t=x^2$, we obtain the integral to be
$$I = \int_n^{n+1} \sin(2\pi t) \dfrac{dt}{2\sqrt{t}}$$
We then have
$$\vert 2I \vert = \left \vert \int_n^{n+1} \sin(2\pi t) \dfrac{dt}{\sqrt{t}}\right \vert \leq \int_n^{n+1} \dfrac{dt}{\sqrt{t}} = 2\left.\sqrt{t} \right \vert_{n}^{n+1} = 2\left(\sqrt{n+1}-\sqrt{n}\right)$$
Hence, we obtain that
$$\vert I \vert \leq \dfrac1{\sqrt{n}+\sqrt{n+1}}$$
A better estimate can be determined as follows. We have
$$I = \int_0^1 \dfrac{\sin\left(2\pi(n+t)\right)}{2\sqrt{n+t}}dt = \int_0^1 \dfrac{\sin(2\pi t)}{2\sqrt{n+t}}dt$$
Hence, we obtain
$$\sqrt{n}I = \int_0^1 \dfrac{\sin(2\pi t)}{2\sqrt{1+t/n}}dt = \dfrac12\sum_{k=0}^{\infty} \dbinom{2k}k \left(\dfrac{-1}{4n}\right)^k \int_0^1 t^k \sin(2\pi t) dt = \dfrac1{8n\pi} - \dfrac3{32n^2 \pi} + \cdots$$
Hence, infact $I \sim \dfrac1{8\pi n^{3/2}} \left(1-\dfrac3{4n}\right)$.
