14

How do we show that the given result by Mathematica is correct?

$$\int_{0}^{\infty}{\cos(x^n)-\cos(x^{2n})\over x}\cdot{\ln{x}}\mathrm dx={12\gamma^2-\pi^2\over 2(4n)^2}\tag1$$ $n>0$

Where $\gamma=0.577216...$

I would try substitution, because it may help to simplify the problem into a manage integral to deal with.

$u=x^n$

$du=nx^{n-1}dx.$

$${1\over n}\int_{0}^{\infty}{\cos(u)-\cos(u^2)\over u^{1\over n}}\cdot{\ln{u^{1\over n}}}{\mathrm dx\over u^{n-1\over n}}={12\gamma^2-\pi^2\over 2(4n)^2}$$

Simplified to

$${1\over n^2}\int_{0}^{\infty}{\cos(u)-\cos(u^2)\over u}\cdot{\ln{u}}\mathrm du={12\gamma^2-\pi^2\over 2(4n)^2}$$

We can remove $\ln{u}$ by doing another substitution

$v=\ln{u}$

$udv=du$

$${1\over n^2}\int_{-\infty}^{\infty}{\cos(e^v)-\cos(e^{2v})\over e^v}\cdot{v}\cdot{e^v}\mathrm du={12\gamma^2-\pi^2\over 2(4n)^2}$$

Then we finally simplified to

$$={1\over n^2}\int_{-\infty}^{\infty}v\cos(e^v)\mathrm dv -{1\over n^2}\int_{-\infty}^{\infty}v\cos(e^{2v})\mathrm dv$$

At this stage I would apply integration by parts but it seems to show a problem for me to do. So I need some help. Thank you.

3 Answers3

10

Define $$\mathcal{I}=\int_{0}^{\infty }\frac{\cos x-\cos x^2}{x}\, \ln x\, \mathrm{d}x$$ and $$\mathcal{I}\left ( \alpha \right )=\int_{0}^{\infty }x^{\alpha-1}\left ( \cos x-\cos x^{2} \right )\mathrm{d}x$$ and $\mathcal{I}\left(0\right)=-\dfrac{\gamma}{2} $, see a proof here.

Now let's see the integral below

$$\int_{0}^{\infty}x^{a-1}\cos\left(x^{b}\right)\,\mathrm{d}x=\frac{1}{b}\cos\left(\frac{\pi a}{2b}\right)\Gamma \left(\frac{a}{b} \right), \;\ b>a, \;\ a>1$$

Proof: Let $\displaystyle r = a/b \in (0, 1)$. Then \begin{align*} &\int_{0}^{\infty} x^{a-1} \cos(x^{b}) \, \mathrm{d}x = \frac{1}{b} \int_{0}^{\infty} \frac{\cos t}{t^{1-r}} \, \mathrm{d}t = \frac{1}{b \Gamma(1-r)} \int_{0}^{\infty} \left( \int_{0}^{\infty} u^{-r} e^{-tu} \, \mathrm{d}u \right) \cos t \, \mathrm{d}t \\ &= \frac{1}{b \Gamma(1-r)} \int_{0}^{\infty} \left( \int_{0}^{\infty} e^{-ut} \cos t \, \mathrm{d}t \right) u^{-r} \, \mathrm{d}u = \frac{1}{b \Gamma(1-r)} \int_{0}^{\infty} \frac{u^{1-r}}{u^{2} + 1} \, \mathrm{d}u \\ &= \frac{1}{b \Gamma(1-r)} \int_{0}^{\frac{\pi}{2}} \tan^{1-r} \theta\,\mathrm{d}\theta \end{align*} Simplifying using the beta function identity, we have \begin{align*} \int_{0}^{\infty} x^{a-1} \cos(x^{b}) \, \mathrm{d}x &= \frac{\Gamma\left(1-\dfrac{r}{2}\right)\Gamma\left(\dfrac{r}{2}\right)}{2b \Gamma(1-r)\Gamma(r)} \, \Gamma(r)= \frac{ \sin (\pi r)}{2b \sin \left(\dfrac{\pi r}{2}\right)} \, \Gamma(r) = \frac{1}{b} \Gamma(r) \cos \left( \frac{\pi r}{2} \right)\\ &=\frac{1}{b}\cos\left(\frac{\pi a}{2b}\right)\Gamma \left(\frac{a}{b} \right) \end{align*} Hence $$\mathcal{I}\left ( \alpha \right )=\Gamma \left ( a \right )\cos\left ( \frac{a\pi }{2} \right )-\frac{1}{2}\Gamma \left ( \frac{a}{2} \right )\cos\left ( \frac{a\pi }{4} \right )$$ Using

