The problem posed in M.SE concerns real methods of evaluating

$$\int_0^{\infty} dx\frac{\log(x)}{\cosh(x) \sec(x)- \tan(x)}$$

The place I started is the nifty result, proven here, that

$$\frac{\sin{x}}{\cosh{t} – \cos{x}} = 2 \sum_{k=1}^{\infty} e^{-k t} \sin{k x}$$

Of course, the integral actually looks like

$$\int_0^{\infty} dx \frac{\cos{x}}{\cosh{x} – \sin{x}} \log{x}$$

so we need to map $x \mapsto \pi/2 – x$ and we have that the integral is actually

$$2 \sum_{m=0}^{\infty} (-1)^m \int_0^{\infty} dx \, e^{-(2 m+1) x} \cos{(2 m+1) x}\, \log{x} + 2 \sum_{m=1}^{\infty} (-1)^{m+1} \int_0^{\infty} dx \, e^{-2 m x} \sin{2 m x}\, \log{x}$$

We then note that

$$-k \int_0^{\infty} dx \, e^{-(1-i) k x} \log{x} = \frac{\log (k)}{2}+\frac{\gamma }{2}+\frac{\log (2)}{4}+\frac{\pi }{8}+i \left(\frac{\log (k)}{2}+\frac{\gamma }{2}+\frac{\log (2)}{4}-\frac{\pi }{8}\right)$$

So the integral is

$$-\sum_{m=0}^{\infty} (-1)^m \frac{\log{(2 m+1)}}{2 m+1} – \sum_{m=1}^{\infty} (-1)^{m+1} \frac{\log{(2 m)}}{2 m}\\ – \left (\gamma + \frac12 \log{2} + \frac{\pi}{4} \right )\sum_{m=0}^{\infty} \frac{(-1)^m}{2 m+1} – \left (\gamma + \frac12 \log{2} – \frac{\pi}{4} \right )\sum_{m=1}^{\infty} \frac{(-1)^{m+1}}{2 m}$$

The third and fourth sums are well known. The second is less-well known, but may be shown to be

$$\frac{1}{4} \left(3 \log ^2(2)-2 \gamma \log (2)\right)$$

(See, for example, Williams & Hardy, The Red Book of Mathematical Problems, problem 71.)

The first sum, however, is less well known. It may be evaluated by considering the derivative of a generalized zeta function (or a Lerch transcendent). The result is

$$\sum_{m=0}^{\infty} (-1)^m \frac{\log{(2 m+1)}}{2 m+1} = \frac12 \log{2} \left [\psi{\left ( \frac{3}{4} \right )} – \psi{\left ( \frac{1}{4} \right )} \right ] – \frac14 \left [ \gamma_1{\left ( \frac{3}{4} \right )}-\gamma_1{\left ( \frac{1}{4} \right )}\right ]$$

where $\gamma_1(a)$ is a generalized Stieltjes constant.

Put this all together and the result agrees with a numerical evaluation performed with Mathematica ($\approx -1.35775$).

Apparently I forgot that I had encountered that first sum some time ago here, and the result may be expressed in simpler terms:

$$\sum_{m=1}^{\infty} (-1)^{m} \frac{\log{(2 m+1)}}{2 m+1} = -\frac{\pi}{4} \gamma – \frac{\pi}{4} \log{\frac{\Gamma{\left ( \frac{3}{4} \right )}^4}{\pi}}$$

so we may now put this all together as follows:

$$\frac{\pi}{4} \gamma + \frac{\pi}{4} \log{\frac{\Gamma{\left ( \frac{3}{4} \right )}^4}{\pi}} – \frac{3}{4} \log^2{2} + \frac12 \gamma \log{2} – \left (\gamma + \frac12 \log{2} + \frac{\pi}{4} \right )\frac{\pi}{4} – \left (\gamma + \frac12 \log{2} – \frac{\pi}{4} \right )\frac12 \log{2}$$

or

$$\int_0^{\infty} dx \frac{\cos{x}}{\cosh{x} – \sin{x}} \log{x} = \frac{\pi}{4} \log{\frac{\Gamma{\left ( \frac{3}{4} \right )}^4}{\pi}} – \log^2{2} – \frac{\pi^2}{16}$$

$$\int_0^{\infty} dx \frac{x \sin{x}}{\cosh{x}-\cos{x}} \log{x} = \frac{1}{6} \pi ^2 \left(-12 \log{A}+1+\frac{\log{2}}{2}+\log{\pi} \right)$$
where $A$ is Glaisher’s constant.
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://residuetheorem.com/2014/10/29/real-evaluation-of-an-improper-log-integral/", "fetch_time": 1519189172000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2018-09/segments/1518891813431.5/warc/CC-MAIN-20180221044156-20180221064156-00345.warc.gz", "warc_record_offset": 301863084, "warc_record_length": 9284, "token_count": 1281, "char_count": 3071, "score": 4.15625, "int_score": 4, "crawl": "CC-MAIN-2018-09", "snapshot_type": "latest", "language": "en", "language_score": 0.6020161509513855, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00043-of-00064.parquet"}