Astonishing similarity of $\frac{x}{\sinh(x)}$ and $\frac{1}{\cosh^2(4x/\pi^2)} $

361 Views Asked by At

I just came across that previously unknown to me approximation $$ \frac{x}{\sinh(x)} \approx \frac{1}{\cosh^2(4x/\pi^2)} $$ It shows astonishing precision (plotted are both curves on top of each other):

Plot of both functions on top of each other

I am looking for an (analytical) derivation/explanation of that formula. (Expansion in Taylor series is not an explanation because it does not provide the reason for its existence.)

Analytically, both functions differ at large $x$ but there the function is already very small so the absolute error is minimal anyway (while the relative error might be considerable).

The appearance of the coefficient $4/\pi^2$ can be motivated by requiring both sides to have the same integral over $[0,\infty)$ which is exactly $\pi^2/4$. But the almost identical form of both functions remains mysterious to me.


Update: From the Euler Gamma function we find $$ \left|\Gamma\left(1+i x\right)\right|^2 = \frac{\pi x}{\sinh(\pi x)} $$ Can this be helpful? $$ \left|\Gamma\left(\frac{1}{2}+i x\right)\right|^2 = \frac{\pi}{\cosh(\pi x)} $$

2

There are 2 best solutions below

3
On

Using series $$\frac{x}{\sinh(x)}=1-\frac{x^2}{6}+\frac{7 x^4}{360}-\frac{31 x^6}{15120}+O\left(x^8\right)$$ $$\text{sech}^2\left(\frac{4 x}{\pi ^2}\right)=1-\frac{16 x^2}{\pi ^4}+\frac{512 x^4}{3 \pi ^8}-\frac{69632 x^6}{45 \pi ^{12}}+O\left(x^8\right)$$ Compare the coefficients $$\frac{1}{6}=0.166667 \qquad \text{while}\qquad \frac{16}{\pi ^4} = 0.164256$$ $$\frac{7 }{360}=0.0194444\qquad \text{while}\qquad \frac{512 }{3 \pi ^8}=0.0179866$$ $$\frac{31 }{15120}=0.00205026\qquad \text{while}\qquad \frac{69632 }{45 \pi ^{12}}=0.00167416$$

The numbers are sufficiently close to explain the similarity.

Now, $$\int_0^t \Bigg[\frac{x}{\sinh(x)}-\text{sech}^2\left(\frac{4 x}{\pi ^2}\right)\Bigg]\,dx$$ shows a maximum error of $0.003434$ close to $t=5.192$

Edit

You could have a bit better considering $$\frac{x}{\sinh(x)}-\text{sech}^2\left(k x\right)=\left(k^2-\frac{1}{6}\right) x^2+\left(\frac{7}{360}-\frac{2 k^4}{3}\right) x^4+O\left(x^6\right)$$ Choosing $k=\frac{1}{\sqrt{6}}$ which is close to $\frac 4 {\pi^2}$ ($0.408248$ to be compared to $0.405285$), the maximum error for the integral is $0.01952$ close to $t=6.385$.

Concerning the series $$\frac{x}{\sinh(x)}=1-\frac{x^2}{6}+\frac{7 x^4}{360}-\frac{31 x^6}{15120}+O\left(x^8\right)$$ $$\text{sech}^2\left(\frac{x}{\sqrt{6}}\right)=1-\frac{x^2}{6}+\frac{x^4}{54}-\frac{17 x^6}{9720}+O\left(x^8\right)$$ Comparing the coefficients $$\frac{7 }{360}=0.0194444\qquad \text{while}\qquad \frac{1 }{54 }=0.0185185$$ $$\frac{31 }{15120}=0.00205026\qquad \text{while}\qquad \frac{17 }{9720 }=0.00174897$$

Update (after your answer to your own question)

Willing to keep the nice $\frac{4 }{\pi ^2}$ factor, I minimized the function $$f(\epsilon)=\int_0^\infty \Bigg[x\, \text{csch}(x)-\text{sech}^2\left(\frac{4 (1+\epsilon)}{\pi ^2}x\right)\Bigg]^2\,dx$$ and obtained, as a simple approximation of the optimum $$\epsilon_* \sim -\frac{2 \left(\sqrt{7}-1\right)}{1875}\implies f(\epsilon_*)=9.60\times 10^{-6}$$ This is $10$ times better than with $\frac{1}{\sqrt{6}}$ which gives $9.78\times 10^{-5}$

With $\epsilon=0$, the maximum error is $0.00251$ but with $\epsilon_*$ it becomes $0.00198$.

2
On

My best idea so far is to compare the Taylor series of the reciprocal functions (which seems better than the direct Taylor expansions because the functions decay asymptotically to zero). Indeed, the series $$ \sinh(x)/x \approx 1 + \frac{x^2}{6} + \frac{x^4}{120} + \frac{x^6}{5040} + ... $$ $$ \cosh^2(4 x / \pi^2) \approx 1 + \frac{16 x^2}{\pi ^4} + \frac{256 x^4}{3 \pi ^8} + \frac{8192 x^6}{45 \pi ^{12}} + ... $$ $$ \cosh^2(x/\sqrt{6}) \approx 1 + \frac{x^2}{6} + \frac{x^4}{108} + \frac{x^6}{4860} + ... $$ have very similar first four coefficients and their reciprocals are little sensitive to the higher terms (cf. attached figure where all functions and their truncated Taylor expansions are plotted on top of each other). The factor $k = 1/\sqrt{6}$ comes from the direct comparison of the series for $\cosh^2(k x)$ with the series for $\sinh(x)/x$, as also suggested by @Claude Leibovici in his/her answer, and gives better approximation for $|x|<1$. But the maximal error is still lower for $k=4/\pi^2$ (by factor of about $2.7$).

All functions with their truncated Taylor series plotted together

Also the fact that the integral over $[0,\infty)$ of both functions does not match exactly for $k=1/\sqrt{6}$ but it does for $k=4/\pi^2$ requires further explanation. Taking into account that all the functions decay quickly to zero the main contribution comes anyway from the vicinity of $x\approx 0$ where all expansions match very well. Therefore, any scaling obtained from the requirement of matching integrals, like here $k=4/\pi^2$, should be near to $1/\sqrt{6}$ and it is.

So the factor $k=4/\pi^2$ is magically superior to the Taylor motivated one, $k=1/\sqrt{6}$, and the reason for it remains unclear.