# Integral over an exponential sum with squares

How should I estimate the following integral $$I = \int_0^1 \left( \sum_{n=0}^{p-1} e(n^2t) \right)^2 dt$$ where $$p$$ is a prime?

Here is the method I followed: \begin{align*} I & = \int_0^1 \left( 1+ \sum_{n=1}^{p-1} e(n^2t) \right)^2 dt \\ & = 1 + 2 \sum_{n=1}^{p-1} \left( \int_0^1 e(n^2t) dt \right) + \int_0^1 \left( \sum_{n=1}^{p-1} e(n^2t) \right)^2 dt \\ & = 1 + 2 \sum_{n=1}^{p-1} \left( \frac{e(n^2)-1}{2\pi i n^2} \right) + \int_0^1 \left( \sum_{n=1}^{p-1} e(n^2t) \right)^2 dt \\ & = 1+O((p-1)^{1+\epsilon}) \end{align*} where the third term is estimated using Hua's lemma.

This estimate is not good enough for my purpose. Is it possible to get a better error term than the one here?

The integral is equal to exactly one - just expand out the square and use orthogonality to get

$$I = \sum_{0\leq n,m

• Ah, of course. Thanks! Don't know why I overcomplicated it. – Iguana May 27 at 14:27