Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been trying to evaluate the following sum using residues

$\displaystyle \sum_{n=1}^{\infty}\frac{1}{\sinh^{2}(\pi n)}=\frac{1}{6}-\frac{1}{2\pi}$

I am mainly interested in using residues to do this. I can do it using real methods.

I tried using $\displaystyle \oint\frac{\pi\cot(\pi z)}{\sinh^{2}(\pi z)}dz$

The residue at $z=0$ is $\frac{-2}{3}$

The residue at $\displaystyle z=n, \;\ (n=\pm 1, \pm 2, \pm 3, ....)$ is $\displaystyle \lim_{z\to n}\frac{(z-n)\cos(\pi z)}{\sin(\pi z)\sinh^{2}(\pi z)}=\frac{1}{\sinh^{2}(\pi n)}$

The residue at $\displaystyle z=ni, \;\ (\pm 1, \pm 2, \pm 3, .....)$ is

$\displaystyle \lim_{z\to ni}\frac{(z-ni)\pi\cot(\pi z)}{\sinh^{2}(\pi z)}=\frac{1}{\sinh^{2}(\pi n)}$

So, by the residue theorem:

$\displaystyle \oint\frac{\pi \cot(\pi z)}{\sinh^{2}(\pi z)}dz=\frac{-2}{3}+4\sum_{n=1}^{N}\frac{1}{\sinh^{2}(\pi n)}$

As $N\to \infty$, the left side goes to 0, then solve for the sum at hand.

It would appear the 1/6 is in there, but I have failed to arrive at the correct solution.

Where does the $\frac{1}{2\pi}$ come into play?.

No doubt, I am doing it incorrectly. Can someone point me in the right direction?

Thanks a lot.

share|cite|improve this question
By the way, since the terms decay very rapidly, this yields $$ \frac1{\sinh^2\pi}\approx\frac16-\frac1{2\pi}\;. $$ – joriki Apr 1 '13 at 10:41
besides the points that joriki makes in his answer, it should be noted that for the residues along the imaginary axis, you cannot play the same trick with L'Hospital that you can for the residues along the real axis. This is because the singularities on the imaginary axis are second order. The residues luckily come out the same, but more care should be taken. – robjohn May 23 '13 at 22:42
See this technique. – Mhenni Benghorbal May 24 '13 at 5:49

Here's an evaluation using the inverse Mellin transform.

For $\text{Re} (s)>2$,

$$ \begin{align} \Big\{\mathcal{M} \ \frac{1}{\sinh^{2} (\pi x)} \Big\}(s) &= \int_{0}^{\infty} \frac{x^{s-1}}{\sinh^{2}(\pi x)} \ dx \\ &= \frac{1}{\pi^{s}}\int_{0}^{\infty} \frac{u^{s-1}}{\sinh^{2} u} \ du \\ &= 4 \pi^{-s} \int_{0}^{\infty} u^{s-1} \frac{e^{-2u}}{(1-e^{-2u})^2} \ du \\ &= 4 \pi^{-s} \int_{0}^{\infty} u^{s-1} \sum_{n=1}^{\infty} n e^{-2nu} du \\ &= 4 \pi^{-s} \sum_{n=1}^{\infty} n \int_{0}^{\infty} u^{s-1} e^{-2nu} \ du \\ &= 4 \pi^{-s} \sum_{n=1}^{\infty}n \frac{\Gamma(s)}{(2n)^{s}}\\ &= \pi^{-s} \ 2^{2-s} \ \Gamma(s) \zeta(s-1) \end{align}$$

Then by definition of the inverse Mellin transform,

$$\frac{1}{\sinh^{2} (\pi x)} = \frac{1}{2 \pi i} \int_{\frac{5}{2} - i \infty}^{\frac{5}{2} + i\infty} \pi^{-s} \ 2^{2-s} \ \Gamma(s) \zeta(s-1) x^{-s} \ ds $$

Replacing $x$ with $n$ and summing both sides,

$$\begin{align} \sum_{n=1}^{\infty} \frac{1}{\sinh^{2} (\pi n)} &= \frac{1}{2 \pi i}\sum_{n=1}^{\infty} \int_{\frac{5}{2} - i \infty}^{\frac{5}{2} + i\infty} \pi^{-s} \ 2^{2-s} \ \Gamma(s) \zeta(s-1) (n)^{-s} \ ds \\ &= \frac{1}{2 \pi i} \int_{\frac{5}{2} - i \infty}^{\frac{5}{2} + i\infty} \pi^{-s} \ 2^{2-s} \ \Gamma(s) \zeta(s-1) \zeta(s) \ ds \end{align}$$

Let $f(s) = \pi^{-s} \ 2^{2-s} \ \Gamma(s) \zeta(s-1) \zeta(s) $.

Close the contour with a rectangle that has its vertices at $s= 1 -i \infty, s= \frac{5}{2} - i \infty, s= \frac{5}{2} + i \infty$, and $s= 1+ i \infty$, and is indented at $s = 1$.

