# How to prove that $\int_{0}^{\infty}\ln^2(x)\sin(x^2)dx=\frac{1}{32}\sqrt{\frac{\pi}{2}}(2\gamma-\pi+\ln16)^2$

Wolfram Alpha provides

$$\int_{0}^{\infty}\ln^2(x)\sin(x^2)dx=\frac{1}{32}\sqrt{\frac{\pi}{2}}(2\gamma-\pi+\ln16)^2\tag{1}$$

But I haven't figured out the way to verify this result.

I know Frullani's Integral $$\ln(x)= \int_{0}^{\infty}\frac{e^{-t}-e^{-xt}}{t}dt$$ I also know $$\int_{0}^{\infty}\sin(x^2)~dx=\frac{1}{2}\int_{0}^{\infty}x^{-1/2}\sin(x)~dx$$ Then, \begin{align} \int_{0}^{\infty}\ln^2(x)\sin(x^2)dx&=\int_{0}^{\infty}\left(\int_{0}^{\infty}\frac{e^{-t}-e^{-xt}}{t}dt\right)\left(\int_{0}^{\infty}\frac{e^{-n}-e^{-xn}}{n}dn\right)\sin(x^2)~dx\\ &=\frac{1}{2}\int_{0}^{\infty}\left(\int_{0}^{\infty}\frac{e^{-t}-e^{-xt}}{t}dt\right)\left(\int_{0}^{\infty}\frac{e^{-n}-e^{-xn}}{n}dn\right)\frac{\sin(x)}{\sqrt{x}}dx\\ &=\frac{1}{2}\int_{0}^{\infty}\int_{0}^{\infty}\int_{0}^{\infty}\frac{e^{-t}-e^{-xt}}{t}\frac{e^{-n}-e^{-xn}}{n}\frac{\sin(x)}{\sqrt{x}}~dx~dn~dt\\ &=\frac{1}{2}\int_{0}^{\infty}\frac{1}{t}\int_{0}^{\infty}\frac{1}{n}\int_{0}^{\infty}(e^{-t}-e^{-xt})(e^{-n}-e^{-xn})\frac{\sin(x)}{\sqrt{x}}~dx~dn~dt\\ &=\frac{1}{2}\int_{0}^{\infty}\frac{1}{t}\int_{0}^{\infty}\frac{1}{n}\int_{0}^{\infty}(e^{-t-n}-e^{-xn-t}-e^{-xt-n}+e^{-xt-xn})\frac{\sin(x)}{\sqrt{x}}~dx~dn~dt \end{align} What should I do next? There is also a general case

$$\int_{0}^{\infty}\ln^2(x^a)\sin(x^2)dx=\frac{a^2}{32}\sqrt{\frac{\pi}{2}}(2\gamma-\pi+\ln16)^2\tag{2}$$

But I think $$(2)$$ becomes easy to prove if we can prove $$(1)$$.

• Computer algebra solves this instantly: $\frac{1}{32} \sqrt{\frac{\pi }{2}} (2 \gamma -\pi +\log (16))^2$. Is there really a need to perform this by hand? ted.com/talks/… – David G. Stork Jan 26 at 20:10
• It is an interesting video. "Hand calculating procedures teach understanding." – Larry Jan 26 at 20:16
• Did you actually watch the full video? One of Wolfram's key points was exposing the fallacy in "hand calculating procedures teach understanding." Very convincing. – David G. Stork Jan 26 at 20:29
• @DavidG.Stork I entirely disagree. I personally am interested in knowing how to preform such manual calculations as they teach me new techniques which I can apply to other problems. Also, what is the point of knowing that $\int_0^\infty \ln^2(x)\sin(x^2)\mathrm dx$ has a closed form (or exact evaluation instead of a decimal expansion) if one cannot prove it? Without a proof it is just a useless fact. – clathratus Jan 26 at 20:51
• Ok, I see. That is actually a good point. I will keep that in mind. – Larry Jan 26 at 21:12

