# Elliptic formulation of sum with cosine and hyperbolic cosine

Can anyone check my reformulation below?$$\sum_{k\in \mathbb{Z}}\frac{1}{\cosh{(k+z)\pi}+\cos{(k+z)\pi}}=\frac 2\pi \csc{\pi z}D_z\left[\tan^{-1}\left(\frac{\theta(z/2,2)}{\vartheta(z/2,2)}\right)\right]$$where$$\vartheta(z,q)=\sum_{k \in\mathbb{Z}}e^{-\pi q (k+z)^2} \text{ and } \theta(z,q)=\sum_{k \in \mathbb{Z}}e^{-\pi q (k+z+1/2)^2}$$This sum came up when I rewrote the integral discussed here as a sum of integrals over $[0,1]$.

It would be interesting if the sum equaled an integral of an elliptic function divided by a sine (essentially an elliptic analog of the sine integral)

Here are my calculations:

I started by expanding the similar sum $$\sum_{k\in \mathbb{Z}}\frac{\sin^2{(k+z)\pi}}{\cosh{(k+z)\pi}+\cos{(k+z)\pi}}$$ into$$-i\sum_{k\in\mathbb{Z}}\sin{(k+z)\pi}\left(\frac1{e^{(1+i)(k+z)\pi}+1}-\frac1{e^{(1-i)(k+z)\pi}+1}\right)$$$\big($thanks to the identity $\frac{\sin{\pi x}}{\cosh{\pi x}+\cos{\pi x}}=-i\left(\frac1{e^{(1+i)\pi x}+1}-\frac1{e^{(1-i)\pi x}+1}\right)$ $\big)$, then used $\sin{(k+z)\pi}=(-1)^k\sin{\pi z}$ and $\sum_{k\in\mathbb{Z}}(-1)^ka_k=\sum_{k\in\mathbb{Z}}(2a_{2k}-a_k)$ to make the sum \begin{multline} -i\sin{\pi z}\cdot\sum_{k\in\mathbb{Z}}\left(\frac2{e^{(1+i)(2k+z)\pi}+1}\\-\frac2{e^{(1-i)(2k+z)\pi}+1} -\frac1{e^{(1+i)(k+z)\pi}+1}+\frac1{e^{(1-i)(k+z)\pi}+1}\right) \end{multline} Now I isolate the sum's zeroth and positive-indexed terms, and use $\frac1{e^{(1-i)(-k+z)\pi}+1}-\frac1{e^{(1+i)(-k+z)\pi}+1}=1-\frac1{e^{(1-i)(k-z)\pi}+1}-1+\frac1{e^{(1+i)(k-z)\pi}+1}$ to make the negative-indexed terms converge, and so I have\begin{align}\sum_{k\in\mathbb{Z}}\frac{\sin^2{(k+z)\pi}}{\cosh{(k+z)\pi}+\cos{(k+z)\pi}}&=-i\sin{\pi z}\left(\frac2{e^{(1+i)\pi z}+1}-\frac2{e^{(1-i)\pi z}+1}-\frac1{e^{(1+i)\pi z}+1}+\frac1{e^{(1-i)\pi z}+1}\right)\\ &\quad-i\sin{\pi z}\sum_{k\ge 1}\Bigg[\begin{aligned}[t]&\frac2{e^{(1+i)(2k+z)\pi}+1}-\frac2{e^{(1-i)(2k+z)\pi}+1}\\ &-\frac1{e^{(1+i)(k+z)\pi}+1}+\frac1{e^{(1-i)(k+z)\pi}+1}-\frac2{e^{(1+i)(2k-z)\pi}+1}\\ &+\frac2{e^{(1-i)(2k-z)\pi}+1}+\frac1{e^{(1+i)(k-z)\pi}+1}-\frac1{e^{(1-i)(k-z)\pi}+1}\Bigg] \end{aligned}\\[2ex] &=\frac{\sin^2{\pi z}}{\cosh{\pi z}+\cos{\pi z}}-i\sin{\pi z}\sum_{k\ge 1}\left(\frac2{e^{2\pi(1+i)(k+z/2)}+1}-\frac2{e^{2\pi(1-i)(k-z/2)}+1}\right.\\&\hspace{15em}\left.-\frac2{e^{2\pi(1+i)(k-z/2)}+1}+\frac2{e^{2\pi(1-i)(k-z/2)}+1}\right.\\ &\hspace{17em}-\frac1{e^{\pi(1+i)(k+z)}+1}+\frac1{e^{\pi(1-i)(k+z)}+1}\\&\hspace{18em}\left.+\frac1{e^{\pi(1+i)(k-z)}+1}-\frac1{e^{\pi(1-i)(k-z)}+1}\right) \end{align} Now I use the formula $\tfrac1{2\pi q}\frac{\theta'(z, q)}{\theta(z,q)}+z-\frac12\tanh{\pi qz}=\sum_{k\ge 1}\left(\frac1{e^{2\pi q(k-z)}+1}-\frac1{e^{2\pi q(k+z)}+1}\right)$ to simplify the above mess to\begin{align}\sum_{k\in\mathbb{Z}}\frac{\sin^2{(k+z)\pi}}{\cosh{(k+z)\pi}+\cos{(k+z)\pi}}&=\frac{\sin^2{\pi z}}{\cosh{\pi z}+\cos{\pi z}}\\ &\quad+i\sin{\pi z}\Bigg[ \begin{aligned}[t]&\frac{1-i}{2\pi}\;\frac{\theta'}{\theta}\left(z,\frac{1+i}2\right)+z-\frac12\tanh{\frac{(1+i)\pi z}2}\\ &-\frac{1+i}{2\pi}\;\frac{\theta'}{\theta}\left(z,\frac{1-i}2\right)-z+\frac12\tanh{\frac{(1-i)\pi z}2}\\ &\left.+\frac{1+i}{2\pi}\;\frac{\theta'}{\theta}\left(\frac z2,1+i\right)+z-\tanh{\frac{(1-i)\pi z}2}\\ -\frac{1-i}{2\pi}\;\frac{\theta'}{\theta}\left(\frac z2,1+i\right)-z+\tanh{\frac{(1+i)\pi z}2}\right] \end{aligned}\\ &=\frac{\sin^2{\pi z}}{\cosh{\pi z}+\cos{\pi z}}\\ &\quad+i\sin{\pi z}\Bigg[\frac{i\sin{\pi z}}{\cosh{\pi z}+\cos{\pi z}}+\begin{aligned}[t] &\frac{1-i}{2\pi}\left[\frac{\theta'}{\theta}\left(z,\frac{1+i}2\right)-\frac{\theta'}{\theta}\left(\frac z2,1+i\right)\right]\\ &+\frac{1+i}{2\pi}\left[\frac{\theta'}{\theta}\left(\frac z2,1-i\right)-\frac{\theta'}{\theta}\left(z,\frac{1-i}2\right)\right]\Bigg] \end{aligned}\\ &=\frac{1+i}{2\pi}\sin{\pi z}\left[\frac{\theta'}{\theta}\left(z,\frac{1+i}2\right)-\frac{\theta'}{\theta}\left(\frac z2,1+i\right)\right]\\ &\qquad+\frac{i-1}{2\pi}\sin{\pi z}\left[\frac{\theta'}{\theta}\left(\frac z2,1-i\right)-\frac{\theta'}{\theta}\left(z,\frac{1-i}2\right)\right] \end{align} Next I rewrite $\frac{\theta'}{\theta}\left(z,\frac{1\pm i}2\right)$ as $\frac12\left(\frac{\vartheta'}{\vartheta}\left(\frac z2,1\pm i\right)+\frac{\theta'}{\theta}\left(\frac z2,1\pm i\right)\right)$, then separate the real and imaginary parts using $\frac{\theta'}{\theta}\left(z,1\pm i\right)=\frac{\theta'(z,2)\mp i\vartheta'(z,2)}{\theta(z,2)\mp i\vartheta(z,2)}$ and $\frac{\vartheta'}{\vartheta}(z,1\pm i)=\frac{\vartheta'(z,2)\mp i\theta'(z,2)}{\vartheta(z,2)\mp i\theta(z,2)}$ to get \begin{align}\sum_{k\in\mathbb{Z}}\frac{\sin^2{(k+z)\pi}}{\cosh{(k+z)\pi}+\cos{(k+z)\pi}}&=\frac{i+1}{4\pi}\sin{\pi z}\left[\frac{\vartheta'}{\vartheta}\left(\frac z2,1+i\right)-\frac{\theta'}{\theta}\left(\frac z2,1+i\right)\right]\\ &\quad \,+\frac{1-i}{4\pi}\sin{\pi z}\left[\frac{\vartheta'}{\vartheta}\left(\frac z2,1-i\right)-\frac{\theta'}{\theta}\left(\frac z2,1-i\right)\right]\\ &=\frac1{2\pi}\sin{\pi z}\cdot\Re\left[\frac{\vartheta'\left(\frac z2,2\right)-i\theta'\left(\frac z2,2\right)}{\vartheta\left(\frac z2,2\right)-i\theta\left(\frac z2,2\right)}-\frac{\theta'\left(\frac z2,2\right)-i\vartheta'\left(\frac z2,2\right)}{\theta\left(\frac z2,2\right)-i\vartheta\left(\frac z2,2\right)}\right]\\ &=\frac1\pi\sin{\pi z}\cdot\Re\left[i(1+i)\frac{\vartheta'(z/2,2)\theta(z/2,2)-\theta'(z/2,2)\vartheta(z/2,2)}{\theta^2(z/2,2)+\vartheta^2(z/2,2)}\right]\\ &=\frac1\pi\sin{\pi z}\cdot\frac{(\theta'\cdot\vartheta)(z/2,2)-(\vartheta'\cdot\theta)(z/2,2)}{\vartheta^2(z/2,2)}\frac1{1+(\theta/\vartheta)^2(z/2,2)}\\ &=\frac2\pi\sin{\pi z}D_z\left[\tan^{-1}\left(\frac{\theta(z/2,2)}{\vartheta(z/2,2)}\right)\right] \end{align} And my equation follows from dividing both sides by $\sin^2{(k+z)\pi}=\sin^2{\pi z}$. The formulas I used can be derived by logarithmically differentiating $\theta(z,q)=2e^{-\pi q/4-\pi qz^2}\cosh{\pi qz}\prod_{k\ge 1}(1-e^{-2k\pi q})(1+e^{-2k\pi q+2\pi qz})(1+e^{-2k\pi q-2\pi qz})$(w.r.t. $z$) and reformulating $\vartheta(z,1+i)$ as\begin{align}\frac1{\sqrt{1+i}}\sum_{k\in\mathbb{Z}}e^{\frac{-\pi k^2}{1+i}}\cos{2k\pi z}&=\frac{1-i}2\sum_{k\in\mathbb{Z}}e^{-\pi k^2/2+i\pi k^2/2}\cos{2k\pi z}\\ &=\frac{1-i}2\sum_{k\in\mathbb {Z}}e^{-2\pi k^2}\cos{4k\pi z}\\ &\quad+\frac{1+i}2\sum_{k\in\mathbb{Z}}e^{-2\pi(k-1/2)^2}\cos{(4k-2)\pi z}\\ &=\frac{1-i}{2\sqrt{2}}\vartheta(2z,\tfrac12)+\frac{1+i}{2\sqrt{2}}\left(\vartheta(z,2)-\theta(z,2)\right)\\ &=\tfrac1{\sqrt{2}}(\vartheta(z,2)-i\theta(z,2)) \end{align} $\big($Note $\vartheta(2z,q/4)-\vartheta(z,q)=\theta(z,q)=\vartheta(z+1/2,q)$ and the imaginary transformation $\vartheta(z,q)=\tfrac1{\sqrt{q}}e^{-\pi qz^2}\vartheta(iqz,\tfrac1q)$$\big)$