Calculate the integral: $\int_0^1 |\sin \log x| \,\mathrm{d}x$

definite integralsintegration

I have been trying to calculate this integral

$$\int_0^1 |\sin \log x| \,\mathrm{d}x$$

I looked at the graph, and split the integral into intervals of $e^{k \pi}$. Subtracting the intervals where it was negative
$$
\int_0^1 |\sin \log x| \,\mathrm{d}x
= \sum_{k=0}^\infty \Bigl[ \int_{e^{-2\pi k}}^{e^{-\pi (2k+1)}} – \int_{e^{-\pi (2k-1)}}^{e^{-2\pi k}} \Bigr] \sin( \log x) \,\mathrm{d}x
$$

However, I neded up with an answer of $\coth(\pi/2) e^{\pi}/2$ which turned out to be completely incorrect.

Best Answer

With the substitution $u:=-\ln x$, we want to evaluate $$I:=\sum_{n\ge 0}\int_{2n\pi}^{2(n+1)\pi}|\sin u|\exp -u du=J\sum_{n\ge 0}\exp(-2n\pi),\,J:=\int_0^{2\pi}|\sin u|\exp -u du.$$In other words, $I=\frac{J}{1-\exp -2\pi}$. But $$J=\int_0^\pi\sin u\exp -u du-\int_\pi^{2\pi}\sin u\exp -u du,$$and the indefinite integral $\sin u\exp -u =\frac12(-\sin u-\cos u)\exp -u+C$ gives $$J=\exp -\pi+\tfrac12+\tfrac12\exp -2\pi=\tfrac12(1+\exp -\pi)^2.$$Thus $I$ simplifies to $$\frac12\frac{1+\exp -\pi}{1-\exp -\pi}=\frac12\coth\frac{\pi}{2}.$$Without seeing details of your method I can't comment on how you got a spurious $\exp\pi$ factor.