# Asymptotic behavior of $\sum_{j=1}^n \cos^p(\pi u j)$ for large $n$ and $p$?

Consider the sum

$$S=\sum_{j=1}^n \cos^p(\pi u j),$$

where $n$ and $p$ are positive integers and $u$ is irrational. Let's say $p$ is even. I'm interested in the asymptotic behavior of this for $n$ and $p$ both large. This is my attempt to make a finite sum similar to the series in this problem that might be easier to analyze while retaining the same interesting features. I think it might be possible to break up that series into shorter chunks whose behavior was similar to the behavior of this sum.

Naively, we might expect that $\cos^2$ would average to 1/2, so $S$ would be $O(n2^{-p/2})$. But the sum is likely to be influenced disproportionately by certain "lucky" terms for which $\cos^2$ is nearly 1. The probability of getting such a term goes like $1/p$, so this suggests that $S$ is $O(n/p)$. There is the question of whether the statistical argument can be made into a rigorous proof, and whether it depends on any other property of $u$ besides its irrationality, e.g., $u$'s irrationality measure. It seems unlikely to me that the results depends on any such properties, but it's conceivable that one could cook up values of $u$ that would be counterexamples, e.g., something of the flavor of Liouville's constant. For a finite $n$, $S$ measures how many good rational approximations to $u$ exist of the form $M/j$, with $j\le n$, but it would surprise me if the asymptotic behavior of $S$ really depended on $u$'s "personality."

The form of $S$ is pretty close to that of a geometric sum, which suggests that one might actually be able to massage it into a different form that would provide some insight. I tried writing the cosine in terms of complex exponentials and expanding the $\cos^p$ using binomial coefficients, then making the approximation that the binomial coefficients $p\choose{k}$ were constant for $k$ in $p/2\pm\sqrt{p}$ and and zero outside that range. This leads to expressions of the flavor of this:

$$2^{-p}\sum_{j=1}^n \frac{\ldots}{1-e^{\pi i u j}},$$

but after so many sloppy approximations, I don't know if this is meaningful.

-