Today I found in an IG that the identities hold:
$$\sum_{k=1}^{n-1}\sin\frac{2\pi k^2}{n} = \frac{\sqrt n}{2}\left(1+\cos\frac{n\pi}{2}-\sin\frac{n\pi}{2}\right)$$
$$\sum_{k=1}^{n-1}\cos\frac{2\pi k^2}{n} = \frac{\sqrt n}{2}\left(1+\cos\frac{n\pi}{2}+\sin\frac{n\pi}{2}\right)$$
tested in wolframalpha, it is correct when n=100 https://www.wolframalpha.com/input/?i=Sum%5B+Sin%5B2+k%5E2+Pi+%2F+100%5D%2C+%7Bk%2C1%2C100%7D%5D+-+Sqrt%5B100%5D%2F2+%281%2BCos%5B100+Pi%2F2%5D+-+Sin%5B100+pi+%2F+2%5D%29 . But I have no idea about the validity. I have tried product-and-sum identity, Bernoulli's method ($\int_{k-1}^k x^p \text dx = (p-1)$-th degree polynomial of $k$), and Taylor series which requires Faulhaber's Formula, none succeeded.
Is there any way to derive this identities?