Evaluate the Integral $\int_{0}^{\infty}\ln\left(1+\pi\frac{2\cosh\left(t\right)+\pi}{t^{2}+\cosh\left(t\right)^{2}}\right)dt$

improper-integralsindefinite-integralsintegration

That's the essence of the problem: can the (in my opinion rather challenging) integral be solved or simplified:
$\int_{0}^{\infty}\ln\left(1+\pi\frac{2\cosh\left(t\right)+\pi}{t^{2}+\cosh\left(t\right)^{2}}\right)dt$

It's got everything logs, cosh, t, and more.

I arrived to this expression while looking at the transcendental equation $cos(x)=x$, hence the similar-looking transcendental equation in the denominator. This was the product of integration by parts so backtracking wasn't helpful, I tried Feynman's trick with a few attempts but nothing simplified well enough.

I would be very grateful for any insights, perhaps I have missed a neat solution during my work on this problem.

Best Answer

The integral does have a closed form $$ I=\int_{0}^{\infty}\log\left(1+\pi\frac{2\cosh x+\pi}{x^2+\cosh^2 x}\right)dx=\pi(\pi-2w) $$ where $w\approx 0.739085$ is the unique real solution of $x=\cos x$ (sometimes called the Dottie number). The following is a proof.


First simplify the integrand $$ \begin{align} I & = \int_0^\infty\log\left(\frac{x^2+\cosh^2 x+2\pi\cosh x+\pi^2}{x^2+\cosh^2 x}\right)dx\\ & = \int_0^\infty\log\left(\frac{x^2+(\pi+\cosh x)^2}{x^2+\cosh^2 x}\right)dx\\ & = \int_0^\infty\log\left(\frac{ix-\cos(ix)}{ix+\pi-\cos(ix+\pi)}\right)+\log\left(\frac{-ix-\cos(-ix)}{-ix+\pi-\cos(-ix+\pi)}\right)dx\\ & = \left(\int_{l_0}-\int_{l_\pi}\right)\log(z-\cos z)\frac{dz}i\\ & = \left(\int_{l_0}-\int_{l_\pi}\right)\frac{(z-\cos z)'}{z-\cos z}\frac{z~dz}i \end{align} $$ where $l_x$ is the vertical line $\Re (z)=x$. Note that the integrals are performed on lines so we do not need to take branch cuts. The last step is to integrate by parts.

Consider the integral on the rectangular contour $C$ as $R\to\infty$ $$ f(z)=\frac{(z-\cos z)'}{z-\cos z}\frac{z}i\\ C: -iR\to iR\to \pi+iR\to \pi-iR\to-iR $$ It is worth noticing that the integral on the horizontal lines does not vanish. The imaginary part of it diverges on both lines, but then cancel out due to symmetry. The real part is what we want, namely $$ \lim_{R\to\pm\infty}\Re f(x+iR)=\mp x\\ \int_{\pm iR}^{\pi\pm iR}f(z)dz=\int_0^\pi\mp x~dx=\mp\frac{\pi^2}2 $$ Meanwhile, the integral on the vertical lines is just $I$.

Now it suffice to investigate the poles of $f(z)$, that is, the solution of $z=\cos z$.

Let $z=x+iy$, then take the real and imaginary part $$ \cases{ x-\cos x\cosh y=0\\[5pt] y+\sin x\sinh y=0 } $$ We are only for the solutions such that $x=\Re(z)\in(0,\pi)$. When $x$ satisfies this condition, $\sin x$ is positive, so LHS of the second equation always has the same sign. Thus, the only suitable $y$ is zero. Then it is easy to verify $x-\cos x$ monotonically increases on the real line and has a unique real root $w\approx 0.739085$.

Finally, apply the residue theorem (the contour is clockwise) and the result follows $$ \oint f(z)dz={\color{red}{-}}2\pi i \text{Res}[f(z),z=w]=-2\pi w\\ =\left(\int_{l_0}+\int_{iR}^{\pi+ iR}-\int_{l_\pi}-\int_{-iR}^{\pi-iR}\right)f(z)dz=I-\pi^2 $$

$$ I=\pi(\pi-2w) $$

Remarks

The integral provides a neat integral representation of $w$, namely $$ w=\frac\pi2-\frac1{2\pi}\int_{0}^{\infty}\log\left(1+\pi\frac{2\cosh x+\pi}{x^2+\cosh^2 x}\right)dx $$

In my humble opinion, the idea behind integrals of this type is pretty straightforward, that if $z_0$ is the unique root of some function $f(z)$ analytic inside the contour $C$, then $$ z_0=\frac1{2\pi i}\oint_C z \frac{f'(z)}{f(z)}dz $$ Then only barrier in our way to obtain a nice-looking real integral is the choice of $C$ to wipe out most of the "complex components". The one who came up with this integral (perhaps OP) obviously did a good job on that.

An integral with similar ideas (but varies a lot in form) as a conclusion $$ \int_0^\pi\frac{x~dx}{x+\sin x~e^{x\cot x+1}}=\frac\pi2 $$