# How may we show that $\int_{0}^{\infty}{{\cos\left({2x\over \pi}\right)-\cos^2\left({2x\over \pi}\right)}\over x^2}\cdot\ln(x)\,\mathrm dx=-\ln(2)?$

Simple closed form given by this complicated integral

$$\int_{0}^{\infty}{{\cos\left({2x\over \pi}\right)-\cos^2\left({2x\over \pi}\right)}\over x^2}\cdot\ln(x)\,\mathrm dx=-\ln(2)\tag1$$

Making an attempt:

Splitting $(1)$ results in the integral to be diverges.

$$I(a)=\int_{0}^{\infty}{{\cos\left({2x\over \pi}\right)-\cos^2\left({2x\over \pi}\right)}\over x^a}\cdot\ln(x)\,\mathrm dx\tag2$$

$$I'(a)=\int_{0}^{\infty}{{\cos\left({2x\over \pi}\right)-\cos^2\left({2x\over \pi}\right)}\over x^a}\,\mathrm dx\tag3$$

$$I'(2)=\int_{0}^{\infty}{{\cos\left({2x\over \pi}\right)-\cos^2\left({2x\over \pi}\right)}\over x^2}\,\mathrm dx\tag4$$

$u={2x\over \pi}$

$$I'(2)={2\over \pi}\int_{0}^{\infty}{{\cos\left({u}\right)-\cos^2\left({u}\right)}\over u^2}\,\mathrm du=I_1-I_2\tag5$$ Recall from table of integral, I was thinking of using $(6)$ for $I_1$ but it is only valid for $0\le p\le 1$ $$\int_{0}^{\infty}{\cos x\over x^p}\,\mathrm dx={\pi\over 2\Gamma(p)\cos(p\pi/2)}\tag6$$

How may we prove (1)?

• Frullani's theorem could be very usefull here – tired Apr 26 '17 at 6:26
• If you (OP) should follow the approach in the question, you should introduce $I(a)$ without the logarithm in the integral. Then, the logarithm appears when differentiating. As it stands now, it is wrong. – mickep Apr 26 '17 at 7:22
• I am really curious: what is your source for the (sometimes rather involved) integrals you propose? – Jack D'Aurizio Apr 26 '17 at 13:09
• First of all, I am thankful for your great effort in answering most of the questions. I took most ideas from this site and other like wolfram and Wikipedia and I just play around with it using CAS plus some algebra and thoughts.** Nothing so special how I got these formulas. ** Nearly every formula I gave I gave the answer too. I don't gave formulas without closed form because the integrals could be unsolvable. I will try my best and link the sources next time. – gymbvghjkgkjkhgfkl Apr 26 '17 at 19:56


• An interesting technique! – gymbvghjkgkjkhgfkl Apr 27 '17 at 5:58
• @Latte' Thanks. Just basic Trigonometry. – Felix Marin Apr 27 '17 at 5:59
• That is power(understanding), solving big problem with basic formula.(+1) – gymbvghjkgkjkhgfkl Apr 27 '17 at 6:04
• Concise and complete (+1). – Mark Viola Apr 27 '17 at 14:46
• (+1) This hurts so bad, I did not notice such splendid cancellation :D – Jack D'Aurizio Apr 27 '17 at 14:55