The integral vanishes along the top and bottom of the rectangle since $\Gamma(s)$ decays exponentially as $\text{Im}(s) \to \pm \infty$.

And $f(s)$ is odd (and purely imaginary) along the line $\text{Re} (s) = 1$.

So we have

$$\sum_{n=1}^{\infty} \frac{1}{\sinh^{2} (\pi n)} = \frac{1}{2 \pi i} \Big( \pi i \ \text{Res}[f,1] + 2 \pi i \ \text{Res}[f,2] \Big)$$


$$\begin{align} \text{Res} [f(s),1] &= \lim_{z \to 1} (s-1) \zeta(s) \pi^{-s} 2^{2-s} \Gamma(s) \zeta(s-1) \\ &= (1) \Big( \frac{1}{\pi} \Big)(2)(1)\Big(-\frac{1}{2} \Big) \\ &= - \frac{1}{\pi } \end{align}$$


$$ \begin{align} \text{Res}[f(s),2] &= \lim_{z \to 2} (s-2) \zeta(s-1) \pi^{-s} 2^{2-s} \Gamma(s) \zeta(s) \\ &= (1) \Big(\frac{1}{\pi^{2}} \Big) (1)(1) \Big(\frac{\pi^{2}}{6} \Big) \\ &= \frac{1}{6} \end{align}$$


$$ \sum_{n=1}^{\infty} \frac{1}{\sinh^{2} (\pi n)} = \frac{1}{2 \pi i} \Bigg(\pi i \left(-\frac{1}{\pi} \right) + 2 \pi i \left(\frac{1}{6} \right) \Bigg) = \frac{1}{6} - \frac{1}{2 \pi} $$

share|cite|improve this answer
Wow, thanks RV. You're a good egg. This Mellin tranforms can be mighty useful in evaluating series. May I ask something?. How do you determine what vertices of the rectangle to use?. I noticed on some you use 3/2, but on this one you used 5/2 and 1. – Cody May 24 '13 at 10:28
The Mellin transform of $\frac{1}{\sinh^{2}x}$ converges for $\text{Re}(s) >2$. So we want the inverse transform to be in that plane of the complex plane. I could have picked any number greater than $2$. And I placed the left side of the rectangle along the line $\text{Re}(s)=1$ because that is where the integrand is odd. In the other problem the left side of the rectangle was placed along the imaginary axis (i.e., $\text{Re}(s)=0)$ because that's where the integrand was odd in that problem. – Random Variable May 24 '13 at 11:17
Thanks. I see. Nice method. – Cody May 24 '13 at 20:48

There are two problems. One is that you dropped the factor $2\pi\mathrm i$ in the residue theorem. The other is that the left-hand side doesn't go to zero as $N\to\infty$.

If we integrate over a quadratic contour at half-integer coordinates, opposite sides yield the same contributions, so we need twice the sum of the contributions from one horizontal segment and one vertical segment. The contribution from the vertical segments goes to $0$, since the denominator decays exponentially. However, the contribution from the horizontal segments doesn't go to zero; it is, with $a=2k\pi +\pi/2$,

$$ \begin{align} \int_{(-a+\mathrm ia)/\pi}^{(a+\mathrm ia)/\pi}\frac{\pi\cot(\pi z)}{\sinh^2(\pi z)}\mathrm dz &= \int_{-a+\mathrm ia}^{a+\mathrm ia}\frac{\cot z}{\sinh^2z}\mathrm dz \\ &= \int_{-a}^a\frac{\cos x\cosh a-\mathrm i\sin x\sinh a}{\sin x\cosh a+\mathrm i\cos x\sinh a}\frac1{(\sinh x\cos a+i\cosh x\sin a)^2}\mathrm dx \\ &= -\int_{-a}^a\frac{\cos x\cosh a-\mathrm i\sin x\sinh a}{\sin x\cosh a+\mathrm i\cos x\sinh a}\frac1{\cosh^2x}\mathrm dx\;. \end{align} $$

With $a\to\infty$, both $\cosh a$ and $\sinh a$ are asymptotic to $\mathrm e^a$, so the first fraction goes to $-\mathrm i$, and we're left with twice

$$ \mathrm i\int_{-\infty}^\infty\frac1{\cosh^2 x}\mathrm dx=2\mathrm i\;. $$

This contribution of $4\mathrm i$, divided by the $4$ in front of your sum and the factor $2\pi\mathrm i$ in the residue theorem, yields the term $1/(2\pi)$; the minus sign arises because I integrated clockwise.

