1 Direct calculation
Turns out it is possible to calculate the integrals above by pure brute force, and this gives explicit formulas for the integrals as we see above.
In general, let be a sequence of positive real numbers, and consider the integral
Let us put aside the factors for a moment, and expand out :
Note that each of the terms in the right-hand sum is some sort of trigonometric function, depending on the value of mod .
The original integral was
Since has a simple zero at , we know from this expression that we can integrate this by parts times and have vanishing boundary terms:
We now use the expression above to compute this -fold derivative, and get
We claim this is equal to when , and smaller otherwise. Indeed, this is exactly the condition that all the are positive, so that the sign term disappears. The remaining claim is then that
Indeed, this follows by considering the th Taylor coefficient of the equality
where on the left we use that .