Show that $\int_0^\pi \frac{x\cos x \sinh x}{\sin^2x+\sinh^2x}dx=\frac{\pi}{2}\ln\left(\frac{e^\pi+1}{e^\pi-1}\right)$

complex-analysiscontour-integrationdefinite integralsintegrationreal-analysis

I am trying to show that
$$I=\int_0^\pi \frac{x\cos x \sinh x}{\sin^2x+\sinh^2x}dx=\frac{\pi}{2}\ln\left(\frac{e^\pi+1}{e^\pi-1}\right)$$
I know there is an antiderivative in terms of dilogarithms and logarithms, but this nice closed form makes me think there is a clever way to get this result for these specific bounds of integration. So please avoid posting proofs with the antiderivative.

What I managed to do for now is to notice that
$$I=-\Im\int_0^\pi\frac{x}{\sin(x(1+i))}dx$$
which you get by simple computation. From here how to proceed? I'm not sure if the substitution $t=x(1+i)$ is allowed here, since I think this would become a problem of contour integration, which I usually avoid.

Here is my question:

Is there a way to obtain this result without using the antiderivative and contour integration?

Best Answer

Note the KEY trick: $$\boxed{\sin^2x+\sinh^2x=\cosh^2x-\cos^2x}\tag{0}$$

Hence, we can use $\color{red}{\text{partial fraction}}$ to split the integral:

$$\int_0^\pi \frac{x\cos x \sinh x}{\sin^2x+\sinh^2x}dx=\frac12\int_0^\pi \frac{x \sinh x}{\cosh x-\cos x}dx-\frac12\int_0^\pi \frac{x \sinh x}{\cosh x+\cos x}dx$$

From the series representation $$ \frac1{1-e^{-t+ix}}=\sum_{k=0}^\infty e^{-kt}e^{ikx},~~~~\frac1{1-e^{-t-ix}}=\sum_{k=0}^\infty e^{-kt}e^{-ikx} $$ Add them to get the real part: $$ \boxed{\frac{\sinh t}{\cosh t-\cos x}=1+2\sum_{k=1}^\infty e^{-kt}\cos(kx)}\tag{1} $$

From the series representation $$ \frac1{1+e^{-t+ix}}=\sum_{k=0}^\infty (-1)^ke^{-kt}e^{ikx},~~~~\frac1{1+e^{-t-ix}}=\sum_{k=0}^\infty (-1)^ke^{-kt}e^{-ikx} $$ Add them to get the real part: $$ \boxed{\frac{\sinh t}{\cosh t+\cos x}=1+2\sum_{k=1}^\infty(-1)^k e^{-kt}\cos(kx)}\tag{2} $$ The rest are trivial computations,

$$\begin{align}\int_0^\pi \frac{x \sinh x}{\cosh x-\cos x}dx&=\int_0^\pi xdx+2\sum_{k=1}^\infty\int_0^\pi xe^{-kx}\cos(kx)dx\\ \\ &=\frac{\pi^2}2-\pi\sum_{k=1}^\infty\frac{(-e^{-\pi})^k}{k}\\ \\ &=\frac{\pi^2}2+\pi\ln(1+e^{-\pi})\end{align}$$

Similarly

$$\begin{align}\int_0^\pi \frac{x \sinh x}{\cosh x+\cos x}dx&=\int_0^\pi xdx+2\sum_{k=1}^\infty(-1)^k\int_0^\pi xe^{-kx}\cos(kx)dx\\ \\ &=\frac{\pi^2}2-\pi\sum_{k=1}^\infty\frac{(e^{-\pi})^k}{k}\\ \\ &=\frac{\pi^2}2+\pi\ln(1-e^{-\pi})\end{align}$$

Finally,

$$\boxed{\int_0^\pi \frac{x\cos x \sinh x}{\sin^2x+\sinh^2x}dx=\frac\pi2\ln\left( \frac{1+e^{-\pi}}{1-e^{-\pi}}\right)=\frac\pi2\ln\left( \coth\left(\frac\pi2\right)\right)~}$$