<ph f="cmr"> </ph><ph f="cmbx">Determinations of Analogues of Gauss Sums and Other Trigonometric Sums</ph>

### Matthias Beck, Bruce C. Berndt1, O-Yeat Chan, and Alexandru Zaharescu

Department of Mathematics, San Francisco State University, 1600 Holloway Ave, San Francisco, CA 94132 Department of Mathematics, University of Illinois, 1409 West Green Street, Urbana, IL 61801, USA E-mail address : beck@math.sfsu.edu E-mail address : berndt@math.uiuc.edu E-mail address : ochan@math.uiuc.edu E-mail address : zaharesc@math.uiuc.edu
DETERMINATIONS OF ANALOGUES OF GAUSS SUMS AND OTHER TRIGONOMETRIC SUMS MATTHIAS BECK, BRUCE C. BERNDT1 2 , O-YEAT CHAN3 , and ALEXANDRU ZAHARESCU
Abstract. Explicit evaluations of several classes of trigonometric sums in closed form are given.
These sums can be viewed as analogues or generalizations of Gauss sums. In a previous paper, two of the present authors considered primarily sine sums associated with primitive odd characters. In this paper, we establish two general theorems involving both sines and cosines, with more attention given to cosine sums in special cases.
2000 AMS Classification Numbers: Primary, 11L03; Secondary, 11R29, 11L10.

1 Introduction

Motivated by two trigonometric identities
 $\begin{array}{c}\frac{sin\left(2\pi /7\right)}{{sin}^{2}\left(3\pi /7\right)}-\frac{sin\left(\pi /7\right)}{{sin}^{2}\left(2\pi /7\right)}+\frac{sin\left(3\pi /7\right)}{{sin}^{2}\left(\pi /7\right)}=2\sqrt{7}\end{array}$ (1.1)
and
 $\begin{array}{c}\frac{{sin}^{2}\left(3\pi /7\right)}{sin\left(2\pi /7\right)}-\frac{{sin}^{2}\left(2\pi /7\right)}{sin\left(\pi /7\right)}+\frac{{sin}^{2}\left(\pi /7\right)}{sin\left(3\pi /7\right)}=0,\end{array}$ (1.2)
