9

$\newcommand{\d}{\,\mathrm{d}}\newcommand{\sech}{\operatorname{sech}}\newcommand{\csch}{\operatorname{csch}}$It was recently asked, and then deleted, how to evaluate the following using contour integration: $$I=\int_0^\infty\frac{\sin^2(x)}{\sinh^2(x)}\d x\overset{?}{=}\frac{\pi\coth\pi-1}{2}$$

There is a simple real method, and I credit @KStar for finding the series expansions:

If $f(x)=-\frac{2}{1+e^{2x}}$, then $f'(x)=\sech^2(x)$ and by expanding $f$ as a geometric series we find, for $x\gt0$: $$\sech^2(x)=4\sum_{n=1}^\infty(-1)^{n-1}n\cdot e^{-2nx}$$And letting $x\mapsto x+i\pi/2$ yields: $$\csch^2(x)=4\sum_{n=1}^\infty n\cdot e^{-2nx}$$For $x\gt0$. Then: $$\begin{align}\int_0^\infty\frac{\sin^2(x)}{\sinh^2(x)}\d x&=2\sum_{n=1}^\infty n\cdot\int_0^\infty(1-\cos(2x))e^{-2nx}\d x\\&=2\sum_{n=1}^\infty n\cdot\left(\frac{1}{2n}-\frac{2n}{4n^2+4}\right)\\&=\sum_{n=1}^\infty\frac{1}{n^2+1}\\&=\frac{\pi\coth\pi-1}{2}\end{align}$$By the Mittag-Leffler expansion of $\coth$, or equivalently via an argument using the digamma function.

The new user who posted and subsequently deleted their question suggested taking a rectangular contour, limiting in $R\to\infty$ on the rectangle with base $-R\to R$, of height $i\pi$, and with a semicircular inward indent around the point $i\pi$, say of radius $\varepsilon$. The integrand $f(z)=\frac{\sin^2z}{\sinh^2z}$ is holomorphic on the boundary and interior of this contour, so the integrals over all paths sum to zero. Moreover the small strips $R\to R+i\pi,-R\to-R+i\pi$ obviously vanish.

We have: $$\begin{align}\sin(x+i\pi)&=\sin(x)\cosh(\pi)+i\sinh(\pi)\cos(x)\\\sin^2(x+i\pi)&=\sin^2(x)\cosh^2(\pi)-\cos^2(x)\sinh^2(\pi)+2i\sin(x)\cos(x)\sinh(\pi)\cosh(\pi)\\&=\sin^2(x)(1+2\sinh^2(\pi))-\sinh^2(\pi)+2i\sin(x)\cos(x)\sinh(\pi)\cosh(\pi)\end{align}$$

For asymptotically large $R$, asymptotically small $\varepsilon\gt0$ we then need to use: $$0=o(1)+I-\int_{[-R,-\varepsilon]\cup[\varepsilon,R]}\frac{\sin^2(x)(1+2\sinh^2(\pi))-\sinh^2(\pi)}{\sinh^2(x)}\d x+i\varepsilon\int_{-\pi}^0\frac{\sin^2(i\pi+\varepsilon e^{it})}{\sinh^2(\varepsilon e^{it})}e^{it}\d t\\\overset{R\to\infty}{\longrightarrow}-2\sinh^2(\pi)\cdot I+\\\lim_{\varepsilon\to0^+}\left[2\sinh^2(\pi)(1-\coth(\varepsilon))+i\varepsilon\int_{0}^\pi\frac{\sin^2(i\pi-\varepsilon e^{it})}{\sinh^2(\varepsilon e^{it})}e^{it}\d t\right]$$

