How to calculate the limit $\lim _{n\to \infty }\sum _{k=1}^n\sqrt{n^4+k}\sin(\frac{2k\pi }{n})$? Is it a Riemann sum? I just came across this limit and I suppose it can be computed using a Riemann sum but I can't get it right.
$$\lim _{n\to \infty }\sum _{k=1}^n\sqrt{n^4+k}\sin\left(\frac{2k\pi }{n}\right)$$
Any ideas?
 A: That is slightly tricky. You may notice that for any $k\in[1,n]$ the term $\sqrt{n^4+k}$ is considerably larger than $\sin\left(\frac{2\pi k}{n}\right)$, but there is a massive cancellation due to the fact that $\sin(2\pi x)$ is positive for $x\in\left(0,\frac{1}{2}\right)$ and negative for $x\in\left(\frac{1}{2},1\right)$. So, better to perform some reindexing via $k\mapsto n-k$:
$$ S_n=\sum_{k=1}\sqrt{n^4+k}\sin\left(\frac{2\pi k}{n}\right)=\sum_{k\leq n/2}\left(\sqrt{n^4+k}-\sqrt{n^4+n-k}\right)\sin\left(\frac{2\pi k}{n}\right) .\tag{1}$$
Now we may notice that $\sqrt{n^4+k}-\sqrt{n^4+n-k}$ is negative and it equals
$$ \frac{2k-n}{\sqrt{n^4+k}+\sqrt{n^4+n-k}}\approx \frac{2k-n}{2n^2} \tag{2}$$
where by Riemann sums
$$ \frac{1}{2n}\sum_{k\leq \frac{n}{2}}\left(2\frac{k}{n}-1\right)\sin\left(\frac{2\pi k}{n}\right)\to \frac{1}{2}\int_{0}^{1/2}(2x-1)\sin(2\pi x)\,dx =  \color{red}{-\frac{1}{4\pi}}.\tag{3}$$
I leave to you to make this argument rigorous, i.e. to prove that we are allowed to replace the LHS of $(2)$ with the RHS.
