# Algorithms for Various Trigonometric Power Sums
## 1 Introduction  
Over the last half-century or so, finite sums involving powers of trigonometric functions have fascinated mathematicians and physicists. Although there had been sporadic interest in these sums before that, the modern interest was sparked in 1966 when [PERSON] [1] sought the solution of  
\[\sum_{k=1}^{\lfloor n/2\rfloor}2^{2m}\cos^{2m}\left(\frac{k\pi}{n+1}\right)= (n+1)\binom{2m-1}{m-1}-2^{2m-1}, \tag{1}\]  
where \(m<n+1\), with \(m\) and \(n\) being positive integers. The problem was solved shortly afterwards by [PERSON] et al. [2]. Later, [PERSON] [3] observed that the finite sum of inverse powers of cosines given by  
\[S_{n,2}(m)=\left(\frac{\pi}{2m}\right)^{2v}\sum_{k=1}^{m-1}\cos^{-2v}\left( \frac{k\pi}{2m}\right), \tag{2}\]  
where both \(m\) and \(v\) are positive integers, appears in the calculation of the \(v\)-th cumulant of a certain quadratic form in \(m\) independent standardized normal variates. Although he was able to find that  
\[\lim_{m\rightarrow\infty}S_{v(m)}=\zeta(2v), \tag{3}\]  
where \(\zeta(s)\) is the Riemann zeta function, he asked whether it was possible to obtain a \"simpler\" closed form expression for \(S_{v}(m)\), for all \(m\) and \(v\). In solving this problem, [PERSON] (1988); [PERSON] (1988) observed that the above sum could be expressed as  
\[S_{v,2}(m)=\Big{(}\frac{\pi}{2m}\Big{)}^{2v}\sum_{k=1}^{m-1}\sin^{-2v}\!\left( \frac{k\pi}{2m}\right)\!. \tag{4}\]  
He then set about devising an ingenious generating function approach for the more general trigonometric power series given by  
\[Q_{m,v}(\delta)=\sum_{k=1}^{m-1}\sin^{-2v}\!\left(\frac{k\pi+\delta}{2m}\right)\!. \tag{5}\]  
Eventually, he arrived at  
\[S_{1,2}(m)=\frac{\pi^{2}}{6}\Big{(}1-\frac{1}{m^{2}}\Big{)}\quad\text{and} \quad S_{2,2}(2)=\frac{\pi^{4}}{90}\Big{(}1+\frac{5}{2m^{2}}-\frac{7}{2m^{4}} \Big{)}, \tag{6}\]  
while for large \(m\), he found that  
\[S_{v,2}(m)=\zeta(2v)+\frac{v}{12m^{2}}\,\zeta(2v-2)+O\Big{(}m^{-4}\Big{)}. \tag{7}\]  
A flurry of activity on trigonometric power sums occurred in the late 1980s due to their appearance in important physical applications, such as the work of [PERSON] [PERSON] (1988); [PERSON] (1988); [PERSON] (1990) which dealt with the Casimir effect and heat kernel expansion on a generalized cone, [PERSON] (1990), whose formula predicts the dimension of the space of conformal blocks in a chiral conformal field theory (CFT), and [PERSON] (1988), who developed [PERSON]'s results further. A decade later, studies of related sums appeared, such as by [PERSON] and [PERSON] [PERSON] and [PERSON] (1988) on the explicit evaluation and reciprocity theorems of specific trigonometric power sums, and [PERSON] and [PERSON] [PERSON] and [PERSON] (1988, 1999) on [PERSON]'s and related sums. It should be mentioned here that [PERSON] and [PERSON] also presented an extensive literature survey on these sums in the introduction to their paper. At the same time, other authors [PERSON] and [PERSON] (1999); [PERSON] (2000); [PERSON] (2000), motivated by the intrinsic fascination of these sums, derived formulas where the summand was a power of secant, as in  
\[\sum_{k=0}^{m-1}\sec^{2p}\!\left(\frac{k\pi}{m}\right)=m\sum_{k=1}^{2p-1}(-1) ^{p+k}\!\left(\!\! \begin{array}{c}p-1+km\\ 2p-1\end{array} \!\!\right)\sum_{j=k}^{2p-1}\binom{2p}{j+1}. \tag{8}\]  
It should be noted that when both sides of this result are evaluated separately in Mathematica (Version 14.0) [PERSON] (1988), it is found that they agree in decimal form, although for large values of \(n\) and \(p\), one may encounter problems with complex infinities on the left-hand side (lhs) due to the summand becoming very small. Afterwards, [PERSON] (1988) concentrated only on sums involving powers of cosecant with a similar argument as in the above sum, since he noted that they also occur in Renyi entropy and Dedekind sums.