The original asker claimed that it is possible to use this method to calculate the final answer (they didn't go as far, but it was implied). Taking this on good faith, I will assume this works - but I am very uncertain how to do this. The limit of the semicircular integral is, well, nasty - I'd appreciate help with the asymptotics here. I am fairly certain my calculations thus far are correct, but I unfortunately do not own a copy of Mathematica or equivalent to help me here.

It is my (purely intuitive) suspicion that the limit does not exist, but this is weird since the limit must exist, as all the other limits do and the total limit of zero obviously exists.

To present a concrete target - to get the correct evaluation, we need to show that: $$\begin{align}2\sinh^2(\pi)(I-1)&=\pi\sinh(\pi)\cosh(\pi)-3\sinh^2(\pi)\\&\overset{?}{=}\lim_{\varepsilon\to0^+}\left[i\varepsilon\int_0^\pi\frac{\sin^2(i\pi-\varepsilon e^{it})}{\sinh^2(\varepsilon e^{it})}\d t-2\sinh^2(\pi)\coth(\varepsilon)\right]\end{align}$$

FShrike
  • 40,125
  • Near $x=i\pi$, the integrand behaves like $-\frac{\sinh^2\pi} {(x-i\pi)^{2}}$, this is a second order pole and a semi circular contour of radius $\epsilon$ around it will scale like $1/{\epsilon}$, so the limit $\epsilon \to 0$ cannot be taken – Sal Jul 07 '22 at 17:20
  • @Sal That is correct. However, we are taking it on good faith - if I haven't botched any calculations - that the limit of the difference between this integral and $2\sinh^2(\pi)\coth(\varepsilon)$ tends to something concrete. The hyperbolic cotangent also behaves as $1/\varepsilon$ – FShrike Jul 07 '22 at 17:23

2 Answers2

3

Indeed, the method can be salvaged by taking the limits sufficiently carefully. Note that the contour proposed yields the equation

$$-2\sinh^2\pi\int_{-\infty}^\infty\frac{\sin^2x}{\sinh^2 x}dx+\lim_{\epsilon\to 0}\left[\left(\int_{-\infty}^{-\epsilon}+\int^{\infty}_{\epsilon}\right)\frac{\sinh^2\pi}{\sinh^2 x}-\\\int_0^\pi\frac{(\cosh^2\pi+\sinh^2\pi)\sin^2(\epsilon e^{-it})-\sinh^2\pi+i\sinh\pi\cosh\pi\sin (2\epsilon e^{-it})}{\sinh^2 (\epsilon e^{-it})}i\epsilon e^{-it}dt\right]=0$$

Now, we need to understand the leading behavior of the expression in brackets for $\epsilon\to 0$. The first integral is basically a principal value prescription with a double pole at $x=0$ and as such, is of order $\mathcal{O}(1/\epsilon).$ We expect this one to be canceled exactly. To this end we note that by expanding the denominator to leading order for the second term of the indent:

$$\int_0^\pi\frac{\sinh^2\pi}{\sinh^2 \epsilon e^{-it}}i\epsilon e^{-it}dt=-\frac{2\sinh^2\pi}{\epsilon}+o(\epsilon)=\sinh^2\pi\left(\int_{-\infty}^{-\epsilon}+\int^{\infty}_{\epsilon}\right)\frac{dx}{x^2}+o(\epsilon)$$

and we note that it exactly cancels out the divergent part of the PV integral. The first term of the indent vanishes as $\epsilon$ becomes small:

$$\int_0^\pi\frac{(\cosh^2\pi+\sinh^2\pi)\sin^2(\epsilon e^{-it})}{\sinh^2 \epsilon e^{-it}}i\epsilon e^{-it}dt=2(\cosh^2\pi+\sinh^2\pi)\epsilon+o(\epsilon ^3)$$

Finally, the third term tends to a constant:

$$\int_0^\pi\frac{i\cosh\pi\sinh\pi\sin(2\epsilon e^{-it})}{\sinh^2 \epsilon e^{-it}}i\epsilon e^{-it}dt=-2\pi\cosh\pi\sinh\pi+o(\epsilon^2)$$

Collecting everything we can finally evaluate the limit and rewrite the equation as

$$-2\sinh^2\pi \int_{-\infty}^\infty\frac{\sin^2x}{\sinh^2 x}dx+\sinh^2\pi\int_{-\infty}^\infty dx\left(\frac{1}{\sinh^2 x}-\frac{1}{x^2}\right)+2\pi \cosh\pi\sinh\pi=0$$

Evaluating the integral by using the antiderivative $(\coth x-1/x)'=1/x^2-1/\sinh^2 x$ we have that

$$\int_{-\infty}^\infty dx\left(\frac{1}{\sinh^2 x}-\frac{1}{x^2}\right)=-2$$ and with this we finally recover the result stated above.

DinosaurEgg
  • 10,775
  • It doesn’t appear as if you included the $(\sinh^2\pi+\cosh^2\pi)I$ term – FShrike Jul 07 '22 at 18:31
  • It was just missing in the 1st equation, thanks for spotting the typo! – DinosaurEgg Jul 07 '22 at 18:34
  • 1
    Thanks for the response, I need time to verify everything and understand – FShrike Jul 07 '22 at 18:43
  • If I may, I think there are some sign errors (very easily done!) which is making it harder for me to parse. E.g. I think it should be: $$\color{red}{-}2\frac{\sinh^2\pi}{\varepsilon}+o(\varepsilon)=\color{red}{+}\sinh^2\pi\left(\int_{-\infty}^{-\varepsilon}+\int_{\varepsilon}^\infty\right)\mathrm{d}x$$ – FShrike Jul 07 '22 at 18:54
  • And then the two integrals would actually combine, but with opposite sign: $$\int_{-\infty}^\infty\left(\frac{1}{x^2}-\frac{1}{\sinh^2x}\right),\mathrm{d}x=\color{red}{+}2$$ – FShrike Jul 07 '22 at 18:56
  • 1
    Did you get something like: $$\frac{\sin^2(\varepsilon e^{-it})}{\sinh^2(\varepsilon e^{-it})}\sim1-\frac{2}{3}\varepsilon^2e^{-2it}+o(\varepsilon^3)$$ – FShrike Jul 07 '22 at 19:06
  • They are not errors, I just computed individual quantities without signs in front and added them back later. Each equation should be an identity that holds true. Taylor expansion is exactly what I used. – DinosaurEgg Jul 07 '22 at 19:09
  • I'll accept because I now understand, but I'm near certain there are indeed sign errors! – FShrike Jul 07 '22 at 19:29
  • Thank you anyway, this was just what I was looking for. It didn't end up as bad as I first thought – FShrike Jul 07 '22 at 19:35
  • Fair, I found a couple myself. Should be mostly consistent now. Thanks! – DinosaurEgg Jul 07 '22 at 20:01
2

Alternatively, we could integrate the function $$f(z) = \frac{1-e^{2iz}}{2\sinh^{2}(z)}$$ counterclockwise around a rectangular contour with vertices at $z=-N$, $z=N$, $z=N+ \left(N+ \frac{1}{2} \right) \pi i$, and $z= -N+ \left(N+ \frac{1}{2} \right) \pi i$, where $N$ is a positive integer.

The contour needs to be indented at the origin since $f(z)$ has a simple pole there.

Letting $N \to \infty$, the integral vanishes on vertical sides of the rectangle because the magnitude of $\sinh^{2}(z)$ grows exponentially as $\Re(z) \to \pm \infty$.

However, the integral does not vanish on the upper side of the rectangle as $N \to \infty$.

Notice that on the upper side of the rectangle, we have $$\frac{1}{2\sinh^{2}(z)} = \frac{1}{2\sinh^{2}\left(t+ i \left(N+ \frac{1}{2} \right) \pi \right)} = - \frac{1}{2 \cosh^{2}(t)}$$ for all positive integers $N$.

And on the upper side of the rectangle, the magnitude of $\frac{e^{2iz}}{2 \sinh^{2}(z)}$ decays exponentially fast to zero as $N \to \infty$.

So as $N \to \infty$, the integral along the top of the rectangle is tending to $$- \int_{\infty}^{-\infty} \frac{\mathrm dt}{2 \cosh^{2}(t)} = 1. $$

Therefore, we have

$$\begin{align} \operatorname{PV} \int_{-\infty}^{\infty} \frac{1-e^{2it}}{2 \sinh^{2}(t)} \, \mathrm dt + 1 &= \pi i \operatorname{Res}[f(z), 0]+ 2 \pi i \sum_{n=1}^{\infty}\operatorname{Res}[f(z), n \pi i ] \\ &= \pi i (-i)+ 2 \pi i \sum_{n=1}^{\infty}\left(-i e^{-2 \pi n} \right) \tag{1} \\ &= \pi +2 \pi \, \frac{e^{- 2 \pi}}{1-e^{-2 \pi}} \\ &= \pi \coth(\pi). \end{align}$$

Equating the real parts on both sides of the equation, we get $$ \int_{-\infty}^{\infty} \frac{1- \cos(2t)}{2 \sinh^{2}(t)} \, \mathrm dt = \int_{-\infty}^{\infty} \frac{\sin^{2}(t)}{\sinh^{2}(t)} \, \mathrm dt = \pi \coth(\pi) - 1. $$


$(1)$ To determine the residues at $z= n \pi i, n \in \mathbb{N}_{>0}$, we can use the double pole formula I used here.

$$\begin{align} \operatorname{Res}\left [\frac{1-e^{2iz}}{2 \sinh^{2}(z)}, n \pi i \right] &= \frac{1}{2} \lim_{ z \to n \pi i } \frac{6 \left(-2i e^{2iz} \right) \left(2 \cosh(2z)\right) -2\left(1-e^{2iz} \right)\left(4 \sinh(2z) \right) }{3 \left(2 \cosh(2z) \right)^{2}} \\ &= \frac{1}{2} \frac{-24ie^{-2 \pi n} -0}{12} \\ &= -i e^{- 2 \pi n} \end{align}$$

  • I take it that the P.V. doesn't affect the real parts? – FShrike Jul 07 '22 at 20:41
  • Anyway, nice approach +1 – FShrike Jul 07 '22 at 20:53
  • @FShrike The real part of $\operatorname{PV} \int_{-\infty}^{\infty} \frac{1-e^{2it}}{2 \sinh^{2}(t)} , \mathrm dt $ is $$\int_{-\infty}^{\infty} \frac{1-\cos(2t)}{2 \sinh^{2}(t)} , \mathrm dt = \int_{-\infty}^{\infty} \frac{\sin^{2}(t)}{\sinh^{2}(t)} , \mathrm dt.$$ There is no need for the $\operatorname{PV}$ sign since it's a convergent integral. The imaginary part, on the other hand is $$\operatorname{PV} \int_{-\infty}^{\infty} \frac{-\sin(2t)}{2\sinh^{2}(t)} , \mathrm dt = 0.$$ – Random Variable Jul 07 '22 at 20:55
  • There's something I've never quite understood about P.V. in complex analysis. I have always guessed that we take $\pi i$ multiplied by the residue as a kind of averaging: one half of the integral with inward indent (no residue) plus one half of the integral with outward indent ($2\pi i$ multiplied by residue) - but why does it work? – FShrike Jul 07 '22 at 20:59
  • I think in order to get $\pi i\mathrm{Res}$ you need to take an outward indent, as I call it (i.e. $\gamma(t)=\varepsilon e^{it}$ on $[-\pi,0]\to\Bbb C$, the semicircle runs anticlockwise in orientation and dips below the real axis) – FShrike Jul 07 '22 at 21:20
  • @FShrike It's sometime called the fractional residue theorem. I asked about a generalization here. – Random Variable Jul 07 '22 at 21:26
  • 1
    @FShrike There's a proof on page 209 of the textbook Complex Analysis by Theodore Gamelin. You should be able to see it on Google Books. – Random Variable Jul 07 '22 at 21:31
  • Thank you for the reference – FShrike Jul 07 '22 at 21:33
  • A double thank you for that reference, even! That complex analysis textbooks contains topics I’ve been struggling to find references for – FShrike Jul 07 '22 at 21:35
  • 1
    @FShrike I'm actually using a inward indentation. $$\operatorname{PV} \int_{-\infty}^{\infty} \frac{1-e^{2it}}{2 \sinh^{2}(t)} , \mathrm dt - \pi i \operatorname{Res}[f(z), 0] + 1 = 2 \pi i \sum_{n=1}^{\infty}\operatorname{Res}[f(z), n \pi i ]. $$ I'm just got accustomed to writing it on the other side of the equation. An outward indentation leads to the same result.

    $$\operatorname{PV} \int_{-\infty}^{\infty} \frac{1-e^{2it}}{2 \sinh^{2}(t)} , \mathrm dt + \pi i \operatorname{Res}[f(z), 0] + 1 = 2 \pi i \sum_{n={\color{red}{0}}}^{\infty}\operatorname{Res}[f(z), n \pi i ] $$

    – Random Variable Jul 07 '22 at 21:53