discovered by Berndt and L.–C. Zhang [4as corollaries of two theta-function identities in Ramanujan's notebooks [8, and also motivated by further identities found by Z.–G. Liu [7,pp. 107–108, Berndt and Zaharescu [3evaluated large classes of trigonometric sums in terms of class numbers of imaginary quadratic fields. As an illustration, we begin by offering one of these general theorems and one of its corollaries.
Theorem 1.1. Let $\chi$  denote an odd, real, non-principal, primitive character of modulus $k$  , where $k$  is odd and $k\ge 7$  . Let
 $\begin{array}{c}{S}_{1}\left(k,\chi ,a,b\right):={\sum }_{0 (1.3)
where $a$  and $b$  are positive integers with $a$  odd, $b$  even, and $ab-a-3<2k$  .
Define
 $\begin{array}{c}{C}_{a,b}:={\sum }_{n,m,r\ge 0n+bm+r=\left(ab-a-1\right)/2}\left(-1{\right)}^{m}\chi \left(n\right)\left(\genfrac{}{}{0}{}{a}{m}\right)\left(\genfrac{}{}{0}{}{a+r}{r}\right).\end{array}$ (1.4)
Then
 $\begin{array}{c}{S}_{1}\left(k,\chi ,a,b\right)=\sqrt{k}\left({b}^{a}h\left(-k\right)-2{C}_{a,b}\right),\end{array}$ (1.5)
where $h\left(-k\right)$  denotes the class number of the imaginary quadratic field $\mathbb{Q}\left(\sqrt{-k}\right)$  .
The requirement $ab-a-3<2k$  is technical; we could dispense with this condition, but then ${C}_{a,b}$  would have to be replaced by a more complicated sum.
Corollary 1.2. If $\chi$  is given as above, then
 $\begin{array}{c}{\sum }_{0 (1.6)
The evaluation  1.1 is the special case of  1.6 when $k=7$  and $\chi \left(n\right)$  is the Legendre symbol $\left(\frac{n}{7}\right)$  .
The proofs in [3depend on contour integration and elementary properties of Gauss sums.
While sums involving powers of the sine function, odd characters, and class numbers of imaginary quadratic fields are the focus of [3, in this paper we consider sums with both sines and cosines, and sums involving either odd or even characters. Some of our main theorems are for odd characters, and others are for even characters. Although some of our evaluations can be expressed in terms of class numbers in special cases, we do not emphasize such instances in the present paper.
Before embarking on the proofs of our general theorems, we thought it best to begin with the evaluation of a class of cosine sums associated with even characters. Thus, in Section  2 , we alter our ideas from [3to evaluate a large class of trigonometric sums involving even characters.
In Section  3 , we establish our main general theorems, while in the following section we apply the aforementioned results and prove two principal general theorems on sums of trigonometric functions. We also offer several corollaries.
Some of the identities found by Liu [7are not associated with characters. In Section  5 , we evaluate a large class of trigonometric sums which includes four of Liu's identities.
We close the introduction by recording those properties of Gauss sums that are used in the sequel. Throughout this paper, $\chi$  denotes a non-principal, real, primitive character modulo $k$  , where $k$  is an odd positive integer at least equal to 3. Define the Gauss sum $G\left(z,\chi \right)$  for any complex number $z$  by
 $\begin{array}{c}G\left(z,\chi \right):={\sum }_{j=0}^{k-1}\chi \left(j\right){e}^{2\pi ijz/k}.\end{array}$ (1.7)
Then, for each integer $n$  , we have the factorization theorem [2,p. 9,Thm. 1.1.3
 $\begin{array}{c}G\left(n,\chi \right)=\chi \left(n\right)G\left(1,\chi \right)=:\chi \left(n\right)G\left(\chi \right).\end{array}$ (1.8)
In fact,  1.8 characterizes real primitive characters, i.e.,  1.8 holds if and only if $\chi$  is real and primitive [1,p. 482,Thm. 1, [6,pp. 65–66. We need Gauss's famous evaluation [5,p. 349,Thm. 7, [2,p. 22,Thm. 1.3.4
 $\begin{array}{c}G\left(\chi \right)=\left\{\begin{array}{cc}\sqrt{k},& \text{if}\chi \text{is even}\\ i\sqrt{k},& \text{if}\chi \text{is odd}.\end{array}\end{array}$ (1.9)
In the sequel, ${R}_{\alpha }\left(f\right)={R}_{\alpha }$  denotes the residue of a meromorphic function $f$  at a pole $\alpha$  .

2 Trigonometric Sums Associated with Even Characters

At the outset, we remark that we consider less general functions in Theorem  2.1 than we did for the corresponding theorem in [3, because otherwise the computations of residues would have been more cumbersome and the results less elegant.
Theorem 2.1. Let $\chi$  be a real, non-principal, even, primitive character of modulus $k$  , where $k$  is odd. For each nonnegative integer $a$  and even positive integer $b$  , define
 $\begin{array}{c}{S}_{1}\left(a,b,\chi \right):={\sum }_{0 (2.1)
and
 $\begin{array}{c}E\left(a,b,\chi \right):=\frac{1}{{2}^{a-2}}{\sum }_{n,j,r\ge 02\left(n+j+br\right)=ab}\left(-1{\right)}^{j}j\chi \left(n\right)\left(\genfrac{}{}{0}{}{a}{r}\right),\end{array}$ (2.2)
where the sum is over all nonnegative integers $n$  , $j$  , and $r$  satisfying the condition $2\left(n+j+br\right)=ab$  . Also, set
 $\begin{array}{c}g\left(\chi \right):={\sum }_{j=1}^{k-1}\left(-1{\right)}^{j}j\chi \left(j\right).\end{array}$ (2.3)
Then,
 $\begin{array}{c}{S}_{1}\left(a,b,\chi \right)=-\sqrt{k}\left(\left(-1{\right)}^{ab/2}g\left(\chi \right)+E\left(a,b,\chi \right)\right).\end{array}$ (2.4)
• Proof. For $N>0$  , let ${C}_{N}$  denote the positively oriented indented rectangle with horizontal sides through $±iN$  and vertical sides through $0$  and $k$  . On the left side of ${C}_{N}$  , there is a semicircular indentation ${I}_{0}$  of radius less than $1$  centered at $0$  and to its left. On the right side of ${C}_{N}$  , the semicircular indentation comprises the points ${I}_{0}+k$  .
Consider the meromorphic function  $\begin{array}{c}f\left(z\right)=\frac{G\left(z,\chi \right)}{G\left(\chi \right)}\frac{{cos}^{a}\left(b\pi z/k\right)}{{cos}^{2}\left(\pi z/k\right)}\frac{1}{{e}^{2\pi iz}-1}.\end{array}$ (2.5)
We shall integrate $f\left(z\right)$  over the contour ${C}_{N}$  , on the interior of which the function $f\left(z\right)$  has simple poles (at most) at $z=1,2,...,k-1$  . Also on the interior of ${C}_{N}$  , $f\left(z\right)$  has a simple pole at $z=k/2$  . This pole is simple because $k$  is odd and because $G\left(k/2,\chi \right)=0$  . To see this, use  1.7 , replace $j$  by $k-j$  , and recall that $\chi$  is even. We thus find that $G\left(k/2,\chi \right)=-G\left(k/2,\chi \right)$  , i.e., $G\left(k/2,\chi \right)=0$  . Lastly, since $G\left(0,\chi \right)=0$  , $f\left(z\right)$  does not have a pole at $z=0$  .
We first calculate the residues of the poles of $f\left(z\right)$  on the interior of ${C}_{N}$  . Using  1.8 , we easily find that for each positive integer $n$  ,  $\begin{array}{c}{R}_{n}=\frac{G\left(n,\chi \right)}{G\left(\chi \right)}\frac{{cos}^{a}\left(b\pi n/k\right)}{{cos}^{2}\left(\pi n/k\right)}\frac{1}{2\pi i}=\frac{\chi \left(n\right)}{2\pi i}\frac{{cos}^{a}\left(b\pi n/k\right)}{{cos}^{2}\left(\pi n/k\right)}\end{array}$ (2.6)
and  $\begin{array}{c}{R}_{k-n}=\frac{G\left(k-n,\chi \right)}{G\left(\chi \right)}\frac{{cos}^{a}\left(b\pi \left(k-n\right)/k\right)}{{cos}^{2}\left(\pi \left(k-n\right)/k\right)}\frac{1}{2\pi i}={R}_{n},\end{array}$ (2.7)
because $\chi$  and $b$  are even. Secondly, using  1.9 , we readily find that
 $\begin{array}{cc}{R}_{k/2}& ={lim}_{z\to k/2}\frac{1}{G\left(\chi \right)}\frac{G\left(z,\chi \right)}{cos\left(\pi z/k\right)}\frac{z-k/2}{cos\left(\pi z/k\right)}\frac{{cos}^{a}\left(b\pi z/k\right)}{{e}^{2\pi iz}-1}\end{array}$
 $\begin{array}{cc}& =-\frac{\left(-1{\right)}^{ab/2}\sqrt{k}i}{\pi }{\sum }_{j=1}^{k-1}\left(-1{\right)}^{j}j\chi \left(j\right)\end{array}$
 $\begin{array}{cc}& =-\frac{\left(-1{\right)}^{ab/2}\sqrt{k}i}{\pi }g\left(\chi \right),\end{array}$ (2.8)
 $\begin{array}{}\end{array}$
by  2.3 . Hence, by the residue theorem,  2.6  2.8 , and  2.1 ,  $\begin{array}{c}{\int }_{{C}_{N}}f\left(z\right)dz=2\left(-1{\right)}^{ab/2}\sqrt{k}g\left(\chi \right)+2{S}_{1}\left(a,b,\chi \right).\end{array}$ (2.9)
Next, we let $N\to \infty$  in order to calculate directly the integral in  2.9 . Firstly, observe from  2.5 that because $b$  is even, $f\left(z\right)$  has period $k$  , and so the integrals over the indented vertical sides of ${C}_{N}$  cancel. Secondly, examine the integral over the top horizontal side ${C}_{NT}$  of ${C}_{N}$  . Set $z=x+iN$  , $0\le x\le k$  , and  $\begin{array}{c}\mu :={e}^{2\pi iz/k}={e}^{-2\pi N/k}{e}^{2\pi ix/k}.\end{array}$ (2.10)
Then, by  1.7 ,
 $\begin{array}{cc}\frac{G\left(z,\chi \right)}{{e}^{2\pi iz}-1}& =\left({\sum }_{j=0}^{k-1}\chi \left(j\right){\mu }^{j}\right)\left(-{\sum }_{n=0}^{\infty }{\mu }^{kn}\right)=-{\sum }_{n=0}^{\infty }{\sum }_{j=0}^{k-1}\chi \left(j\right){\mu }^{kn+j}\end{array}$
 $\begin{array}{cc}& =-{\sum }_{n=0}^{\infty }{\sum }_{j=0}^{k-1}\chi \left(kn+j\right){\mu }^{kn+j}=-{\sum }_{m=0}^{\infty }\chi \left(m\right){\mu }^{m},\end{array}$ (2.11)
 $\begin{array}{cc}{cos}^{a}\left(b\pi z/k\right)& ={\left(\frac{{\mu }^{b/2}+{\mu }^{-b/2}}{2}\right)}^{a}=\frac{1}{{2}^{a}}{\mu }^{-ab/2}\left(1+{\mu }^{b}{\right)}^{a}=\frac{1}{{2}^{a}}{\mu }^{-ab/2}{\sum }_{r=0}^{a}\left(\genfrac{}{}{0}{}{a}{r}\right){\mu }^{br},\end{array}$ (2.12)
 $\begin{array}{cc}\text{and}{cos}^{-2}\left(\pi z/k\right)& =\frac{4}{{\mu }^{-1}\left(1+\mu {\right)}^{2}}=4{\sum }_{j=1}^{\infty }\left(-1{\right)}^{j-1}j{\mu }^{j}.\end{array}$ (2.13)
 $\begin{array}{}\end{array}$
Thus, $f\left(z\right)$  has the form  $\begin{array}{c}f\left(z\right)=f\left(x+iN\right)={\sum }_{n=-ab/2}^{0}{c}_{n}{\mu }^{n}+{\sum }_{n=1}^{\infty }{c}_{n}{\mu }^{n}\end{array}$ (2.14)
for some constants ${c}_{n}$  , along the top horizontal side ${C}_{NT}$  . Observe that we can ignore the terms of the form ${c}_{n}{\mu }^{n}$  with $n>0$  , since their contributions to the integral of $f\left(z\right)$  over ${C}_{NT}$  tend to 0 as $N$  tends to $\infty$  (recall that $|\mu |={e}^{-2\pi N/k}$  ). Thus, we truncate  2.14 , keeping only the first sum in  2.14 , and integrate termwise. Since, for $n\ne 0$  ,  $\begin{array}{c}{\int }_{k}^{0}{\mu }^{n}dx=0,\end{array}$ (2.15)
we find that  $\begin{array}{c}{\int }_{{C}_{NT}}f\left(z\right)dz=-k{c}_{0}.\end{array}$ (2.16)
Since $f\left(z\right)$  is an odd function with period $k$  , we find that
 $\begin{array}{cc}{\int }_{{C}_{NT}}f\left(z\right)dz& ={\int }_{z=k+iN}^{z=iN}f\left(z\right)dz=-{\int }_{-z=-k-iN}^{-z=-iN}f\left(-z\right)dz\end{array}$
 $\begin{array}{cc}& ={\int }_{u=-k-iN}^{u=-iN}f\left(u\right)du={\int }_{u=-iN}^{u=k-iN}f\left(u\right)du={\int }_{{C}_{NB}}f\left(z\right)dz,\end{array}$ (2.17)
 $\begin{array}{}\end{array}$
where ${C}_{NB}$  is the lower horizontal path of ${C}_{N}$  . Thus, by  2.9 and  2.16 , we conclude that  $\begin{array}{c}-2k{c}_{0}=2\left(-1{\right)}^{ab/2}\sqrt{k}g\left(\chi \right)+2{S}_{1}\left(a,b,\chi \right),\end{array}$ (2.18)
where ${c}_{0}$  is defined in  2.14 . To compute ${c}_{0}$  , we utilize  2.11  2.13 and the definition  2.5 of $f$  to find that along ${C}_{NT}$  ,
 $\begin{array}{cc}f\left(z\right)& =-\frac{1}{G\left(\chi \right)}\frac{{\mu }^{-ab/2}}{{2}^{a-2}}{\sum }_{n=0}^{\infty }\chi \left(n\right){\mu }^{n}{\sum }_{r=0}^{a}\left(\genfrac{}{}{0}{}{a}{r}\right){\mu }^{br}{\sum }_{j=1}^{\infty }\left(-1{\right)}^{j-1}j{\mu }^{j}.\end{array}$ (2.19)
 $\begin{array}{}\end{array}$
The constant term in  2.19 is equal to  $\begin{array}{c}{c}_{0}=\frac{1}{{2}^{a-2}G\left(\chi \right)}{\sum }_{n,j,r\ge 0n+j+br=ab/2}\left(-1{\right)}^{j}j\chi \left(n\right)\left(\genfrac{}{}{0}{}{a}{r}\right)=\frac{1}{\sqrt{k}}E\left(a,b,\chi \right),\end{array}$ (2.20)
by  1.9 and  2.2 . Hence, from  2.18 and  2.20 , we deduce that $-2k{c}_{0}=-2\sqrt{k}E\left(a,b,\chi \right)=2\left(-1{\right)}^{ab/2}\sqrt{k}g\left(\chi \right)+2{S}_{1}\left(a,b,\chi \right),$  which completes the proof of Theorem  2.1 .
We state the special case $a=1$  as a separate corollary.
Corollary 2.2. Let $b$  be a positive even integer, and assume that $\chi$  satisfies the conditions of Theorem  2.1 . Let
 $\begin{array}{c}E\left(b,\chi \right):=2{\sum }_{n,j\ge 12n+2j=b}\left(-1{\right)}^{j}j\chi \left(n\right).\end{array}$ (2.21)
Then
 $\begin{array}{c}{\sum }_{0 (2.22)
In particular, if $b=2$  , then $E\left(2,\chi \right)=0$  . We thus deduce the following corollary of Corollary  2.2 .
Corollary 2.3. For $\chi$  as above,
 $\begin{array}{c}{\sum }_{0 (2.23)
In particular, from  2.3 , we note that $g\left(\chi \right)$  is an integer, and so  2.23 is an analogue of Gauss's theorem  1.9 for even $\chi$  , namely,
 $\begin{array}{c}{\sum }_{n=1}^{k-1}\chi \left(n\right)cos\left(2\pi n/k\right)=\sqrt{k}.\end{array}$ (2.24)
Letting $k=5$  in  2.23 and noting that $g\left(\chi \right)=4$  , we find that
 $\begin{array}{c}\frac{cos\left(2\pi /5\right)}{{cos}^{2}\left(\pi /5\right)}+\frac{cos\left(\pi /5\right)}{{cos}^{2}\left(2\pi /5\right)}=4\sqrt{5}.\end{array}$ (2.25)
Of course, since
 $\begin{array}{c}cos\left(\frac{\pi }{5}\right)=\frac{\sqrt{5}+1}{4}\text{and}cos\left(\frac{2\pi }{5}\right)=\frac{\sqrt{5}-1}{4},\end{array}$ (2.26)
2.25 may be easily verified directly.

3 A General Theorem

If $k$  is an odd positive integer, let ${\chi }_{o}\left(n\right)$  be a real, odd, non-principal, primitive character of period $k$  , and let ${\chi }_{e}\left(n\right)$  be a real, even, non-principal, primitive character of period $k$  . Define
 $\begin{array}{cc}{H}_{o}\left(z\right)& :=\frac{G\left(z;{\chi }_{o}\right)}{G\left({\chi }_{o}\right)}\frac{1}{{e}^{2\pi iz}-1},\end{array}$
 $\begin{array}{cc}{H}_{e}\left(z\right)& :=\frac{G\left(z;{\chi }_{e}\right)}{G\left({\chi }_{e}\right)}\frac{1}{{e}^{2\pi iz}-1}.\end{array}$
 $\begin{array}{}\end{array}$
Theorem 3.1. Let $k$  , ${\chi }_{o}$  , ${\chi }_{e}$  , ${H}_{o}$  , and ${H}_{e}$  be as above, and let ${f}_{o}\left(z\right)$  and ${f}_{e}\left(z\right)$  be meromorphic functions satisfying the following properties:
• (i) ${f}_{o}\left(z\right)={f}_{o}\left(z+k\right)$  and ${f}_{e}\left(z\right)={f}_{e}\left(z+k\right)$  for all $z\in \mathbb{C}$  ,
• (ii) ${f}_{o}\left(-z\right)=-{f}_{o}\left(z\right)$  and ${f}_{e}\left(-z\right)={f}_{e}\left(z\right)$  for all $z\in \mathbb{C}$  ,
• (iii) ${f}_{o}\left(z\right)$  and ${f}_{e}\left(z\right)$  are analytic for $\text{Im}\left(z\right)\ne 0$  as well as at integers not divisible by $k$  ,
• (iv) ${f}_{o}$  and ${f}_{e}$  have poles at the points ${z}_{1}^{o},...,{z}_{M}^{o}$  and ${z}_{1}^{e},...,{z}_{{M}^{\prime }}^{e}$  , respectively,
• (v) ${f}_{o}\left(z\right)$  and ${f}_{e}\left(z\right)$  have Fourier expansions of the form
 $\begin{array}{cc}{f}_{o}\left(z\right)& ={\sum }_{m=-D}^{\infty }{A}_{m}{e}^{2\pi imz/k},\end{array}$ (3.1)
 $\begin{array}{cc}{f}_{e}\left(z\right)& ={\sum }_{m=-{D}^{\prime }}^{\infty }{B}_{m}{e}^{2\pi imz/k}\end{array}$ (3.2)
 $\begin{array}{}\end{array}$
in the upper half-plane.
Then,
 $\begin{array}{c}{\sum }_{0 (3.3)
and
 $\begin{array}{c}{\sum }_{0 (3.4)
• Proof. We prove  3.3 ; the proof of  3.4 is similar.
Note that
 $\begin{array}{cc}{H}_{o}\left(-z\right)& =\frac{{\sum }_{j=1}^{k-1}{\chi }_{o}\left(j\right){e}^{2\pi ij\left(-z\right)/k}}{G\left({\chi }_{o}\right)}\frac{-{e}^{2\pi iz}}{{e}^{2\pi iz}-1}\end{array}$
 $\begin{array}{cc}& =\frac{-{\sum }_{j=1}^{k-1}{\chi }_{o}\left(j\right){e}^{2\pi i\left(k-j\right)z/k}}{G\left({\chi }_{o}\right)\left({e}^{2\pi iz}-1\right)}\end{array}$
 $\begin{array}{cc}& =\frac{{\sum }_{j=1}^{k-1}{\chi }_{o}\left(k-j\right){e}^{2\pi i\left(k-j\right)z/k}}{G\left({\chi }_{o}\right)\left({e}^{2\pi iz}-1\right)}\end{array}$
 $\begin{array}{cc}& ={H}_{o}\left(z\right).\end{array}$
 $\begin{array}{}\end{array}$
Thus, the function ${F}_{o}\left(z\right):={H}_{o}\left(z\right){f}_{o}\left(z\right)$  is an odd function with period $k$  . This function has poles at ${z}_{1}^{o},...,{z}_{M}^{o}$  , and (at most) simple poles at the points $z=1,...,k-1$  . It also may have a pole at $z=0$  . Let ${C}_{N}$  denote the same positively oriented indented rectangle as in Theorem  2.1 . Hence, by the residue theorem,  $\begin{array}{c}\frac{1}{2\pi i}{\int }_{{C}_{N}}{F}_{o}\left(z\right)dz={\sum }_{j=1}^{k-1}{R}_{j}\left({F}_{o}\right)+{\sum }_{m=1}^{M}{R}_{{z}_{m}^{o}}\left({F}_{o}\right)+{R}_{0}\left({F}_{o}\right).\end{array}$ (3.5)
We first compute the residues at the integers $z=1,...,k-1$  . Since these are (at most) simple poles, the residue at $z=j$  is given by ${R}_{j}\left({F}_{o}\right)={lim}_{z\to j}\left(z-j\right){F}_{o}\left(z\right)={lim}_{z\to j}\frac{G\left(z;{\chi }_{o}\right)}{G\left({\chi }_{o}\right)}{f}_{o}\left(z\right)\frac{z-j}{{e}^{2\pi iz}-1}=\frac{1}{2\pi i}{\chi }_{o}\left(j\right){f}_{o}\left(j\right),$  where we have used  1.8 in the last step. By the oddness and periodicity of ${\chi }_{o}$  and ${f}_{o}$  , we find that  $\begin{array}{c}{\sum }_{j=1}^{k-1}{R}_{j}\left({F}_{o}\right)={\sum }_{j=1}^{k-1}\frac{1}{2\pi i}{\chi }_{o}\left(j\right){f}_{o}\left(j\right)=\frac{1}{\pi i}{\sum }_{1\le j (3.6)
Secondly, we evaluate the integral on the left-hand side of  3.5 directly. By periodicity, the integrals along the vertical sides of ${C}_{N}$  cancel. Thus, using the oddness of ${F}_{o}\left(z\right)$  and periodicity, we see that the integral along the upper horizontal edge is equal to  $\begin{array}{c}{\int }_{z=k+iN}^{z=iN}{F}_{o}\left(z\right)dz=-{\int }_{-z=-k-iN}^{-z=-iN}{F}_{o}\left(-z\right)dz={\int }_{u=-k-iN}^{u=-iN}{F}_{o}\left(u\right)du={\int }_{u=-iN}^{u=k-iN}{F}_{o}\left(u\right)du,\end{array}$ (3.7)
which is the integral along the lower horizontal edge. Also, since the right-hand side of  3.5 is independent of $N$  , we may let $N$  tend to $\infty$  . Thus, it remains to evaluate ${lim}_{N\to \infty }\frac{1}{2\pi i}{\int }_{{C}_{N}}{F}_{o}\left(z\right)dz={lim}_{N\to \infty }\frac{1}{\pi i}{\int }_{k}^{0}{F}_{o}\left(x+iN\right)dx.$  Now let  $\begin{array}{c}\mu :={e}^{2\pi iz/k}\end{array}$ (3.8)
and expand ${F}_{o}\left(z\right)$  in a power series in $\mu$  . Since $\frac{1}{{e}^{2\pi iz}-1}=-1-{\mu }^{k}-{\mu }^{2k}-\cdots ,$
 $\begin{array}{cc}{F}_{o}\left(z\right)& =\frac{1}{G\left({\chi }_{o}\right)}\left({\sum }_{j=0}^{k-1}{\chi }_{o}\left(j\right){\mu }^{j}\right)\left({\sum }_{m=-D}^{\infty }{A}_{m}{\mu }^{m}\right)\left(-{\sum }_{n=0}^{\infty }{\mu }^{kn}\right)\end{array}$
 $\begin{array}{cc}& =\frac{1}{G\left({\chi }_{o}\right)}\left(-{\sum }_{n=0}^{\infty }{\sum }_{j=0}^{k-1}{\chi }_{o}\left(j\right){\mu }^{kn+j}\right)\left({\sum }_{m=-D}^{\infty }{A}_{m}{\mu }^{m}\right)\end{array}$
 $\begin{array}{cc}& =\frac{1}{G\left({\chi }_{o}\right)}\left(-{\sum }_{n=0}^{\infty }{\chi }_{o}\left(n\right){\mu }^{n}\right)\left({\sum }_{m=-D}^{\infty }{A}_{m}{\mu }^{m}\right)\end{array}$
 $\begin{array}{cc}& =\frac{1}{G\left({\chi }_{o}\right)}{\sum }_{m=-D}^{\infty }{c}_{m}{\mu }^{m}\end{array}$ (3.9)
 $\begin{array}{}\end{array}$
for some constants ${c}_{m},m\ge -D$  . Since ${\int }_{k}^{0}{\sum }_{m=1}^{\infty }{c}_{m}{\mu }^{m}dx$  tends to 0 as $N$  tends to $\infty$  , and ${\int }_{k}^{0}{\mu }^{m}dx=0$  for any $m\ne 0$  , we find that, upon the use of  3.7 ,  $\begin{array}{c}{lim}_{N\to \infty }\frac{1}{2\pi i}{\int }_{{C}_{N}}{F}_{o}\left(z\right)dz=-\frac{k{c}_{0}}{\pi iG\left({\chi }_{o}\right)}=\frac{k}{\pi iG\left({\chi }_{o}\right)}{\sum }_{m=0}^{D}{A}_{-m}{\chi }_{o}\left(m\right),\end{array}$ (3.10)
by  3.1 .
In summary, we utilize  3.6 and  3.10 in  3.5 to conclude that  $\begin{array}{c}\frac{k}{\pi iG\left({\chi }_{o}\right)}{\sum }_{m=0}^{D}{A}_{-m}{\chi }_{o}\left(m\right)=\frac{1}{\pi i}{\sum }_{1\le j (3.11)
Upon using the evaluation  1.9 for $G\left({\chi }_{o}\right)$  , we see that  3.11 is equivalent to  3.3 .

4 Two Theorems on Trigonometric Sums and Corollaries

We observe that for any integer $b$  the sine and cosine functions satisfy the following properties:
 $\begin{array}{cc}sin\left(b\pi \left(x+k\right)/k\right)& =\left(-1{\right)}^{b}sin\left(b\pi x/k\right),\end{array}$
 $\begin{array}{cc}cos\left(b\pi \left(x+k\right)/k\right)& =\left(-1{\right)}^{b}cos\left(b\pi x/k\right).\end{array}$
 $\begin{array}{}\end{array}$
Thus, we may construct odd and even functions satisfying properties (i)–(v) in Theorem  3.1 by taking appropriate products and quotients of sines and cosines. In particular, we have the following theorem.
Theorem 4.1. Let $k$  be an odd positive integer, and let ${\chi }_{e}$  be a real, even, non-principal, primitive character of period $k$  . Let $L$  , $a$  , and $J$  be non-negative integers with $a\le J+1$  . Let ${b}_{1},...,{b}_{L},{c}_{1},...,{c}_{L},{d}_{1},...,{d}_{J}$  be positive integers such that the sum $E:=-a+{\sum }_{\ell =1}^{L}\left({b}_{\ell }-{c}_{\ell }\right)+{\sum }_{j=1}^{J}{d}_{j}$  is even, and that ${d}_{1},...,{d}_{a-1}$  are odd. Suppose also that $\left({c}_{\ell },k\right)=1$  for $1\le \ell \le L$  , and $\left({c}_{i},{c}_{j}\right)=1$  for each $i\ne j$  . Define
 $\begin{array}{c}g\left({\chi }_{e}\right)={\sum }_{j=1}^{k-1}\left(-1{\right)}^{j}j{\chi }_{e}\left(j\right),\end{array}$ (4.1)
and let ${P}_{o}\left(n\right)$  (resp., ${P}_{e}\left(n\right)$  ) denote the number of solutions in the $\left(2L+J+a\right)$  -tuples $\left({\varepsilon }_{1},...,{\varepsilon }_{L},{m}_{1},...,{m}_{L},{\varepsilon }_{1}^{\prime },...,{\varepsilon }_{J}^{\prime },{m}_{1}^{\prime },...,{m}_{a}^{\prime }\right)$  to the equation
 $\begin{array}{c}n={\varepsilon }_{1}{b}_{1}+\cdots +{\varepsilon }_{L}{b}_{L}+{m}_{1}{c}_{1}+\cdots +{m}_{L}{c}_{L}+{\varepsilon }_{1}^{\prime }{d}_{1}+\cdots +{\varepsilon }_{J}^{\prime }{d}_{J}+{m}_{1}^{\prime }+\cdots +{m}_{a}^{\prime },\end{array}$ (4.2)
where $\sum {\varepsilon }_{i}+\sum {m}_{i}^{\prime }$  is odd (resp., even ), and ${\varepsilon }_{i},{\varepsilon }_{i}^{\prime }\in \left\{0,1\right\},{m}_{i},{m}_{i}^{\prime }\in \mathbb{N}\cup \left\{0\right\}$  .
Then
 $\begin{array}{cc}& {\sum }_{0
 $\begin{array}{cc}& =\sqrt{k}\left\{{2}^{a-J}{\sum }_{m=0}^{E/2}{\chi }_{e}\left(m\right)\left({P}_{e}\left(\frac{E}{2}-m\right)-{P}_{o}\left(\frac{E}{2}-m\right)\right)\end{array}$
 $\begin{array}{cc}& -i\left({\sum }_{M=1}^{L}{\sum }_{1\le n<{c}_{M}n\ne {c}_{M}/2}\frac{\left(-1{\right)}^{n}}{{c}_{M}}\frac{G\left(nk/{c}_{M},{\chi }_{e}\right){\prod }_{\ell =1}^{L}sin\left(n{b}_{\ell }\pi /{c}_{M}\right){\prod }_{j=1}^{J}cos\left(n{d}_{j}\pi /{c}_{M}\right)}{\left({e}^{2\pi ink/{c}_{M}}-1\right){cos}^{a}\left(n\pi /{c}_{M}\right){\prod }_{\ell \ne M}sin\left(n{c}_{\ell }\pi /{c}_{M}\right)}\right)\end{array}$
 $\begin{array}{cc}& -{\sum }_{1\le M\le L{c}_{M}\text{even}}\frac{\left(-1{\right)}^{{c}_{M}/2}}{{c}_{M}}\frac{\left(-1{\right)}^{a}g\left({\chi }_{e}\right){\prod }_{j=1}^{a-1}\left(-1{\right)}^{\left({d}_{j}-1\right)/2}{d}_{j}{\prod }_{\ell =1}^{L}sin\left({b}_{\ell }\pi /2\right){\prod }_{j=a}^{J}cos\left({d}_{j}\pi /2\right)}{{\prod }_{\ell \ne M}sin\left({c}_{\ell }\pi /2\right)}\right\}.\end{array}$ (4.3)
 $\begin{array}{}\end{array}$
In the preceding theorem, and throughout the rest of this section, we adopt the convention that the empty products ${\prod }_{j=1}^{0}{a}_{j}=1$  and ${\prod }_{j=1}^{-1}{a}_{j}=0$  .
• Proof. In Theorem  3.1 , let ${f}_{e}\left(z\right)$  be given by  $\begin{array}{c}{f}_{e}\left(z\right)=\left({}^{L}{\prod }_{\ell =1}\frac{sin\left({b}_{\ell }\pi z/k\right)}{sin\left({c}_{\ell }\pi z/k\right)}\right)\left(\frac{{\prod }_{j=1}^{J}cos\left({d}_{j}\pi z/k\right)}{{cos}^{a}\left(\pi z/k\right)}\right).\end{array}$ (4.4)
The function ${f}_{e}$  has possible poles at the points $nk/{c}_{\ell }$  , where $1\le n<{c}_{\ell }$  . We note that none of these values are integers, because $\left({c}_{\ell },k\right)=1$  for all $\ell$  . Since $\left({c}_{i},{c}_{j}\right)=1$  for all $i\ne j$  , these values are distinct. Thus, these are at most simple poles, with the possible exception of $k/2$  , which occurs if one of the ${c}_{\ell }$  is even. Since at least $a-1$  of the ${d}_{j}$  are odd, the point $z=k/2$  contributes a pole of order at most 1 from the cosine factors. Since the numbers of sine factors in the numerator and denominator are equal, $z=0$  is a removable singularity.
Since ${H}_{e}$  has a removable singularity at $z=0$  and a simple zero at $z=k/2$  (since $G\left(k/2,{\chi }_{e}\right)=0$  ), we conclude that ${H}_{e}{f}_{e}$  has at most simple poles at $nk/{c}_{\ell }$  for each $1\le n<{c}_{\ell },1\le \ell \le L$  . Thus, the residue at the point $nk/{c}_{M}$  , where $1\le M\le L$  and $n\ne {c}_{M}/2$  , is
 $\begin{array}{cc}{R}_{nk/{c}_{M}}\left({H}_{e}{f}_{e}\right)& ={lim}_{z\to nk/{c}_{M}}\frac{z-nk/{c}_{M}}{sin\left({c}_{M}\pi z/k\right)}\frac{G\left(z,{\chi }_{e}\right){\prod }_{\ell =1}^{L}sin\left({b}_{\ell }\pi z/k\right){\prod }_{j=1}^{J}cos\left({d}_{j}\pi z/k\right)}{G\left({\chi }_{e}\right)\left({e}^{2\pi iz}-1\right){cos}^{a}\left(\pi z/k\right){\prod }_{\ell \ne M}sin\left({c}_{\ell }\pi z/k\right)}\end{array}$
 $\begin{array}{cc}& =\frac{\left(-1{\right)}^{n}k}{{c}_{M}\pi }\frac{G\left(nk/{c}_{M},{\chi }_{e}\right){\prod }_{\ell =1}^{L}sin\left(n{b}_{\ell }\pi /{c}_{M}\right){\prod }_{j=1}^{J}cos\left(n{d}_{j}\pi /{c}_{M}\right)}{G\left({\chi }_{e}\right)\left({e}^{2\pi ink/{c}_{M}}-1\right){cos}^{a}\left(n\pi /{c}_{M}\right){\prod }_{\ell \ne M}sin\left(n{c}_{\ell }\pi /{c}_{M}\right)}.\end{array}$ (4.5)
 $\begin{array}{}\end{array}$
When $z=\left({c}_{M}/2\right)k/{c}_{M}$  , where ${c}_{M}$  is the unique even ${c}_{\ell }$  (if there is such a ${c}_{\ell }$  ), the residue is
 $\begin{array}{cc}{R}_{k/2}\left({H}_{e}{f}_{e}\right)& ={lim}_{z\to k/2}\frac{z-k/2}{sin\left({c}_{M}\pi z/k\right)}\frac{G\left(z,{\chi }_{e}\right){\prod }_{j=1}^{a-1}cos\left({d}_{j}\pi z/k\right)}{{cos}^{a}\left(\pi z/k\right)}\end{array}$
 $\begin{array}{cc}& ×\frac{{\prod }_{\ell =1}^{L}sin\left({b}_{\ell }\pi z/k\right){\prod }_{j=a}^{J}cos\left({d}_{j}\pi z/k\right)}{G\left({\chi }_{e}\right)\left({e}^{2\pi iz}-1\right){\prod }_{\ell \ne M}sin\left({c}_{\ell }\pi z/k\right)}\end{array}$
 $\begin{array}{cc}& =\frac{\left(-1{\right)}^{{c}_{M}/2}k}{{c}_{M}\pi }\frac{2\pi ig\left({\chi }_{e}\right){\prod }_{j=1}^{a-1}\left(-1{\right)}^{\left({d}_{j}-1\right)/2}{d}_{j}{\prod }_{\ell =1}^{L}sin\left({b}_{\ell }\pi /2\right){\prod }_{j=a}^{J}cos\left({d}_{j}\pi /2\right)}{\pi \left(-1{\right)}^{a}G\left({\chi }_{e}\right)\left(-2\right){\prod }_{\ell \ne M}sin\left({c}_{\ell }\pi /2\right)}.\end{array}$ (4.6)
 $\begin{array}{}\end{array}$
Lastly, we need to compute the Fourier expansion of ${f}_{e}\left(z\right)$  in the upper half-plane.
We note that, with $\mu ={e}^{2\pi iz/k}$  as in  3.8 ,
 $\begin{array}{cc}{f}_{e}\left(z\right)& =\left({}^{L}{\prod }_{\ell =1}\frac{{e}^{i{b}_{\ell }\pi z/k}-{e}^{-i{b}_{\ell }\pi z/k}}{{e}^{i{c}_{\ell }\pi z/k}-{e}^{-i{c}_{\ell }\pi z/k}}\right){2}^{a-J}\frac{{\prod }_{j=1}^{J}\left({e}^{i{d}_{j}\pi z/k}+{e}^{-i{d}_{j}\pi z/k}\right)}{\left({e}^{i\pi z/k}+{e}^{-i\pi z/k}{\right)}^{a}}\end{array}$
 $\begin{array}{cc}& ={2}^{a-J}{{\mu }^{-\left\{{\sum }_{\ell =1}^{L}\left({b}_{\ell }-{c}_{\ell }\right)-a+{\sum }_{j=1}^{J}{d}_{j}\right\}/2}}^{L}{\prod }_{\ell =1}\frac{1-{\mu }^{{b}_{\ell }}}{1-{\mu }^{{c}_{\ell }}}\frac{{\prod }_{j=1}^{J}\left(1+{\mu }^{{d}_{j}}\right)}{\left(1+\mu {\right)}^{a}}\end{array}$
 $\begin{array}{cc}& ={2}^{a-J}{{\mu }^{-E/2}}^{L}{\prod }_{\ell =1}\left(1-{\mu }^{{b}_{\ell }}{\right)}^{L}{\prod }_{\ell =1}{\left({\sum }_{m=0}^{\infty }{\mu }^{m{c}_{\ell }}\right)}^{J}{\prod }_{j=1}\left(1+{\mu }^{{d}_{j}}\right){\left({\sum }_{m=0}^{\infty }\left(-1{\right)}^{m}{\mu }^{m}\right)}^{a}.\end{array}$ (4.7)
 $\begin{array}{}\end{array}$
By  3.4 , we need to determine the coefficient ${B}_{-m}$  of ${\mu }^{-m}$  , as defined in  3.2 . Collecting powers in  4.7 , we see that  $\begin{array}{c}{B}_{-m}={2}^{a-J}\left({P}_{e}\left(\frac{E}{2}-m\right)-{P}_{o}\left(\frac{E}{2}-m\right)\right).\end{array}$ (4.8)
Using  4.5 ,  4.6 , and  4.8 in  3.4 , along with the evaluation of $G\left({\chi }_{e}\right)$  in  1.9 , we complete the proof.
Theorem 4.2. For each pair of odd positive integers $a$  and $b$  ,
 $\begin{array}{c}{\sum }_{0 (4.9)
where $F\left(a,b,\chi \right):=\frac{1}{{2}^{a-1}}{\sum }_{n,j,r\ge 02\left(n+j+br\right)=ab-1}\left(-1{\right)}^{j}\chi \left(n\right)\left(\genfrac{}{}{0}{}{a}{r}\right),$  where the sum is over all nonnegative integers $n$  , $j$  , and $r$  satisfying the condition $2\left(n+j+br\right)=ab-1$  .
• Proof. In Theorem  4.1 , let $L=0$  , $a=1$  , $J=a$  , and ${d}_{1}=\cdot \cdot \cdot ={d}_{J}=b$  . Then we find that $E=ab-1$  is even, and that the second and third sums on the right-hand side of  4.3 equal $0$  . We also find that the right-hand side of  4.2 becomes $b\left({\varepsilon }_{1}^{\prime }+\cdots +{\varepsilon }_{a}^{\prime }\right)+{m}_{1}^{\prime }$  .
Therefore, ${P}_{e}\left(\frac{ab-1}{2}-m\right)-{P}_{o}\left(\frac{ab-1}{2}-m\right)={\sum }_{{m}_{1}^{\prime },r\ge 0\left(ab-1\right)/2-m-{m}_{1}^{\prime }-br=0}\left(-1{\right)}^{r}\left(\genfrac{}{}{0}{}{a}{r}\right),$  where the sum is over all non-negative integers ${m}_{1}^{\prime },r$  satisfying the condition $\left(ab-1\right)/2-m-{m}_{1}^{\prime }-br=0$  . Rearranging the expression for the indices of summation, and summing over $m$  , we complete the proof.
We now examine some special cases of Theorem  4.2 when $b=1$  .
Corollary 4.3. If $a$  is odd and $\chi$  is even,
 $\begin{array}{c}{\sum }_{0 (4.10)
• Proof. Set $b=1$  in Theorem  4.2 .
If $a=1$  , then trivially $F\left(1,1,\chi \right)=0$  , and so Corollary  4.3 reduces to
 $\begin{array}{c}{\sum }_{0 (4.11)
which is easy to establish directly.
If $a=3$  , observe that $F\left(3,1,\chi \right)=\frac{1}{4}$  . Thus, from Corollary  4.3 ,
 $\begin{array}{c}{\sum }_{0 (4.12)
The evaluation  4.12 is also elementary, because if one applies the double angle formula for $cos\left(2\pi n/k\right)$  on the left side of  4.12 and uses both  2.24 and  4.11 ,  4.12 easily follows.
If $k=5$  in  4.12 , we deduce that ${cos}^{2}\left(\pi /5\right)-{cos}^{2}\left(2\pi /5\right)=\frac{1}{4}\sqrt{5},$  which of course is an easy consequence of  2.26 .
If $a=5$  , Corollary  4.3 reduces to
 $\begin{array}{c}{\sum }_{0 (4.13)
Using the double angle for cosine twice, along with  2.24 ,  4.11 , and  4.12 , we can verify  4.13 directly.
Corollary 4.4. Let $a$  , $d$  , and $J$  be nonnegative integers such that $a\le J+1$  and $E:=dJ-a+12$  is even. Then
 $\begin{array}{cc}& {\sum }_{0
 $\begin{array}{cc}& =\frac{k}{{2}^{J-a}G\left({\chi }_{e}\right)}{\sum }_{m=0}^{E/2}{\chi }_{e}\left(m\right){\sum }_{E/2-m-3{\varepsilon }_{1}-5{\varepsilon }_{2}-7{\varepsilon }_{3}-dj>0{\varepsilon }_{i}\in \left\{0,1\right\},0\le j\le J}\left(-1{\right)}^{j+{\varepsilon }_{1}+{\varepsilon }_{2}+{\varepsilon }_{3}}\end{array}$
 $\begin{array}{cc}& ×\left(\genfrac{}{}{0}{}{E/2-m-3{\varepsilon }_{1}-5{\varepsilon }_{2}-7{\varepsilon }_{3}-dj+3+a}{3+a}\right).\end{array}$ (4.14)
 $\begin{array}{}\end{array}$
• Proof. Put $L=3$  and set ${c}_{\ell }=1$  , $1\le \ell \le 3$  . Thus, the second and third sums on the right-hand side of  4.3 equal $0$  . By moving the terms involving ${\varepsilon }_{i}$  and ${\varepsilon }_{i}^{\prime }$  to the left-hand side of  4.2 , we find that the number of representations in $\left({m}_{1},{m}_{2},{m}_{3},{m}_{1}^{\prime },...,{m}_{a}^{\prime }\right)$  of $E/2-m-\sum {\varepsilon }_{i}{b}_{i}-\sum {\varepsilon }_{i}^{\prime }{d}_{i}={m}_{1}+{m}_{2}+{m}_{3}+{m}_{1}^{\prime }+...+{m}_{a}^{\prime }$  is equal to $\left(\genfrac{}{}{0}{}{E/2-m-\sum {\varepsilon }_{i}{b}_{i}-\sum {\varepsilon }_{i}^{\prime }{d}_{i}+3+a}{3+a}\right).$  The desired result now follows.
The next result is an analogue of Theorem 7.1 in [3. Technically, this theorem follows from Theorem  4.1 , but it is perhaps easier to derive the result from Theorem  3.1 .
Theorem 4.5. Let $\chi$  be even, and suppose that $b$  is an even positive integer. Then
 $\begin{array}{c}{S}_{3}\left(b,\chi \right):={\sum }_{0 (4.15)
where
 $\begin{array}{c}H\left(b,\chi \right):=\frac{1}{2}\chi \left(\frac{b}{2}\right)+{\sum }_{n,j\ge 12n+2j=b}\chi \left(n\right).\end{array}$ (4.16)
• Proof. We let ${f}_{e}\left(z\right)=sin\left(b\pi z/k\right)cot\left(\pi z/k\right)$  and ${\chi }_{e}=\chi$  in Theorem  3.1 . Observe that $f\left(z\right)$  has no poles at non-integer points. To compute its Fourier expansion, note that
 $\begin{array}{cc}sin\left(b\pi z/k\right)& =-\frac{1}{2i}{\mu }^{-b/2}\left(1-{\mu }^{b}\right)\end{array}$ (4.17)
 $\begin{array}{cc}\text{and}cot\left(\pi z/k\right)& =-i\left(1+2{\sum }_{j=1}^{\infty }{\mu }^{j}\right).\end{array}$ (4.18)
 $\begin{array}{}\end{array}$
Thus,
 $\begin{array}{cc}{f}_{e}\left(z\right)& =\frac{1}{2}{\mu }^{-b/2}\left(1-{\mu }^{b}\right)+{\mu }^{-b/2}\left(1-{\mu }^{b}\right){\sum }_{j=1}^{\infty }{\mu }^{j}\end{array}$
 $\begin{array}{cc}& =\frac{{\mu }^{-b/2}-{\mu }^{b/2}}{2}+{\mu }^{-b/2}{\sum }_{j=1}^{b-1}{\mu }^{j}.\end{array}$ (4.19)
 $\begin{array}{}\end{array}$
Therefore the coefficient ${B}_{-m}$  of ${\mu }^{-m}$  when $m\ge 0$  is  $\begin{array}{c}{B}_{-m}=\left\{\begin{array}{cc}1/2,& \text{if}m=b/2\text{},\\ 1,& \text{otherwise}.\end{array}\end{array}$ (4.20)
Using  4.20 in  3.4 , we obtain  4.15 , and the proof of Theorem  4.5 is complete.
Corollary 4.6. For even $\chi$  ,
 $\begin{array}{c}{\sum }_{0 (4.21)
• Proof. Set $b=2$  and use the identity $sin\left(2\theta \right)=2sin\theta cos\theta$  in  4.15 . Then note that $H\left(2,\chi \right)=\frac{1}{2}$  .
The identity  4.21 is identical to  4.12 .
We now derive an analogue of Theorem  4.1 for odd characters.
Theorem 4.7. Let $k$  be an odd positive integer, and let ${\chi }_{o}$  be a real, odd, non-principal, primitive character of period $k$  . Let $L$  , $a$  , and $J$  be non-negative integers with $a\le J+1$  . Let ${b}_{1},...,{b}_{L},{c}_{1},...,{c}_{L},{d}_{1},...,{d}_{J}$  denote positive integers such that the sum ${E}^{\prime }:=-1-a+{\sum }_{\ell =1}^{L}\left({b}_{\ell }-{c}_{\ell }\right)+{\sum }_{j=1}^{J}{d}_{j}$  is even and such that ${d}_{1},...,{d}_{a-1}$  are odd. Suppose also that $\left({c}_{\ell },k\right)=1$  for $1\le \ell \le L$  and that $\left({c}_{i},{c}_{j}\right)=1$  for $i\ne j$  . Let ${P}_{o}^{\prime }\left(n\right)$  (resp., ${P}_{e}^{\prime }\left(n\right)$  ) denote the number of solutions in the $\left(2L+J+a+1\right)$  -tuples $\left({\varepsilon }_{1},...,{\varepsilon }_{L},{m}_{0},{m}_{1},...,{m}_{L},{\varepsilon }_{1}^{\prime },...,{\varepsilon }_{J}^{\prime },{m}_{1}^{\prime },...,{m}_{a}^{\prime }\right)$  to the equation
 $\begin{array}{c}n={\varepsilon }_{1}{b}_{1}+\cdots +{\varepsilon }_{L}{b}_{L}+{m}_{0}+{m}_{1}{c}_{1}+\cdots +{m}_{L}{c}_{L}+{\varepsilon }_{1}^{\prime }{d}_{1}+\cdots +{\varepsilon }_{J}^{\prime }{d}_{J}+{m}_{1}^{\prime }+\cdots +{m}_{a}^{\prime },\end{array}$ (4.22)
where $\sum {\varepsilon }_{i}+\sum {m}_{i}^{\prime }$  is odd (resp., even ), ${\varepsilon }_{i},{\varepsilon }_{i}^{\prime }\in \left\{0,1\right\}$  , and ${m}_{i},{m}_{i}^{\prime }\in \mathbb{N}\cup \left\{0\right\}$  .
Then
 $\begin{array}{cc}& {\sum }_{0
 $\begin{array}{cc}& =\sqrt{k}\left\{{2}^{1+a-J}{\sum }_{m=0}^{{E}^{\prime }/2}{\chi }_{o}\left(m\right)\left({P}_{e}^{\prime }\left(\frac{{E}^{\prime }}{2}-m\right)-{P}_{o}^{\prime }\left(\frac{{E}^{\prime }}{2}-m\right)\right)\end{array}$
 $\begin{array}{cc}& -{\sum }_{M=1}^{L}{\sum }_{1\le n<{c}_{M}}\frac{\left(-1{\right)}^{n}}{{c}_{M}}\frac{G\left(nk/{c}_{M},{\chi }_{o}\right){\prod }_{\ell =1}^{L}sin\left(n{b}_{\ell }\pi /{c}_{M}\right){\prod }_{j=1}^{J}cos\left(n{d}_{j}\pi /{c}_{M}\right)}{\left({e}^{2\pi ink/{c}_{M}}-1\right)sin\left(n\pi /{c}_{M}\right){cos}^{a}\left(n\pi /{c}_{M}\right){\prod }_{\ell \ne M}sin\left(n{c}_{\ell }\pi /{c}_{M}\right)}\end{array}$
 $\begin{array}{cc}& +\frac{G\left(k/2,{\chi }_{o}\right){\prod }_{j=1}^{a-1}\left(-1{\right)}^{\left({d}_{j}-1\right)/2}{d}_{j}{\prod }_{\ell =1}^{L}sin\left({b}_{\ell }\pi /2\right){\prod }_{j=a}^{J}cos\left({d}_{j}\pi /2\right)}{2{\prod }_{\ell =1}^{L}sin\left({c}_{\ell }\pi /2\right)}\end{array}$
 $\begin{array}{cc}& -{\frac{{\sum }_{j=1}^{k-1}j{\chi }_{o}\left(j\right)}{k}}^{L}{\prod }_{\ell =1}\frac{{b}_{\ell }}{{c}_{\ell }}\right\}.\end{array}$ (4.23)
 $\begin{array}{}\end{array}$
• Proof. The proof is analogous to that of Theorem  4.1 . We highlight the main differences.
We let ${f}_{o}\left(z\right)$  in Theorem  3.1 be given by  $\begin{array}{c}{f}_{o}\left(z\right)=\frac{1}{sin\left(\pi z/k\right)}\left({}^{L}{\prod }_{\ell =1}\frac{sin\left({b}_{\ell }\pi z/k\right)}{sin\left({c}_{\ell }\pi z/k\right)}\right)\left(\frac{{\prod }_{j=1}^{J}cos\left({d}_{j}\pi z/k\right)}{{cos}^{a}\left(\pi z/k\right)}\right).\end{array}$ (4.24)
We now need to determine the poles of the function ${H}_{o}{f}_{o}$  . Note that again we have poles at each of the points $nk/{c}_{\ell }$  , $1\le n<{c}_{\ell }$  , $1\le \ell \le L$  . There is also (at most) a simple pole at $k/2$  . Note that for odd characters $G\left(k/2,{\chi }_{o}\right)\ne 0$  , but there is a possible pole at $k/2$  arising from an even ${c}_{\ell }$  . Finally, there exists a pole at $z=0$  arising from the extra sine factor in the denominator.
For $1\le M\le L$  , $1\le n<{c}_{M}$  ,
 $\begin{array}{cc}& {R}_{nk/{c}_{M}}\left({H}_{o}{f}_{o}\right)\end{array}$
 $\begin{array}{cc}& ={lim}_{z\to nk/{c}_{M}}\frac{z-nk/{c}_{M}}{sin\left({c}_{M}\pi z/k\right)}\frac{G\left(z,{\chi }_{o}\right){\prod }_{\ell =1}^{L}sin\left({b}_{\ell }\pi z/k\right){\prod }_{j=1}^{J}cos\left({d}_{j}\pi z/k\right)}{G\left({\chi }_{o}\right)\left({e}^{2\pi iz}-1\right)sin\left(\pi z/k\right){cos}^{a}\left(\pi z/k\right){\prod }_{\ell \ne M}sin\left({c}_{\ell }\pi z/k\right)}\end{array}$
 $\begin{array}{cc}& =\frac{\left(-1{\right)}^{n}k}{{c}_{M}\pi }\frac{G\left(nk/{c}_{M},{\chi }_{o}\right){\prod }_{\ell =1}^{L}sin\left(n{b}_{\ell }\pi /{c}_{M}\right){\prod }_{j=1}^{J}cos\left(n{d}_{j}\pi /{c}_{M}\right)}{G\left({\chi }_{o}\right)\left({e}^{2\pi ink/{c}_{M}}-1\right)sin\left(n\pi /{c}_{M}\right){cos}^{a}\left(n\pi /{c}_{M}\right){\prod }_{\ell \ne M}sin\left(n{c}_{\ell }\pi /{c}_{M}\right)}.\end{array}$ (4.25)
 $\begin{array}{}\end{array}$
Next,
 $\begin{array}{cc}& {R}_{k/2}\left({H}_{o}{f}_{o}\right)\end{array}$
 $\begin{array}{cc}& ={lim}_{z\to k/2}\frac{\left(z-k/2\right){\prod }_{j=1}^{a-1}cos\left({d}_{j}\pi z/k\right)}{{cos}^{a}\left(\pi z/k\right)}\frac{G\left(z,{\chi }_{o}\right){\prod }_{\ell =1}^{L}sin\left({b}_{\ell }\pi z/k\right){\prod }_{j=a}^{J}cos\left({d}_{j}\pi z/k\right)}{G\left({\chi }_{o}\right)\left({e}^{2\pi iz}-1\right)sin\left(\pi z/k\right){\prod }_{\ell =1}^{L}sin\left({c}_{\ell }\pi z/k\right)}\end{array}$
 $\begin{array}{cc}& =\frac{k{\prod }_{j=1}^{a-1}\left(-1{\right)}^{\left({d}_{j}-1\right)/2}{d}_{j}}{\pi }\frac{G\left(k/2,{\chi }_{o}\right){\prod }_{\ell =1}^{L}sin\left({b}_{\ell }\pi /2\right){\prod }_{j=a}^{J}cos\left({d}_{j}\pi /2\right)}{G\left({\chi }_{o}\right)\left(-2\right){\prod }_{\ell =1}^{L}sin\left({c}_{\ell }\pi /2\right)}.\end{array}$ (4.26)
 $\begin{array}{}\end{array}$
Finally,
 $\begin{array}{cc}{R}_{0}\left({H}_{o}{f}_{o}\right)& ={lim}_{z\to 0}\frac{z}{sin\left(\pi z/k\right)}\frac{G\left(z,{\chi }_{o}\right)}{G\left({\chi }_{o}\right)\left({e}^{2\pi iz}-1\right)}\left({}^{L}{\prod }_{\ell =1}\frac{sin\left({b}_{\ell }\pi z/k\right)}{sin\left({c}_{\ell }\pi z/k\right)}\right)\frac{{\prod }_{j=1}^{J}cos\left({d}_{j}\pi z/k\right)}{{cos}^{a}\left(\pi z/k\right)}\end{array}$
 $\begin{array}{cc}& =\frac{k}{\pi }{\frac{{\sum }_{j=1}^{k-1}j{\chi }_{o}\left(j\right)}{kG\left({\chi }_{o}\right)}}^{L}{\prod }_{\ell =1}\frac{{b}_{\ell }}{{c}_{\ell }}.\end{array}$ (4.27)
 $\begin{array}{}\end{array}$
Lastly, we determine the Fourier expansion of ${f}_{o}\left(z\right)$  . We readily find that, again with $\mu ={e}^{2\pi iz/k}$  as in  3.8 ,
 $\begin{array}{cc}{f}_{o}\left(z\right)& =\frac{2i}{{e}^{i\pi z/k}-{e}^{-i\pi z/k}}\left({}^{L}{\prod }_{\ell =1}\frac{{e}^{i{b}_{\ell }\pi z/k}-{e}^{-i{b}_{\ell }\pi z/k}}{{e}^{i{c}_{\ell }\pi z/k}-{e}^{-i{c}_{\ell }\pi z/k}}\right){2}^{a-J}\frac{{\prod }_{j=1}^{J}\left({e}^{i{d}_{j}\pi z/k}+{e}^{-i{d}_{j}\pi z/k}\right)}{\left({e}^{i\pi z/k}+{e}^{-i\pi z/k}{\right)}^{a}}\end{array}$
 $\begin{array}{cc}& ={2}^{1+a-J}i{\mu }^{-\left\{-1+{\sum }_{\ell =1}^{L}\left({b}_{\ell }-{c}_{\ell }\right)-a+{\sum }_{j=1}^{J}{d}_{j}\right\}/2}{\frac{1}{1-\mu }}^{L}{\prod }_{\ell =1}\frac{1-{\mu }^{{b}_{\ell }}}{1-{\mu }^{{c}_{\ell }}}\frac{{\prod }_{j=1}^{J}\left(1+{\mu }^{{d}_{j}}\right)}{\left(1+\mu {\right)}^{a}}\end{array}$
 $\begin{array}{cc}& ={2}^{1+a-J}i{\mu }^{-{E}^{\prime }/2}{\left({\sum }_{m=1}^{\infty }{\mu }^{m}\right)}^{L}{\prod }_{\ell =1}\left(1-{\mu }^{{b}_{\ell }}{\right)}^{L}{\prod }_{\ell =1}\left({\sum }_{m=0}^{\infty }{\mu }^{m{c}_{\ell }}\right)\end{array}$
 $\begin{array}{cc}& {×}^{J}{\prod }_{j=1}\left(1+{\mu }^{{d}_{j}}\right){\left({\sum }_{m=0}^{\infty }\left(-1{\right)}^{m}{\mu }^{m}\right)}^{a}.\end{array}$ (4.28)
 $\begin{array}{}\end{array}$
Collecting powers, we find that the coefficient ${A}_{-m}$  of ${\mu }^{-m}$  , as defined in  3.1 , is equal to ${P}_{e}^{\prime }\left(\frac{{E}^{\prime }}{2}-m\right)-{P}_{o}^{\prime }\left(\frac{{E}^{\prime }}{2}-m\right)$  .
If we integrate ${F}_{e}\left(z\right)$  over the contour ${C}_{N}$  , apply the residue theorem, and calculate directly the integral of ${F}_{e}\left(z\right)$  over ${C}_{N}$  , using the calculation of the preceding paragraph for the horizontal sides, we complete the proof in the same manner as we did for Theorem  4.1 .
Theorem 4.8. If $b$  and $d$  are odd positive integers,
 $\begin{array}{cc}{S}_{4}\left(b,d\right)& :=4{\sum }_{0
 $\begin{array}{cc}& =\sqrt{k}\left(4I\left(b,d,{\chi }_{o}\right)-\frac{\left(-1{\right)}^{\left(b+d\right)/2}}{2}G\left(k/2,{\chi }_{o}\right)\right)-\frac{b}{\sqrt{k}}{\sum }_{j=1}^{k-1}j{\chi }_{o}\left(j\right),\end{array}$ (4.29)
 $\begin{array}{}\end{array}$
where
 $\begin{array}{cc}I\left(b,d,{\chi }_{o}\right)& :={\sum }_{m,r\ge 0}{\chi }_{o}\left(m\right)\left\{\left(-1{\right)}^{r}\left(r+1\right)\left(\left(\genfrac{}{}{0}{}{\left(b+d\right)/2-m-r}{2}\right)+\left(\genfrac{}{}{0}{}{\left(b-d\right)/2-m-r}{2}\right)\right).\end{array}$
 $\begin{array}{cc}& +\left(-1{\right)}^{r+1}\left(r+1\right)\left(\genfrac{}{}{0}{}{\left(d-b\right)/2-m-r}{2}\right)\right\}.\end{array}$ (4.30)
 $\begin{array}{}\end{array}$
• Proof. Let $L=J=1$  , ${b}_{1}=b$  , ${d}_{1}=d$  , ${c}_{1}=1$  , and $a=2$  in Theorem  4.7 . Then, upon the use of the identity $sin\left(2\theta \right)=2sin\theta cos\theta$  , we find that the left-hand side of  4.23 is equal to ${S}_{4}\left(b,d\right)$  . We also find that ${E}^{\prime }=-1-2+\left(b-1\right)+d=b+d-4$  is even. We compute the right-hand side of  4.23 . With our choice of parameters, the right-hand side of  4.22 becomes  $\begin{array}{c}b{\varepsilon }_{1}+{m}_{0}+{m}_{1}+d{\varepsilon }_{1}^{\prime }+{m}_{1}^{\prime }+{m}_{2}^{\prime }.\end{array}$ (4.31)
We let $r={m}_{1}^{\prime }+{m}_{2}^{\prime }$  and observe that for each fixed $r\ge 0$  , we obtain exactly $r+1$  ordered pairs of nonnegative integers $\left({m}_{1}^{\prime },{m}_{2}^{\prime }\right)$  . Therefore, for each fixed $m$  ,
 $\begin{array}{cc}& {P}_{e}^{\prime }\left(\frac{1}{2}{E}^{\prime }-m\right)-{P}_{o}^{\prime }\left(\frac{1}{2}{E}^{\prime }-m\right)\end{array}$
 $\begin{array}{cc}& ={\sum }_{r\ge 0}\left(-1{\right)}^{r}\left(r+1\right)\left(\left(\genfrac{}{}{0}{}{\left(b+d-4\right)/2-m-r+2}{2}\right)+\left(\genfrac{}{}{0}{}{\left(b-d-4\right)/2-m-r+2}{2}\right)\right)\end{array}$
 $\begin{array}{cc}& +\left(-1{\right)}^{r+1}\left(r+1\right)\left(\genfrac{}{}{0}{}{\left(d-b-4\right)/2-m-r+2}{2}\right).\end{array}$ (4.32)
 $\begin{array}{}\end{array}$
Note that the second sum on the right hand side of  4.23 is empty, and thus is equal to zero. Using  4.32 in  4.23 and simplifying the remaining sums with our choice of parameters, we conclude the proof.
Corollary 4.9. If $b$  is a positive odd integer,
 $\begin{array}{cc}2{\sum }_{0
 $\begin{array}{cc}& -\frac{\sqrt{k}\left(-1{\right)}^{b}}{2}G\left(k/2,{\chi }_{o}\right)-\frac{b}{\sqrt{k}}{\sum }_{j=1}^{k-1}j{\chi }_{o}\left(j\right).\end{array}$ (4.33)
 $\begin{array}{}\end{array}$
• Proof. Let $b=d$  in Theorem  4.8 .
Theorem 4.10. If $a$  , $b$  , and $d$  are integers with $a\ge 0$  , $b\ge 0$  and even, and $d$  odd, then
 $\begin{array}{cc}& {S}_{5}\left(a,b,d\right):=2{\sum }_{0
 $\begin{array}{cc}& =\left\{\begin{array}{cc}\sqrt{k}\left({2}^{2-b}J\left(a,b,d,{\chi }_{o}\right)-\frac{1}{k}{\sum }_{j=1}^{k-1}j{\chi }_{o}\left(j\right)\right),& \text{if}b>0\text{,}\\ \sqrt{k}\left(4J\left(a,0,d,{\chi }_{o}\right)+\frac{\left(-1{\right)}^{a\left(d-1\right)/2}}{2}{d}^{a}G\left(k/2,{\chi }_{o}\right)-\frac{1}{k}{\sum }_{j=1}^{k-1}j{\chi }_{o}\left(j\right)\right),& \text{if}b=0\text{,}\end{array}\end{array}$ (4.34)
 $\begin{array}{}\end{array}$
where
 $\begin{array}{c}J\left(a,b,d,{\chi }_{o}\right):={\sum }_{m,r,{m}_{0},n\ge 02dn+a+2+2m+2r+2{m}_{0}=d\left(a+b\right)}{\chi }_{o}\left(m\right)\left(-1{\right)}^{r}\left(\genfrac{}{}{0}{}{a+r+1}{a+1}\right)\left(\genfrac{}{}{0}{}{a+b}{n}\right).\end{array}$ (4.35)
• Proof. In Theorem  4.7 , replace $a$  by $a+1$  and let $L=0$  , $J=a+b$  , and ${d}_{1}=\cdot \cdot \cdot ={d}_{J}=d.$  Then upon applying the identity $sin\left(2\theta \right)=2sin\theta cos\theta$  , we find that the left hand side of  4.23 is equal to ${S}_{5}\left(a,b\right)$  . Note that ${E}^{\prime }=-1-\left(a+1\right)+d\left(a+b\right)=a\left(d-1\right)+db-2$  is even. The right hand side of  4.22 is  $\begin{array}{c}{m}_{0}+d\left({\varepsilon }_{1}^{\prime }+\cdots +{\varepsilon }_{a+b}^{\prime }\right)+{m}_{1}^{\prime }+\cdots +{m}_{a+1}^{\prime }.\end{array}$ (4.36)
Therefore, it is easy to see that if we let $r={m}_{1}^{\prime }+\cdots +{m}_{a+1}^{\prime }$  , for each fixed $m\ge 0$  ,
 $\begin{array}{cc}& {P}_{e}^{\prime }\left(\frac{ad+bd-a}{2}-1-m\right)-{P}_{o}^{\prime }\left(\frac{ad+bd-a}{2}-1-m\right)\end{array}$
 $\begin{array}{cc}& ={\sum }_{r\ge 0}\left(-1{\right)}^{r}\left(\genfrac{}{}{0}{}{a+r+1}{a+1}\right){\sum }_{{m}_{0}\ge 0}\left(\genfrac{}{}{0}{}{a+b}{\left(\left(ad+bd-a\right)/2-1-m-r-{m}_{0}\right)/d}\right)\end{array}$
 $\begin{array}{cc}& ={\sum }_{r,{m}_{0},n\ge 02dn+a+2+2m+2r+2{m}_{0}=d\left(a+b\right)}\left(-1{\right)}^{r}\left(\genfrac{}{}{0}{}{a+r+1}{a+1}\right)\left(\genfrac{}{}{0}{}{a+b}{n}\right).\end{array}$ (4.37)
 $\begin{array}{}\end{array}$
Using  4.37 and evaluating the remaining terms on the right hand side of  4.23 , we easily complete the proof.
Corollary 4.11. If $a\ge 1$  is even, and if $b\ge 0$  is odd, then
 $\begin{array}{cc}& 2{\sum }_{0
 $\begin{array}{cc}& =\sqrt{k}\left({2}^{2-a}{\sum }_{m,r,{m}_{0},n\ge 02\left(bn+m+r+{m}_{0}\right)=ab}{\chi }_{o}\left(m\right)\left(-1{\right)}^{r}\left(r+1\right)\left(\genfrac{}{}{0}{}{a}{n}\right)-\frac{1}{k}{\sum }_{j=1}^{k-1}j{\chi }_{o}\left(j\right)\right).\end{array}$ (4.38)
 $\begin{array}{}\end{array}$
• Proof. Let $a=0,b=a,$  and $d=b$  in Theorem  4.10 .
We note that Corollary  4.11 is analogous to Theorem 5.5 of [3. The main difference is that the parameter $b$  in Corollary  4.11 above is odd, whereas the corresponding parameter in Theorem 5.5 of [3is even.

5 Evaluations of Trigonometric Sums Not Involving Characters

Theorem 5.1. Suppose that $a$  , $b$  , and $k$  are positive integers, where $b>1$  and $k$  is odd. Then
 $\begin{array}{c}{\sum }_{0 (5.1)
where
 $\begin{array}{c}S\left(a,b\right):=2{\sum }_{m,n,r\ge 02bn+2m+rk=ab-a}\left(-1{\right)}^{n}\left(\genfrac{}{}{0}{}{a}{n}\right)\left(\genfrac{}{}{0}{}{a-1+m}{m}\right),\end{array}$ (5.2)
where in the case $r=0$  , the terms are to be multiplied by $\frac{1}{2}$  .
Theorem  5.1 includes four identities found by Liu [7, namely, the special cases $\left(a,b,k\right)=\left(1,2,7\right),$  $\left(1,3,7\right)$  , $\left(7,2,7\right)$  , and $\left(7,3,7\right)$  .
• Proof. Let  $\begin{array}{c}f\left(z\right):=\frac{{sin}^{a}\left(2\pi bz/k\right)}{{sin}^{a}\left(2\pi z/k\right)}cot\pi z,\end{array}$ (5.3)
and integrate over the same contour ${C}_{N}$  described at the beginning of the proof of Theorem  2.1 . Observe that $f\left(z\right)$  has simple poles at $z=0,1,2,...,k-1$  . A simple calculation shows that  $\begin{array}{c}{R}_{0}=\frac{{b}^{a}}{\pi }.\end{array}$ (5.4)
For $0  , we easily find that  $\begin{array}{c}{R}_{n}=\frac{{sin}^{a}\left(2\pi bn/k\right)}{\pi {sin}^{a}\left(2\pi n/k\right)}={R}_{k-n}.\end{array}$ (5.5)
Hence, by the residue theorem,  5.4 , and  5.5 ,  $\begin{array}{c}{\int }_{{C}_{N}}f\left(z\right)dz=2i{b}^{a}+4i{\sum }_{0 (5.6)
Next we calculate the integral above directly. From the periodicity of $f\left(z\right)$  , we see that the integrals along the vertical sides of ${C}_{N}$  cancel. To compute the integrals on the horizontal pieces, let $\mu ={e}^{2\pi iz/k}$  . Then
 $\begin{array}{cc}{sin}^{a}\left(2\pi bz/k\right)& ={\left(\frac{i}{2}\right)}^{a}{\mu }^{-ab}{\sum }_{n=0}^{a}\left(-1{\right)}^{n}\left(\genfrac{}{}{0}{}{a}{n}\right){\mu }^{2bn},\end{array}$
 $\begin{array}{cc}{sin}^{-a}\left(2\pi z/k\right)& ={\left(\frac{i}{2}\right)}^{-a}{\mu }^{a}{\sum }_{m=0}^{\infty }\left(\genfrac{}{}{0}{}{a-1+m}{m}\right){\mu }^{2m},\end{array}$
 $\begin{array}{cc}cot\pi z& =i\frac{{\mu }^{k}+1}{{\mu }^{k}-1}=-i\left(1+2{\sum }_{j=1}^{\infty }{\mu }^{kj}\right).\end{array}$
 $\begin{array}{}\end{array}$
Hence,  $\begin{array}{c}f\left(z\right)=-i{\mu }^{-ab+a}\left({\sum }_{n=0}^{a}\left(-1{\right)}^{n}\left(\genfrac{}{}{0}{}{a}{n}\right){\mu }^{2bn}\right)\left({\sum }_{m=0}^{\infty }\left(\genfrac{}{}{0}{}{a-1+m}{m}\right){\mu }^{2m}\right)\left(1+2{\sum }_{r=1}^{\infty }{\mu }^{kr}\right).\end{array}$ (5.7)
As in the proofs in the preceding section, we need to determine the constant term, say ${C}_{1}$  , in the expansion  5.7 . With some care, we see that  $\begin{array}{c}{C}_{1}=-iS\left(a,b\right),\end{array}$ (5.8)
where $S\left(a,b\right)$  is defined by  5.2 . Hence, letting $N$  tend to $\infty$  , we deduce that  $\begin{array}{c}{lim}_{N\to \infty }{\int }_{{C}_{NT}}f\left(z\right)dz=-{\int }_{0}^{k}{C}_{1}=ikS\left(a,b\right).\end{array}$ (5.9)
By an analogous argument, we also find that  $\begin{array}{c}{lim}_{N\to \infty }{\int }_{{C}_{NB}}f\left(z\right)dz=ikS\left(a,b\right).\end{array}$ (5.10)
Finally, combining  5.6 ,  5.9 , and  5.10 , we conclude that $2i{b}^{a}+4i{\sum }_{0  which is equivalent to  5.1
By a similar argument, we can also prove the following theorem.
Theorem 5.2. Suppose that $a$  , $b$  , and $k$  are positive integers, where $b>1$  and $k$  is odd. Then
 $\begin{array}{c}{\sum }_{0 (5.11)
where
 $\begin{array}{c}T\left(a,b\right):=2{\sum }_{m,n,r\ge 02bn+2m+rk=ab-a}\left(\genfrac{}{}{0}{}{a}{n}\right)\left(\genfrac{}{}{0}{}{a-1+m}{m}\right),\end{array}$ (5.12)
where in the case $r=0$  , the terms are to be multiplied by $\frac{1}{2}$  .
References

1. T. M. Apostol, Euler's $\phi$  -function and separable Gauss sums, Proc. Amer. Math. Soc. 24 (1970), 482–485.
2. B. C. Berndt, R. J. Evans, and K. S. Williams, Gauss and Jacobi Sums, Wiley, New York, 1998.
3. B. C. Berndt and A. Zaharescu, Finite trigonometric sums and class numbers, Math. Ann. 330 (2004), 551–575.
4. B. C. Berndt and L.–C. Zhang, Ramanujan's identities for eta-functions, Math. Ann. 292 (1992), 561–573.
5. Z. I. Borevich and I. R. Shafarevich, Number Theory, Academic Press, New York, 1966.
6. H. Davenport, Multiplicative Number Theory, 3rd ed., Springer–Verlag, New York, 2000.
7. Z.–G. Liu, Some Eisenstein series identities related to modular equations of the seventh order, Pacific J. Math. 209 (2003), 103–130.
8. S. Ramanujan, Notebooks (2 volumes), Tata Institute of Fundamental Research, Bombay, 1957.

Department of Mathematics, San Francisco State University, 1600 Holloway Ave, San Francisco, CA 94132 Department of Mathematics, University of Illinois, 1409 West Green Street, Urbana, IL 61801, USA E-mail address : beck@math.sfsu.edu E-mail address : berndt@math.uiuc.edu E-mail address : ochan@math.uiuc.edu E-mail address : zaharesc@math.uiuc.edu

1 Research partially supported by grant MDA904-00-1-0015 from the National Security Agency.

2 Research partially supported by the Korea Institute for Advanced Study.

3 Research partially supported by a grant from the University of Illinois Research Board.