$$\Gamma \left ( x \right )\sim \frac{1}{x}-\gamma +\frac{6\gamma ^{2}+\pi ^{2}}{12}x+o(x)$$

Proof: \begin{align*} \lim_{x\to 0}x\Gamma(x)=\lim_{x\to 0}\Gamma(1+x)=1 \end{align*} \begin{align*} \lim_{x\to 0}\Gamma(x)-\frac{1}{x}&=\lim_{x\to 0}\frac{x\Gamma(x)-1}{x}\\ &=\lim_{x\to 0}\Gamma(x+1)\psi (x+1)=-\gamma\\ \end{align*} \begin{align*} \lim_{x\to 0}\frac{1}{x}\left(\Gamma(x)-\frac{1}{x}+\gamma\right)&=\lim_{x\to 0}\frac{\Gamma(x+1)-1+\gamma x}{x^2}\\ &=\lim_{x\to 0}\frac{\Gamma(x+1)\psi(x+1)+\gamma }{2x}\\ &=\lim_{x\to 0}\frac{\Gamma(x+1)\psi^2(x+1)+\psi'(x+1)\Gamma(x+1)}{2}\\ &=\frac{1}{2}\left(\gamma^2+\frac{\pi^2}{6}\right) \end{align*}

So, we have \begin{align*} \mathcal{I}&=\mathcal{I}'\left(0\right)\\ &=\lim_{a\rightarrow 0}\frac{\mathcal{I}\left(a\right)-\mathcal{I}\left(0\right)}{a-0}\\ &=\frac{-\dfrac{1}{2}\cos\dfrac{a\pi}{4}\Gamma\left(\dfrac{a}{2}\right)+\cos\dfrac{a\pi}{2}\Gamma\left(a\right)+\dfrac{\gamma}{2}}{a}\\ &=\lim_{a\rightarrow 0}\frac{-\dfrac{1}{2}\left(1-\dfrac{a^2\pi^2}{32}+o\left(a^2\right)\right)\left(\dfrac{2}{a}-\gamma +\dfrac{1}{12}\left(6\gamma^2+\pi^2\right)\dfrac{a}{2}+o\left(a\right)\right)+\left(1-\dfrac{a^2\pi^2}{8}+o\left(a^2\right)\right)\left(\dfrac{1}{a}-\gamma +\dfrac{1}{12}\left(6\gamma^2+\pi^2\right)a+o\left(a\right)\right)+\dfrac{\gamma}{2}}{a}\\ &=\lim_{a\rightarrow 0}\frac{\dfrac{a\pi^2}{32}-\dfrac{a}{48}\left(6\gamma^2+\pi^2\right)-\dfrac{a\pi^2}{8}+\dfrac{a}{12}\left(6\gamma^2+\pi^2\right)+o\left(a\right)}{a}\\ &=\frac{3\gamma^2}{8}-\frac{\pi^2}{32} \end{align*} Hence $$\int_{0}^{\infty}{\cos x^n-\cos x^{2n}\over x}\, {\ln{x}}\, \mathrm dx={1\over n^2}\int_{0}^{\infty}{\cos x-\cos x^2\over x}\,{\ln x}\, \mathrm dx={12\gamma^2-\pi^2\over 2(4n)^2}$$

Renascence_5.
  • 5,281
  • 1
  • 27
  • 69
  • 1
    Neat solution. I used complex analysis (again) for this one and arrived at the same answer! It has always fascinated me when two different paths forward converge. Well done. (+1). -Mark – Mark Viola Jan 17 '17 at 02:38
  • I am very sure that your answer was up voted to around 17 the last time I saw it, how come now is 8? –  Feb 07 '17 at 05:52
6

In THIS ANSWER, I used complex analysis to prove the identity

$$\int_0^\infty \frac{\cos(x)-\cos(x^2)}{x}\,dx=-\frac12 \gamma$$

We proceed analogously to tackle the problem of interest herein.


We begin with the integral $I(n)$ as given by

$$I(n)=\int_0^\infty \log(x)\,\frac{\cos(x^n)-\cos(x^{2n})}{x}\,dx \tag 1$$

Enforcing the substitution $x\to x^{1/n}$ into $(1)$ reveals

$$\begin{align} I(n)&=\frac{1}{n^2}\int_0^\infty \log(x)\,\frac{\cos(x)-\cos(x^2)}{x}\,dx\\\\ &=\frac{1}{n^2}\text{Re}\left(\int_0^\infty \log(x)\,\frac{e^{ix}-e^{ix^2}}{x}\,dx\right) \tag 2 \end{align}$$


Using Cauchy's Integral Theorem, we can show that (See the Note at the end of this post)

$$I(n)=\frac{1}{n^2}\int_0^\infty \frac{e^{-x}-e^{-x^2}}{x}\,\log(x)\,dx -\frac{3\pi^2}{32n^2}\tag 3$$

Integrating by parts the integral in $(3)$ with $u=e^{-x}-e^{-x^2}$ and $v=\frac12 \log^2(x)$ reveals

$$\begin{align} I(n)&=-\frac1{2n^2} \int_0^\infty \log^2(x)(e^{-x}-2xe^{-x^2})\,dx-\frac{3\pi^2}{32n^2}\\\\ &=-\frac{3}{8n^2}\Gamma''(1)-\frac{3\pi^2}{32n^2}\\\\ &=\frac{3}{8n^2}\left(\gamma^2+\pi^2/6\right)-\frac{3\pi^2}{32n^2}\\\\ &=\frac{3}{8n^2}\gamma^2-\frac{\pi^2}{32n^2} \end{align}$$

as was to be shown!


NOTE:

In arriving at $(3)$ we analyzed the integrals

$$\begin{align} \int_{\epsilon}^R \log(x)\,\frac{e^{ix}}{x}\,dx&=\int_0^{\pi/2} \log(\epsilon e^{i\phi})\,\frac{e^{i\epsilon e^{i\phi}}}{\epsilon e^{i\phi}}\,i\epsilon e^{i\phi}\,d\phi\\\\ &-\int_0^{\pi/2} \log(R e^{i\phi})\,\frac{e^{iR e^{i\phi}}}{R e^{i\phi}}\,iR e^{i\phi}\,d\phi\\\\ &+\int_\epsilon^R \log(ix)\,\frac{e^{-x}}{x}\,dx \tag 4 \end{align}$$

and

$$\begin{align} \int_{\epsilon}^R \log(x)\,\frac{e^{ix^2}}{x}\,dx&=\int_0^{\pi/4} \log(\epsilon e^{i\phi})\,\frac{e^{i\epsilon^2 e^{i2\phi}}}{\epsilon e^{i\phi}}\,i\epsilon e^{i\phi}\,d\phi\\\\ &-\int_0^{\pi/4} \log(R e^{i\phi})\,\frac{e^{iR^2 e^{i2\phi}}}{R e^{i\phi}}\,iR e^{i\phi}\,d\phi\\\\ &+\int_\epsilon^R \log(e^{i\pi/4}x)\,\frac{e^{-x^2}}{x}\,dx \tag 5 \end{align}$$

Combining the results of $(4)$ and $(5)$, taking the real part, and letting $\epsilon\to 0$ and $R\to \infty$ yields $(3)$.

Mark Viola
  • 179,405
  • (+1)It's also a nice approach! But I'm not familiar with complex analysis,so I prefer solving integrals with real methods. – Renascence_5. Jan 17 '17 at 02:45
  • @Renascence_5. I posted a question earlier today that asks for real analysis methods to prove $\int_0^\infty \frac{\cos(x)-\cos(x^2)}{x},dx=-\frac12 \gamma$. HERE it is. I requested refraining from tabulated results of special functions as much as possible. So, this approach might or might not be completely what I'm looking for. – Mark Viola Jan 17 '17 at 02:58
0

Comment 1: Laplace $$\displaystyle{\int\limits_0^\infty {{y^a} \cdot {e^{ - x \cdot y}}dy} = \frac{{\Gamma \left( {1 + a} \right)}}{{{x^{1 + a}}}}}$$ and $$\displaystyle{\int\limits_0^\infty {\cos y \cdot {e^{ - x \cdot y}}dy} = \frac{x}{{1 + {x^2}}}}$$ transformations (considered known).

Comment 2: From here http://mathworld.wolfram.com/GammaFunction.html (relations 39 and 35) we know $$\displaystyle{\Gamma \left( {1 + a} \right) = a \cdot \Gamma \left( a \right)}$$ as well as

$$\displaystyle{\frac{1}{{\Gamma \left( {1 + 2 \cdot m \cdot z} \right)}} = 1 + 2m\gamma \cdot z + \frac{{{m^2}}}{3}\left( {6{\gamma ^2} - {\pi ^2}} \right){z^2} + \frac{{2{m^3}}}{3}\left( {2{\gamma ^3} - \gamma {\pi ^2} + 4\zeta \left( 3 \right)} \right){z^3} + ..}$$

Comment 3: Because $$\displaystyle{\Gamma \left( z \right) \cdot \Gamma \left( {1 - z} \right) = \frac{\pi }{{\sin \pi z}}}$$ (relationship 42 above) it follows (with Taylor analysis) that

$$\displaystyle{\Gamma \left( {1 + m \cdot z} \right)\Gamma \left( {1 - m \cdot z} \right) = 1 + \frac{{{m^2}{\pi ^2}}}{6}{z^2} + \frac{{7{m^4}{\pi ^4}}}{{360}}{z^4} + ..}$$ and by product of series that

$$\displaystyle{\frac{{\Gamma \left( {1 + m \cdot z} \right)\Gamma \left( {1 - m \cdot z} \right)}}{{\Gamma \left( {1 + 2 \cdot m \cdot z} \right)}} = 1 + 2m\gamma \cdot z + {m^2}\left( {2{\gamma ^2} - \frac{{{\pi ^2}}}{6}} \right){z^2} + {m^3}\left( {\frac{{4{\gamma ^3}}}{3} - \frac{{\gamma {\pi ^2}}}{3} + \frac{8}{3}\zeta \left( 3 \right)} \right){z^3} + ..}$$

To our topic. $$\displaystyle{\int\limits_0^\infty {\frac{{\cos {x^n} - \cos {x^{2n}}}}{x}\log x\;dx} \mathop { = = = }\limits^{{x^n} \to x} \frac{1}{{{n^2}}}\int\limits_0^\infty {\frac{{\cos x - \cos {x^2}}}{x}\log x\;dx} }$$

However $$\displaystyle{\int\limits_0^\infty {\frac{{1 - \cos x}}{{{x^{a + 1}}}}\;dx} = \frac{1}{{\Gamma (a + 1)}}\int\limits_0^\infty {\left( {1 - \cos x} \right)\frac{{\Gamma (a + 1)}}{{{x^{a + 1}}}}\;dx} = \frac{1}{{\Gamma (a + 1)}}\int\limits_0^\infty {\left( {1 - \cos x} \right)\left( {\int\limits_0^\infty {{y^a}{e^{ - xy}}dy} } \right)\;dx} = }$$

$$\displaystyle{ = \frac{1}{{\Gamma (a + 1)}}\int\limits_0^\infty {{y^a}\left( {\int\limits_0^\infty {\left( {1 - \cos x} \right){e^{ - xy}}dx} } \right)\;dy} = \frac{1}{{\Gamma (a + 1)}}\int\limits_0^\infty {{y^a}\left( {\frac{1}{y} - \frac{y}{{1 + {y^2}}}} \right)\;dy} }$$ $$\displaystyle{ = \frac{1}{{\Gamma (a + 1)}}\int\limits_0^\infty {\frac{{{y^{a - 1}}}}{{1 + {y^2}}}\;dy} \mathop { = = = }\limits^{{y^2} = x} }$$

$$\displaystyle{ = \frac{1}{{2\Gamma (a + 1)}}\int\limits_0^\infty {\frac{{{x^{\frac{a}{2} - 1}}}}{{1 + x}}\;dx} = \frac{1}{{2\Gamma (a + 1)}}\int\limits_0^\infty {{x^{\frac{a}{2} - 1}}\int\limits_0^\infty {{e^{ - xw}}{e^{ - w}}dw} \;dx} = }$$ $$\displaystyle{\frac{1}{{2\Gamma (a + 1)}}\int\limits_0^\infty {{e^{ - w}}\int\limits_0^\infty {{x^{\frac{a}{2} - 1}}{e^{ - xw}}dx} \;dw} = }$$

$$\displaystyle{ = \frac{{\Gamma \left( {\frac{a}{2}} \right)}}{{2\Gamma (a + 1)}}\int\limits_0^\infty {{e^{ - w}}\frac{1}{{{w^{\frac{a}{2}}}}}\;dw = } \frac{{\Gamma \left( {\frac{a}{2}} \right)\Gamma \left( {1 - \frac{a}{2}} \right)}}{{2\Gamma (a + 1)}} \Rightarrow \int\limits_0^\infty {\frac{{1 - \cos x}}{{{x^{2a + 1}}}}\;dx} = \frac{{\Gamma \left( a \right)\Gamma \left( {1 - a} \right)}}{{2\Gamma \left( {2a + 1} \right)}} = \frac{{\Gamma \left( {1 + a} \right)\Gamma \left( {1 - a} \right)}}{{2a \cdot \Gamma \left( {2a + 1} \right)}}}$$

Namely $$\displaystyle{\int\limits_0^\infty {\frac{{1 - \cos x}}{{{x^{2a + 1}}}}\;dx} = \frac{1}{{2a}} + \gamma + \left( {{\gamma ^2} - \frac{{{\pi ^2}}}{{12}}} \right)a + \left( {\frac{{2{\gamma ^3}}}{3} - \frac{{\gamma {\pi ^2}}}{6} + \frac{4}{3}\zeta \left( 3 \right)} \right){a^2} + ..}$$

Producing as to $\displaystyle{a}$ arises $$\displaystyle{{\int\limits_0^\infty {\frac{{1 - \cos x}}{{{x^{2a + 1}}}}\log x\;dx} = \frac{1}{{4{a^2}}} - \frac{1}{2}\left( {{\gamma ^2} - \frac{{{\pi ^2}}}{{12}}} \right) - \left( {\frac{{2{\gamma ^3}}}{3} - \frac{{\gamma {\pi ^2}}}{6} + \frac{4}{3}\zeta \left( 3 \right)} \right)a + ..}}$$

Also $$\displaystyle{\int\limits_0^\infty {\frac{{1 - \cos {x^2}}}{{{x^{2a + 1}}}}\log x\;dx} \mathop { = = = }\limits^{{x^2} = y} \frac{1}{4}\int\limits_0^\infty {\frac{{1 - \cos y}}{{{y^{a + 1}}}}\log y\;dx} = \frac{1}{{4{a^2}}} - \frac{1}{8}\left( {{\gamma ^2} - \frac{{{\pi ^2}}}{{12}}} \right)}$$ $$\displaystyle{ - \left( {\frac{{2{\gamma ^3}}}{3} - \frac{{\gamma {\pi ^2}}}{6} + \frac{4}{3}\zeta \left( 3 \right)} \right)\frac{a}{8} + ..}$$

Removing $$\displaystyle{\int\limits_0^\infty {\frac{{\cos x - \cos {x^2}}}{{{x^{2a + 1}}}}\log x\;dx} = \frac{3}{8}\left( {{\gamma ^2} - \frac{{{\pi ^2}}}{{12}}} \right) + \frac{7}{8}\left( {\frac{{2{\gamma ^3}}}{3} - \frac{{\gamma {\pi ^2}}}{6} + \frac{4}{3}\zeta \left( 3 \right)} \right)a + ..}$$

Taking a limit $\displaystyle{a \to 0}$ arises $$\displaystyle{\int\limits_0^\infty {\frac{{\cos x - \cos {x^2}}}{x}\log x\;dx} = \frac{{12{\gamma ^2} - {\pi ^2}}}{{32}}} and finally \displaystyle{\int\limits_0^\infty {\frac{{\cos {x^n} - \cos {x^{2n}}}}{x}\log x\;dx} = \frac{{12{\gamma ^2} - {\pi ^2}}}{{32 \cdot {n^2}}}}$$ :) :)

Interesting is the limit $$\displaystyle{\mathop {\lim }\limits_{a \to 0} \dfrac{{\int\limits_0^\infty {\dfrac{{\cos x - \cos {x^2}}}{{{x^{2a + 1}}}}\log x\;dx} - \dfrac{{12{\gamma ^2} - {\pi ^2}}}{{32}}}}{a} = \frac{{7\left( {4{\gamma ^3} - \gamma {\pi ^2} + 8\zeta \left( 3 \right)} \right)}}{{48}}}$$

Sbsty
  • 413
  • 11