# Mistake computing $\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(x)}-\frac{a}{e^{2x}} \right)\frac{dx}{x}$

I am looking to evaluate the integral

$$\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(x)}-\frac{a}{e^{2x}} \right)\frac{dx}{x}=\ln\left(\frac{\pi}{\Gamma^2\left(\frac{1+a}{2b}\right)\cos\left(\frac{a\pi}{2}\right)}\right)$$

To this end I considered

$$I(w)=\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(bx)}-\frac{ad}{e^{cx}} \right)\frac{e^{-wx}}{x}\,dx \tag{1}$$

Note that as $$w \to \infty$$ the integrand vanishes. And as $$w =0$$ we recover the desired integral. Differentiating $$(1)$$ w.r. to $$w$$ we obtain

\begin{aligned} I^\prime(w)&=-\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(bx)}-\frac{ad}{e^{cx}} \right)e^{-wx}\,dx\\ &=ad\int_0^\infty e^{-(c+w)x}\,dx- \int_0^\infty \frac{\sinh(ax)}{\sinh(bx)}e^{-wx}\,dx\\ &=\frac{ad}{c+w}-\int_0^\infty \frac{e^{ax}-e^{-ax}}{e^{bx}-e^{-bx}}e^{-wx}\,dx\\ &=\frac{ad}{c+w}-\int_0^\infty \frac{e^{-(w-a)x}-e^{-(w+a)x}}{e^{bx}-e^{-bx}}\,dx\\ &=\frac{ad}{c+w}-\int_0^\infty \frac{e^{-bx}}{e^{-bx}}\cdot\frac{e^{-(w-a)x}-e^{-(w+a)x}}{e^{bx}-e^{-bx}}\,dx\\ &=\frac{ad}{c+w}-\int_0^\infty \frac{e^{-(w-a+b)x}-e^{-(w+a+b)x}}{1-e^{-2bx}}\,dx\\ &=\frac{ad}{c+w}-\frac{1}{2b}\int_0^\infty \frac{e^{-\frac{(w-a+b)}{2b}x}-e^{-\frac{(w+a+b)}{2b}x}}{1-e^{-x}}\,dx \qquad (2bx \to x)\\ &=\frac{ad}{c+w}-\frac{1}{2b}\int_0^1 \frac{x^{\frac{(w-a+b)}{2b}-1}-x^{\frac{(w+a+b)}{2b}-1}}{1-x}\,dx \qquad (e^{-x} \to x)\\ &=\frac{ad}{c+w}-\frac{1}{2b}\left(\psi\left(\frac{w+a+b}{2b}\right)-\psi\left(\frac{w-a+b}{2b}\right)\right)\\ I(w)&=ad\int\frac{1}{c+w}\,dw-\frac{1}{2b}\left(\int\psi\left(\frac{w+a+b}{2b}\right)\,dw-\int\psi\left(\frac{w-a+b}{2b}\right)\,dw\right)\\ &=ad\ln(c+w)-\left(\ln\left(\Gamma\left(\frac{w+a+b}{2b}\right)\right)\,-\ln\left(\Gamma\left(\frac{w-a+b}{2b}\right)\right)\right)\\ &=ad\ln(c+w)+\ln\left(\frac{\Gamma\left(\frac{w-a+b}{2b}\right)}{\Gamma\left(\frac{w+a+b}{2b}\right)}\right)\\ \end{aligned}

Now,our integral is equal to

$$I=-\int_0^\infty I^\prime(w)\,dw=I(0)$$

Letting $$w=0$$

\begin{aligned} \int_0^\infty \left(\frac{\sinh(ax)}{\sinh(bx)}-\frac{ad}{e^{cx}} \right)\frac{dx}{x}&=\ln\left(\frac{c^{ad}\Gamma\left(\frac12-\frac{a}{2b}\right)}{\Gamma\left(\frac12+\frac{a}{2b}\right)}\right)\\ &=\ln\left(\frac{c^{ad}\Gamma\left(\frac12-\frac{a}{2b}\right)\Gamma\left(\frac12+\frac{a}{2b}\right)}{\Gamma\left(\frac12+\frac{a}{2b}\right)\Gamma\left(\frac12+\frac{a}{2b}\right)}\right)\\ &=\ln\left(\frac{c^{ad}\pi}{\Gamma^2\left(\frac12+\frac{a}{2b}\right)\cos\left(\frac{a\pi}{2b}\right)}\right) \qquad \blacksquare\\ \end{aligned}

setting $$b=1$$, $$c=2$$ and $$d=1$$ I obtained

$$\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(x)}-\frac{a}{e^{2x}} \right)\frac{dx}{x}=\ln\left(\frac{2^{a}\pi}{\Gamma^2\left(\frac{1+a}{2b}\right)\cos\left(\frac{a\pi}{2}\right)}\right)$$

Which has an extra term leading to an incorrect answer. Can someone please point out where I am mistaking?

• From what I see, you have calculated $I'(0)$ while the answer you require is $I(0)$. Nov 4, 2021 at 17:52

With a simple renaming of variables, I solved the OP's question using Ramanujan's generalization of Frullani's integral. The OP's method should work as well.

Evaluate $\int_0^{\infty } \Bigl( 2qe^{-x}-\frac{\sinh (q x)}{\sinh \left(\frac{x}{2}\right)} \Bigr) \frac{dx}x$