$$I=\int_{0}^{\infty}\ln^2(x)\sin(x^2)dx \overset{x^2=t}=\int_0^\infty \frac{1}{2\sqrt t} \ln^2 (\sqrt t) \sin t dt =\frac18 \int_0^\infty t^{-1/2}\sin t \ln^2 t \,dt$$ Note that the last integral is the Mellin transform in $$s=\frac12$$ of the sine after being differentiated twice.

See for example here a proof for: $$\int_0^\infty x^{s-1}\sin x dx= \Gamma(s) \sin\left(\frac{\pi s}{2}\right)$$ $$\Rightarrow I=\frac18\frac{d^2}{ds^2}\Gamma(s) \sin\left(\frac{\pi s}{2}\right)\bigg|_{s=\frac12}$$ It's not the end of the world to differentiate that twice since the digamma function comes in our help.

From the wiki page we have: $$\Gamma'(x)=\Gamma(x)\psi(x)$$ $$\Rightarrow \frac{d}{ds}\Gamma(s) \sin\left(\frac{\pi s}{2}\right)=\Gamma(s)\psi(s)\sin\left(\frac{\pi s}{2}\right) +\frac{\pi}{2}\Gamma(s)\cos\left(\frac{\pi s}{2}\right)$$ $$\Rightarrow \frac{d^2}{ds^2}\Gamma(s) \sin\left(\frac{\pi s}{2}\right)=\frac{d}{ds}\Gamma(s)\left(\psi(s)\sin\left(\frac{\pi s}{2}\right)+\frac{\pi}{2}\cos\left(\frac{\pi s}{2}\right)\right)$$ $$=\Gamma(x)\psi(x)\left(\psi(s)\sin\left(\frac{\pi s}{2}\right)+\frac{\pi}{2}\cos\left(\frac{\pi s}{2}\right)\right)+\Gamma(s)\left(\psi_1(x)\sin\left(\frac{\pi s}{2}\right)+\frac{\pi}{2}\Gamma(s)\cos\left(\frac{\pi s}{2}\right)-\frac{\pi^2}{4}\sin\left(\frac{\pi s}{2}\right)\right)$$ And now setting $$s=\frac12$$ we get using $$\Gamma\left(\frac12\right)=\sqrt{\pi}$$, $$\psi\left(\frac12 \right)=-\gamma -2\ln 2$$,$$\ \psi_1\left(\frac12\right)=\frac{\pi^2}{2}$$ the result.

We have $$F(\alpha)=\int_{0}^{+\infty} x^\alpha \sin(x^2)\,dx = \frac{1}{2}\int_{0}^{+\infty} x^{\alpha/2-1}\sin(x)\,dx\\=\frac{1}{2\Gamma(1-\alpha/2)}\int_{0}^{+\infty} \frac{ds}{s^{\alpha/2}(s^2+1)}$$ by the properties of the Laplace transform. The last integral can be computed through the Beta and Gamma functions, producing $$F(\alpha) = \frac{1}{2}\,\Gamma\left(\frac{1+\alpha}{2}\right)\sin\left(\frac{\pi}{4}(1+\alpha)\right)$$ for any $$\alpha$$ such that $$\text{Re}(\alpha)\in(-3,1)$$. In order to prove the claim, it is enough to apply $$\lim_{\alpha\to 0}\frac{d^2}{d\alpha^2}$$ to both sides of the last identity and recall the special values of $$\Gamma,\psi$$ and $$\psi'$$ at $$\frac{1}{2}$$.

Let us rewrite your integral as $$\int_0^\infty \ln^2(x)\sin(x^2)dx=\frac{1}{8}\int_0^\infty \frac{\ln^2(x)\sin(x)}{\sqrt{x}}dx$$ To solve this integral, you can employ the following identity, which holds for any $$p\in (0,1)$$: $$\int_0^\infty x^{p-1}\sin(x)dx=\Gamma(p)\sin(\pi p/2)$$ The value of your integral can be obtained from this by differentiating both sides of this equation twice with respect to $$p$$, moving the derivative inside of the definite integral on the LHS, and making use of the known special values of the Digamma function.

