# Algorithms for Various Trigonometric Power Sums
## 6 Integral Approach Revisited
The more correct version, which appears as (3.15) in [25], is given by  
\[T_{v,l}^{\pm}(m,r) =-\frac{2^{2v-2}m^{2}}{2\pi^{2}\Gamma(2v)}\int_{0}^{1}\frac{\ln u }{1-u^{m}}\prod_{n=1}^{v-1}\!\left(\frac{m^{2}}{4\pi^{2}}\ln^{2}u+n^{2}\right)\]4The first cosine is simply obtained by replacing \(r\) by \(2r\), which gives (3.16) in [24]. In this case, the second term on the rhs of (114) equals \(-1/4\). Introducing (114) into (112) and carrying out some algebra, one obtains  
\[T_{v,l}^{\pm}(m,r) =-\frac{2^{2v-2}m^{2}}{2\pi^{2}\Gamma(2v)}\int_{0}^{1}\frac{\ln u }{1-u^{m}}\prod_{n=1}^{v-1}\!\left(\frac{m^{2}}{4\pi^{2}}\ln^{2}u+n^{2}\right)\]5  
where  
\[T_{v,l}^{\pm}(m,r) =-\frac{2^{2v-2}m^{2}}{2\pi^{2}\Gamma(2v)}\int_{0}^{1}\frac{\ln u }{1-u^{m}}\prod_{n=1}^{v-1}\!\left(\frac{m^{2}}{4\pi^{2}}\ln^{2}u+n^{2}\right)\]6  
Since both \(p_{-}(r)\) and \(p_{+}(r)\) are periodic or modulo \(5\), \(T_{4,1}^{+}(5,r)\) is modulo \(5\). Moreover, \(p_{+}(r)\) is zero for all values of \(r\) greater than zero and less than \(5\), where Theorem 3 applies. The modulo \(5\) values of \(r\) equal to zero can be handled with the results in Section 2. Consequently, the \(\sqrt{5}\)-term in (115) vanishes, and the values of \(T_{4,1}^{+}(5,r)\) are rational, as expected. In fact, for \(r\) equal to \(1\), \(2\), \(3\) and \(4\), \(T_{4,1}^{+}(5,r)\) equals \(1024/25\), \(-2816/25\), \(-2816/25\) and \(1024/25\), respectively. The above example can be extended to other values of \(v\) and \(m\) using other results in Appendix L11 of [24]. We now turn our attention to the alternating cases of the results in Theorem 3, which are presented in the following theorem. Theorem 4: _For \(r\), a positive integer less than \(lm\), the alternating twisted trigonometric power sum in the Dowker case, \(T_{v,1}^{-}(m,r)\), is given by_  
\[T_{v,l}^{\pm}(m,r) =-\frac{2^{2v-2}m^{2}}{2\pi^{2}\Gamma(2v)}\int_{0}^{1}\frac{\ln u }{1-u^{m}}\prod_{n=1}^{v-1}\!\left(\frac{m^{2}}{4\pi^{2}}\ln^{2}u+n^{2}\right)\]7  
In other words, we arrive at \(T^{-}_{v,1}(m,r)\). Therefore, substituting \(m\) by \(m/2\) in (118) yields the second result in (117). Finally, we consider the situation when \(m\) is odd. Already, we have seen that \(T^{-}_{v,1}(m,0)\) vanishes as demonstrated in the proof of Theorem 1. Here, we let \(m\!=\!2N+1\), where \(N\) is a non-negative integer, and write \(T^{-}_{v,1}(2N+1,r)\) as  
\[T_{v,l}^{\pm}(m,r) =-\frac{2^{2v-2}m^{2}}{2\pi^{2}\Gamma(2v)}\int_{0}^{1}\frac{\ln u }{1-u^{m}}\prod_{n=1}^{v-1}\!\left(\frac{m^{2}}{4\pi^{2}}\ln^{2}u+n^{2}\right)\]8 \[T_{v,l}^{\pm}(m,r) =-\frac{2^{2v-2}m^{2}}{2\pi^{2}\Gamma(2v)}\int_{0}^{1}\frac{\ln u }{1-u^{m}}\prod_{n=1}^{v-1}\!\left(\frac{m^{2}}{4\pi^{2}}\ln^{2}u+n^{2}\right)\]9  
In the second sum we replace \(k\) by \(2N+1-k\). This gives  
\[\times\sum_{k=1}^{m-1}(\pm 1)^{k}\!\left(u^{k}+u^{m-k}\right)\! \left(e^{2i\pi kr/m}+e^{-2i\pi kr/m}\right)\!\frac{du}{u}. \tag{100}\]0  
The above result cancels the first sum on the rhs of (122), leaving us with zero for odd values of \(m\) in the alternating twisted trigonometric power sum for the Dowker case. From the results in Theorems 3 and 4, it can be seen that the solutions to twisted trigonometric power sums in the Dowker case are only valid for integer values of \(r\) from zero to \(m-1\). However, it was mentioned at the beginning of Section 5 that, for \(r\) larger than \(m\), solutions of twisted trigonometric power sums could be obtained for the Dowker case by assigning \(r\) to become the modulo of \(r\) with respect to \(m\). Thus, there are \(m\) distinct values of this twisted trigonometric power sum. In other words, the twisted trigonometric power sum is cyclic over the integers. In the Gardner-Fisher case, there are \(2m\) distinct values for the twisted trigonometric power sum, but the upper \(m\) values of the non-alternating version become the lowest \(m\) values of the alternating version or vice versa. To see this more clearly, let \(r=pm+q\), where \(p\) is an integer and \(q=\text{mod}(r,m)\).