You must have $$d=1/b$$ in $$(1)$$ for the integral to converge (otherwise, the integrand has a non-integrable singularity at $$x\to 0$$). After tiny fixes (partially done by me now), the formula $$I(w)=\frac{a}{b}\ln(c+w)+\ln\Gamma\left(\frac{w-a+b}{2b}\right)-\ln\Gamma\left(\frac{w+a+b}{2b}\right)+C$$ (where $$C$$ doesn't depend on $$w$$) is correct, and the idea to compute $$C$$ by taking $$w\to\infty$$ is good.

But this doesn't yield $$C=0$$. Instead, using a known limit $$\lim_{x\to\infty}\frac{\Gamma(x+d)}{x^d\ \Gamma(x)}=1$$ with obvious substitutions, one obtains the correct value $$C=-\frac{a}{b}\ln(2b).$$

• thank you for your answer. Did you use Stirling´s formula to evaluate $C$? Where can I find evaluation of the mentioned limit? Nov 4, 2021 at 19:23
• @Ricardo770: Yes, the limit can be deduced from Stirling's formula (perhaps that's why it appears here). Another way to obtain it is by an asymptotic analysis of the integral for $\operatorname{B}(x,d)$ as $x\to\infty$. Nov 4, 2021 at 19:29
• @Ricardo770 See here. Nov 4, 2021 at 20:13
• @RandomVariable Thank you very much for the link! I will try to work though the correct answer later, and for sure your link and metamorphy sugestions will help! Nov 4, 2021 at 20:18

For this specific integral We can evaluate as follows:

\begin{aligned} I(a)&=\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(x)}-\frac{a}{e^{2x}}\right)\frac{dx}{x}\\ & \\ I^\prime(a)&=\int_0^\infty \left(\frac{x\cosh(ax)}{\sinh(x)}-\frac{1}{e^{2x}}\right)\frac{dx}{x}\\ &=\int_0^\infty \left(\frac{\cosh(ax)}{\sinh(x)}-\frac{e^{-2x}}{x}\right)dx\\ &=\int_0^\infty \left(\frac{e^{ax}+e^{-ax}}{e^x-e^{-x}}-\frac{e^{-2x}}{x}\right)dx\\ &=\int_0^1 \left(\frac{x^{a}+x^{-a}}{x^{-1}-x}+\frac{x^2}{\ln(x)}\right)\frac{dx}{x} & (e^{-x} \to x)\\ &=\int_0^1 \left(\frac{x}{x}\cdot\frac{x^{a}+x^{-a}}{x^{-1}-x}+\frac{x^2}{\ln(x)}\right)\frac{dx}{x}\\ &=\int_0^1 \left(\frac{x^{a+1}+x^{1-a}}{1-x^2}+\frac{x^2}{\ln(x)}\right)\frac{dx}{x}\\ &=\frac12\int_0^1 \left(\frac{x^{\frac{a+1}{2}}+x^{\frac{1-a}{2}}}{1-x}+\frac{2x}{\ln(x)}\right)\frac{dx}{\sqrt{x}\sqrt{x}} & (x^2 \to x)\\ &=\frac12\int_0^1 \left(\frac{1}{\ln(x)}+\frac{x^{\frac{a+1}{2}-1}}{1-x}\right)dx+\frac12\int_0^1 \left(\frac{1}{\ln(x)}+\frac{x^{\frac{1-a}{2}-1}}{1-x}\right)dx\\ &=-\frac12\psi\left(\frac{1+a}{2} \right)-\frac12\psi\left(\frac{1-a}{2} \right) \end{aligned}

Then

\begin{aligned} I(a)&=-\frac12\int_0^a\psi\left(\frac{1+u}{2} \right)\,du-\frac12\int_0^a\psi\left(\frac{1-u}{2} \right)\,du\\ &=-\int_{1/2}^{\frac{1+a}{2}}\psi\left(u \right)\,du+\int_{1/2}^{\frac{1-a}{2}}\psi\left(u \right)\,du\\ &=\ln\left(\Gamma\left(\frac{1-a}{2} \right) \right)-\ln\left(\Gamma\left(\frac{1}{2} \right) \right)-\ln\left(\Gamma\left(\frac{1+a}{2} \right) \right)+\ln\left(\Gamma\left(\frac{1}{2} \right) \right)\\ &=\ln\left(\frac{\Gamma\left(\frac{1-a}{2} \right)}{\Gamma\left(\frac{1+a}{2} \right) } \right)\\ &=\ln\left(\frac{\Gamma\left(\frac{1-a}{2} \right)\Gamma\left(\frac{1+a}{2} \right)}{\Gamma\left(\frac{1+a}{2} \right)\Gamma\left(\frac{1+a}{2} \right) } \right)\\ &=\ln\left(\frac{\pi}{\Gamma^2\left(\frac{1+a}{2} \right)\cos\left(\frac{a \pi }{2} \right) } \right) \qquad \blacksquare\\ \end{aligned}

We used that:

$$\int_0^1 \left(\frac{x^{z-1}}{\ln(x)}+\frac{x^{w-1}}{1-x}\right)dx=\ln(z)-\psi(w)$$

and

$$\Gamma\left(\frac{1}{2}-x\right) \Gamma\left(\frac{1}{2}+x\right)=\frac{\pi}{\cos \pi x}$$