This can be done by hand, but it requires a lot of algebra and would be best left to a CAS, as suggested in the comments.

Just a generalization of @Zacky's answer

$$F(a)=\int_0^{\infty}\log^2(x^a)\sin(x^2)\mathrm dx$$ Since $$\log(x^a)=\log(e^{a\log x})=a\log x$$, $$F(a)=a^2\int_0^{\infty}\log^2(x)\sin(x^2)\mathrm dx$$ $$F(a)=a^2F(1)$$ And as @Zacky showed, $$F(1)=\frac18\mathrm{D}^2_{s=\frac12}\Gamma(s)\sin\frac{\pi s}{2}=\frac1{32}\sqrt{\frac\pi2}(2\gamma-\pi+\log16)^2$$ So $$F(a)=\frac{a^2}{32}\sqrt{\frac\pi2}(2\gamma-\pi+\log16)^2$$

I will edit my answer to include a proof of my own once I find one.

• Nice, I forgot the fact that $\log(x^a)=a\log(x)$. – Larry Jan 26 at 21:14
• @Larry I legitimately can't tell if you're being sarcastic or not – clathratus Jan 26 at 21:15
• I am not being sarcastic. – Larry Jan 26 at 21:18
• @Larry Thank you for the clarification. You were very right when you mentioned that $(2)$ would be easy to prove once one had proven $(1)$. – clathratus Jan 26 at 21:20

An alternative approach is to employ Feynman's Trick and Laplace Transforms to solve:

$$$$I = \int_0^\infty\ln^2(x)\sin\left(x^2\right)\:dx$$$$

We first observe that:

$$$$I = \int_0^\infty\ln^2(x)\sin\left(x^2\right)\:dx = \lim_{k\rightarrow 0^+} \frac{d^2}{dk^2}\int_0^\infty x^k\sin\left(x^2\right)\:dx = \lim_{k\rightarrow 0^+} \frac{d^2}{dk^2} H(k)$$$$

We proceed by solving $$H(k)$$. To do so, we introduce a new parameter $$'t'$$:

$$$$J(t; k) = \int_0^\infty x^k\sin\left(tx^2\right)\:dx$$$$

(This is allowable through the Dominated Convergence Theorem). Thus:

$$$$H(k) = \lim_{t\rightarrow 1^+} J(t; k)$$$$

Using Fubini's Theorem we now take the Laplace Transform with respect to '$$t$$'

\begin{align} \mathscr{L}_t\left[J(t;k) \right] &= \int_0^\infty x^k\mathscr{L}_t\left[\sin\left(tx^2\right)\right]\:dx = \int_0^\infty \frac{x^{k + 2}}{s^2 + x^4}\:dx \end{align}

As I address here we find this becomes:

\begin{align} \mathscr{L}_t\left[J(t;k) \right] &= \frac{1}{4}\cdot \left(s^2\right)^{\frac{k + 2 + 1}{2} - 1} \cdot B\left(1 - \frac{k + 2 + 1 }{4}, \frac{k + 2 + 1 }{4} \right) = \frac{1}{4} s^{\frac{k - 1}{2}} B\left(1 - \frac{k + 3}{4} , \frac{k + 3}{4}\right) \end{align}

Using the relationship between the Gamma and Beta Function we find:

$$$$\mathscr{L}_t\left[J(t;k) \right] = \frac{1}{4} s^{\frac{k - 1}{2}} \Gamma\left(1 - \frac{k + 3}{4}\right) \Gamma\left( \frac{k + 3}{4}\right)$$$$

Using Euler's Reflection Formula we find:

$$$$\mathscr{L}_t\left[J(t;k) \right] = \frac{1}{4} s^{\frac{k - 1}{2}} \frac{\pi}{\sin\left(\pi\left(\frac{k + 3}{4}\right) \right)}$$$$

Taking the inverse Laplace Transforms is rather tricky here. To evaluate recall that:

$$$$I = \lim_{k\rightarrow 0^+} \frac{d^2}{dk^2} H(k) = \lim_{k\rightarrow 0^+} \frac{d^2}{dk^2}\left[ \lim_{t\rightarrow 1^+} J(t;k)\right]$$$$

In this process we solve for $$H(k)$$ using

$$$$H(k) = \lim_{t\rightarrow 1^+} \mathscr{L}_s^{-1}\left[\mathscr{L}_t\left[J(t; k)\right]\right]$$$$

Thus, our definition of $$I$$ becomes:

\begin{align} I &= \lim_{k\rightarrow 0^+} \frac{d^2}{dk^2} H(k) = \lim_{k\rightarrow 0^+} \frac{d^2}{dk^2}\left[ \lim_{t\rightarrow 1^+} J(t;k)\right] = \lim_{k\rightarrow 0^+} \frac{d^2}{dk^2}\left[ \lim_{t\rightarrow 1^+} \mathscr{L}_s^{-1}\left[\mathscr{L}_t\left[J(t; k)\right]\right]\right] \\ &= \lim_{t\rightarrow 1^+} \mathscr{L}_s^{-1}\left[ \lim_{k\rightarrow 0^+} \frac{d^2}{dk^2}\mathscr{L}_t\left[J(t; k)\right]\right] = \lim_{t\rightarrow 1^+} \mathscr{L}_s^{-1}\left[ \lim_{k\rightarrow 0^+} \frac{d^2}{dk^2}\left[ \frac{1}{4} s^{\frac{k - 1}{2}} \frac{\pi}{\sin\left(\pi\left(\frac{k + 3}{4}\right) \right)}\right]\right] \end{align}

Because I'm lazy, I used Wolframalpha to evaluate the second derivate at $$0$$:

\begin{align} I &= \lim_{t\rightarrow 1^+} \mathscr{L}_s^{-1}\left[ \lim_{k\rightarrow 0^+} \frac{d^2}{dk^2}\left[ \frac{1}{4} s^{\frac{k - 1}{2}} \frac{\pi}{\sin\left(\pi\left(\frac{k + 3}{4}\right) \right)}\right]\right] = \lim_{t\rightarrow 1^+} \mathscr{L}_s^{-1}\left[ \frac{\pi}{4}\left( \frac{3\pi^2}{8\sqrt{2}\sqrt{s}} + \frac{\ln^2(s)}{2\sqrt{2}\sqrt{s}} + \frac{\pi\ln(s)}{2\sqrt{2}\sqrt{s}}\right)\right] \\ &= \lim_{t\rightarrow 1^+} \left[ \frac{3\pi^3}{32\sqrt{2}} \mathscr{L}_s^{-1}\left[ \frac{1}{\sqrt{s}}\right] + \frac{\pi}{8\sqrt{2}} \mathscr{L}_s^{-1}\left[ \frac{\ln^2(s)}{\sqrt{s}}\right]+ \frac{\pi^2}{8\sqrt{2}} \mathscr{L}_s^{-1}\left[ \frac{\ln(s)}{\sqrt{s}}\right]\right] \\ &= \lim_{t\rightarrow 1^+} \left[ \frac{3\pi^3}{32\sqrt{2}} \left[ \frac{1}{\sqrt{\pi}\sqrt{t}}\right] + \frac{\pi}{32\sqrt{2}} \left[ \frac{ \left(\psi^{(0)}\left(\frac{1}{2}\right)-\ln(t)\right)^2 -\frac{\pi^2}{2}}{\sqrt{\pi}\sqrt{t}}\right]+ \frac{\pi^2}{16\sqrt{2}} \left[ \frac{ \psi^{(0)}\left(\frac{1}{2}\right)-\ln(t)}{\sqrt{\pi}\sqrt{t}}\right]\right] \\ &= \frac{3\pi^3}{32\sqrt{2}} \left[ \frac{1}{\sqrt{\pi}}\right] + \frac{\pi}{32\sqrt{2}} \left[ \frac{ \psi^{(0)}\left(\frac{1}{2}\right)^2 -\frac{\pi^2}{2}}{\sqrt{\pi}}\right]+ \frac{\pi^2}{16\sqrt{2}} \left[ \frac{ \psi^{(0)}\left(\frac{1}{2}\right)}{\sqrt{\pi}}\right] \end{align}