I will propose an alternative (but extremely similar to tired's) approach.
By the Laplace transform, for any $k>0$ and any $\alpha\in(1,3)$ we have

$$\int_{0}^{+\infty}\frac{1-\cos(kx)}{x^\alpha}\,dx = k^{\alpha-1}\int_{0}^{+\infty}\frac{1-\cos(x)}{x^{\alpha}}\,dx =\frac{k^{\alpha-1}}{\Gamma(\alpha)}\int_{0}^{+\infty}\frac{s^{\alpha-2}}{1+s^2}\,ds\tag{1}$$ and the last integral can be computed through the Beta function. In particular we get:

$$\int_{0}^{+\infty}\frac{1-\cos(kx)}{x^\alpha}\,dx = \frac{\pi\,k^{\alpha-1}}{2\cos\left(\frac{\pi}{2}(a-2)\right)\Gamma(\alpha)} \tag{2}$$ and by differentiating both sides with respect to $\alpha$ we simply get: $$g(k)=\int_{0}^{+\infty}\frac{1-\cos(kx)}{x^2}\log(x)\,dx = \frac{k\pi}{2}\left(1-\gamma-\log k\right) \tag{3}$$ so the original integral equals:

$$\int_{0}^{+\infty}\frac{\cos\left(\frac{2x}{\pi}\right)-\cos^2\left(\frac{2x}{\pi}\right)}{x^2}\log(x)\,dx = \frac{1}{2}\,g\left(\frac{4}{\pi}\right)-g\left(\frac{2}{\pi}\right)=\color{red}{-\log 2}\tag{4}$$ as wanted.

• Jack, how does one arrive at the RHS of $(1)$? It's 1:16 a.m. and I'm too tired to proceed. – Mark Viola Apr 27 '17 at 6:17
• @Dr.MV: Laplace transform of $1-\cos x$, inverse Laplace transform of $\frac{1}{x^\alpha}$. – Jack D'Aurizio Apr 27 '17 at 6:24
• Yes, I thought so. But doing calculations in my head, I couldn't get a reciprocal $\Gamma$ term. Alas, I found a piece of paper and pen, and performed the integration around the branch cut. Then, applying the reflection principal recovered the result herein. Thanks Jack and (+1). – Mark Viola Apr 27 '17 at 14:45
• @JackD'Aurizio: I am surprised that nobody mentioned Frullani's integral. – Lucian Sep 1 '17 at 19:07

Define

$$I(b)=\int_0^{\infty}\frac{\cos(b x)-\cos^2(b x)}{x^2}\log(x)$$

so the integral in question is $I(2/\pi)$. Now

$$-I'(b)=\int_0^{\infty}\frac{\sin(b x)(1-2\cos(b x))}{x}\log(x)\underbrace{=}_{xb\rightarrow y}\\I'(1)-\log(b)\int_0^{\infty}\frac{\sin(x)(1-2\cos(x))}{x}=I'(1)$$

or

$$I(b)=-bI'(1)+c$$

now $I'(1)$ can be calculated pretty straightfowardy from using $2\cos(x)\sin(x)=\sin(2x)$ .

$$I'(1)=\log(2)\int_0^{\infty}\frac{\sin(x)}{x}=\log(2)\frac{\pi}{2}$$

Afterwards the only thing left is to fix $c$ which can be done by observing that $\lim_{b\rightarrow 0}I(b)=0$ which follows from the Taylorexpansion of $\cos(bx)-\cos^2(bx)$. This means

$$I(b)=-b\frac{\pi}{2}\log(2)$$

from which it follows that $I(2/\pi)=-\log(2)$ as proposed

• Omg , did you just forget to write $dx$ for each integral :O . – Zaid Alyafeai Apr 26 '17 at 9:07
• How do you justify differentiation under the integral sign? – JanG Apr 26 '17 at 11:24
• @JanG that is a very good (and non-trivial) question. since i am very busy today i try to answer it tomorrow – tired Apr 26 '17 at 17:30
• $@$tired Now I think that I know how to justify the differentiation. Use Cauchy condition for uniform convergence and integration by parts to prove that the integral involved in $I'(b)$ converges uniformly. – JanG Apr 27 '17 at 6:58
• Feynman's Trick gets a (+1) – Mark Viola Apr 27 '17 at 14:45

I will propose an answer based on integration by parts.

Put $b = \frac{2}{\pi}$. We get \begin{gather*} I = \int_{0}^{\infty}\dfrac{\cos(bx)-\cos^2(bx)}{x^2}\log(x)\, dx = \left[-\dfrac{\cos(bx)-\cos^2(bx)}{x}\log(x)\right]_{0}^{\infty}+\\[2ex]b\int_{0}^{\infty}\dfrac{2\sin(bx)\cos(bx)-\sin(bx)}{x}\log(x)\, dx + \int_{0}^{\infty}\dfrac{\cos(bx)-\cos^2(bx)}{x^2}\, dx = 0+bI_1+I_2\tag{1} \end{gather*} where \begin{gather*} I_1 =\int_{0}^{\infty}\dfrac{2\sin(bx)\cos(bx)-\sin(bx)}{x}\log(x)\, dx = \int_{0}^{\infty}\dfrac{\sin(2bx)}{x}\log(x)\, dx -\\[2ex] \int_{0}^{\infty}\dfrac{\sin(bx)}{x}\log(x)\, dx = \int_{0}^{\infty}\dfrac{\sin(bx)}{x}\log\left(\dfrac{x}{2}\right)\, dx -\int_{0}^{\infty}\dfrac{\sin(bx)}{x}\log(x)\, dx =\\[2ex] -\log(2)\int_{0}^{\infty}\dfrac{\sin(bx)}{x}\, dx = -\log(2)\int_{0}^{\infty}\dfrac{\sin(x)}{x}\, dx = -\log(2)\dfrac{\pi}{2}= -\log(2)\dfrac{1}{b} \end{gather*} and \begin{gather*} I_2 = \int_{0}^{\infty}\dfrac{\cos(bx)-\cos^2(bx)}{x^2}\, dx = \left[-\dfrac{\cos(bx)-\cos^2(bx)}{x}\right]_{0}^{\infty} +\\[2ex] b\int_{0}^{\infty}\dfrac{2\sin(bx)\cos(bx)-\sin(bx)}{x}\, dx = 0. \end{gather*} Consequently $I = -\log(2).$

• Oh, just using integration by parts. Nicely done! – mickep Apr 26 '17 at 14:19