share|cite|improve this answer
Thanks very much, Joriki. I sure would not have spotted that. I was under the impression one did not have to multiply by $2\pi i$ in this case. I was thinking of $\sum_{-\infty}^{\infty}f(n)=-\text{(sum of residues of} \pi\cot(\pi z) f(z) \text{at the poles of f(z))}$. That is why I did not use it. Apparently, this is not applicable here because f(z) does not have a finite number of poles?. Thanks for your help. I reckon I do not know enough to see things like this. – Cody Mar 30 '13 at 22:29
Oh, btw, joriki. The -1/6 part is unaffected by the $2\pi i$?. – Cody Mar 30 '13 at 22:45
If the contour integral as $ N \to \infty$ approaches zero and you divide both sides of the equation by $ 2 \pi i $, the $ 2 \pi i$ effectively disappears. – Random Variable Mar 30 '13 at 23:36
@Cody: The problem isn't that $f(z)$ doesn't have a finite number of poles; it's that that formula assumes that the integral vanishes as you expand the contour to enclose all poles. As RV remarked, if the integral does vanish, then you don't need the factor $2\pi\mathrm i$ since it's multiplied by zero; but the way you wrote it, with the integral still in there (and rightly so, since it has a finite limit), you do need the factor. If you try deriving your formula from the residue theorem, you'll see why the factor $2\pi\mathrm i$ is in front of the integral and not in front of the other terms. – joriki Mar 31 '13 at 0:03
Are you using a square with vertices at $\pm(2N + \frac{1}{2}) \pm i (2N+\frac{1}{2})$ and not a square with vertices at $\pm(N + \frac{1}{2}) \pm i (N+\frac{1}{2})$ because it makes the evaluation easier? – Random Variable Apr 1 '13 at 1:51

I worked this out for a different problem in a bit more generality, so I will post the generalization here.

We are going to use the contour integral $$ \oint\pi\cot\left(\frac{2\pi}{x}z\right)\left(\mathrm{csch}^2(z)-\frac1{z^2}\right)\mathrm{d}z=-4\pi i\tag{1} $$ where the contours of interest are, for real $R\to\infty$ and integer $n\to\infty$, $$ \small\textstyle\color{#00A000}{[R,-R]+(n+\frac12)\pi i}\cup\color{#C00000}{-R+(n+\frac12)\pi i[1,-1]}\cup\color{#00A000}{[-R,R]-(n+\frac12)\pi i}\cup\color{#C00000}{R+(n+\frac12)\pi i[-1,1]} $$ The integral along the red paths becomes negligible as $R\to\infty$. Along the upper green path, where $\mathrm{Im}(z)\approx+\infty$, $\cot(z)\approx-i$. Along the lower green path, where $\mathrm{Im}(z)\approx-\infty$, $\cot(z)\approx+i$. Since $\mathrm{csch}^2(z+\frac\pi2i)=-\mathrm{sech}^2(z)$ is the derivative of $-\tanh(z)$, the integral along each of the green paths tends to $-2\pi i$. Therefore, the full integral is $-4\pi i$.

Since $$ \pi\cot\left(\frac{2\pi}{x}z\right)\text{ has residue }\frac x2\text{ at }z=\frac x2n\tag{2} $$ and $$ \mathrm{csch}^2(z)-\frac1{z^2}=-\frac13+O(z^2)\text{ at }z=0\tag{3} $$ the contribution from the singularities on the real axis is $$ 2\pi i\frac x2\left[2\sum_{n=1}^\infty\left(\mathrm{csch}^2\left(\frac x2n\right)-\frac4{x^2n^2}\right)-\frac13\right]\tag{4} $$ Since $$ \mathrm{csch}^2(z)=\frac1{(z-\pi in)^2}+O(1)\text{ at }z=\pi in\text{ for }n\ne0\tag{5} $$ and $$ \begin{align} \left.\frac{\mathrm{d}}{\mathrm{d}z}\pi\cot\left(\frac{2\pi}{x}z\right)\right|_{z=\pi in} &=\left.-\frac{2\pi^2}{x}\csc^2\left(\frac{2\pi}{x}z\right)\right|_{z=\pi in}\\ &=\frac{2\pi^2}{x}\mathrm{csch}^2\left(\frac{2\pi^2}{x}n\right)\tag{6} \end{align} $$ the contribution from the singularities on the imaginary axis is $$ 2\pi i\frac{2\pi^2}{x}\left[2\sum_{n=1}^\infty\mathrm{csch}^2\left(\frac{2\pi^2}{x}n\right)\right]\tag{7} $$ Putting together $(1)$, $(4)$, and $(7)$ gives $$ \frac x2\sum_{n=1}^\infty\mathrm{csch}^2\left(\frac x2n\right) +\frac{2\pi^2}{x}\sum_{n=1}^\infty\mathrm{csch}^2\left(\frac{2\pi^2}{x}n\right) =-1+\frac{\pi^2}{3x}+\frac x{12}\tag{8} $$ Setting $x=2\pi$ in $(8)$ yields $$ \sum_{n=1}^\infty\mathrm{csch}^2(\pi n)=\frac16-\frac1{2\pi}\tag{9} $$

share|cite|improve this answer
Thanks RJ. Nice solution after all this time:) – Cody Sep 28 '14 at 18:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.