Noting that $$$$\psi^{(0)}\left(\frac{1}{2}\right) = -\gamma - 2\ln(2)$$$$

Where $$\gamma$$ is the Euler–Mascheroni constant.

Thus,

\begin{align} I = \frac{3\pi^3}{32\sqrt{2}} \left[ \frac{1}{\sqrt{\pi}}\right] + \frac{\pi}{32\sqrt{2}} \left[ \frac{ \left(\gamma + 2\ln(2)\right)^2 -\frac{\pi^2}{2}}{\sqrt{\pi}}\right]+ \frac{\pi^2}{16\sqrt{2}} \left[ \frac{ \gamma - 2\ln(2)}{\sqrt{\pi}}\right] = \frac{1}{32}\sqrt{\frac{\pi}{2}}(2\gamma-\pi+4\ln2)^2 \end{align}

• Very nice solution! I am a fan of your method. – clathratus Jan 28 at 16:07
• Do you use a similar technique to evaluate $$F(n)=\int_0^\infty \cos(x^n)\mathrm dx$$ – clathratus Feb 6 at 20:58
• @clathratus You definitely can – user150203 Feb 7 at 0:09


Since $$\ds{\nu \in \pars{0,1}}$$, note that

\begin{align} 0 & < \verts{\mc{I}\pars{R,\nu}} < R^{\nu + 1}\int_{0}^{\pi/4}\expo{-4R^{2}\theta/\pi}\dd\theta = {\pi \over 4}\,{1 - \exp\pars{-R^{2}} \over R^{1 - \nu}} \,\,\,\stackrel{\mrm{as}\ R\ \to\ \infty}{\LARGE\to}\,\,\, \color{red}{\large 0} \end{align}

Then, \begin{align} &\bbox[10px,#ffd]{\int_{0}^{\infty}x^{\nu}\sin\pars{x^{2}}\dd x} = \sin\pars{\bracks{\nu + 1}\,{\pi \over 4}} \int_{0}^{\infty}r^{\nu}\expo{-r^{2}}\dd r \\[5mm] \stackrel{r^{2}\ \mapsto\ r}{=}\,\,\,& {1 \over 2}\,\sin\pars{\bracks{\nu + 1}\,{\pi \over 4}} \int_{0}^{\infty}r^{\nu/2 - 1/2}\expo{-r}\dd r = {1 \over 2}\,\sin\pars{\bracks{\nu + 1}\,{\pi \over 4}} \Gamma\pars{{\nu \over 2} + {1 \over 2}} \end{align} and \begin{align} &\bbox[10px,#ffd]{\int_{0}^{\infty}\ln^{2}\pars{x}\sin\pars{x^{2}}\dd x} = \lim_{\nu \to 0^{+}} \totald[2]{}{\nu} \braces{{1 \over 2}\,\sin\pars{\bracks{\nu + 1}\,{\pi \over 4}} \Gamma\pars{{\nu \over 2} + {1 \over 2}}} \\[5mm] = &\ \bbx{{1 \over 32}\root{\pi \over 2} \bracks{\vphantom{\Large A}2\gamma - \pi + \ln\pars{16}}^{2}} \approx 0.0242 \end{align}