16

Spurred on by this question, I decided to investigate a more generalised form:

\begin{equation} I_{m,n} = \int_0^{\infty} \ln^m(x)\sin\left(x^n\right)\:dx \end{equation}

Where $n,m \in \mathbb{N}$

I have formed a solution in terms of the Gamma Function but I'm unsure whether it can be expressed in terms of other Non-Elementary and/or Elementary Functions. Also very interested to see other approaches (Real + Complex Analysis).

To solve, we first observe that:

\begin{equation} I_{n,k} = \lim_{\phi\rightarrow 0^+} \frac{d^m}{d\phi^m}\int_0^\infty x^\phi \sin\left(x^n\right)\:dx \end{equation}

Here let:

\begin{equation} J_{n}(\phi) = \int_0^\infty x^\phi \sin\left(x^n\right)\:dx \end{equation}

We observe that we first must solve $J_{n,k}(\phi)$. To achieve we employ Feynman's Trick coupled with Laplace Transforms. This is allowable as the integrand conforms with both Fubini's Theorem and the Dominated Convergence Theorem. Here we introduce:

\begin{equation} H_{n}(t,\phi) = \int_0^\infty x^\phi \sin\left(tx^n\right)\:dx \end{equation}

Where

\begin{equation} J_{n}(\phi) = \lim_{t\rightarrow 1^+} H_{n}(t,\phi) \end{equation}

We now take the Laplace Transform of $H_{n}(t,\phi)$ with respect to $t$:

\begin{align} \mathscr{L}_t\left[H_{n}(t,\phi)\right] = \int_0^\infty x^\phi \mathscr{L}_t\left[\sin\left(tx^n\right)\right]\:dx = \int_0^\infty x^\phi \frac{x^n}{s^2 + x^{2n}} \:dx = \int_0^\infty \frac{x^{\phi + n}}{s^2 + x^{2n}} \:dx \end{align}

Thankfully (and as I address here) this integral can be evaluated easily: \begin{align} \mathscr{L}_t\left[H_{n}(t,\phi)\right] = \int_0^\infty \frac{x^{\phi + n}}{s^2 + x^{2n}} \:dx = \frac{1}{2n} \cdot \left(s^2\right)^{ \frac{\phi + n + 1}{2n} - 1}\cdot B\left(1 - \frac{\phi + n + 1}{2n}, \frac{\phi + n + 1}{2n} \right) \end{align} Using the relationship between the Beta Function and the Gamma Function:

\begin{equation} \mathscr{L}_t\left[H_{n}(t,\phi)\right] = \frac{1}{2n} s^{ \frac{\phi + n + 1}{n} - 2}\Gamma\left(1 - \frac{\phi + n + 1}{2n} \right)\Gamma\left(\frac{\phi + n + 1}{2n} \right) \end{equation}

We now resolve $H_{n}(t, \phi)$ by taking the Inverse Laplace Transform:

\begin{align} H_{n}(t,\phi)&=\mathscr{L}_s^{-1}\left[ \frac{1}{2n} s^{ \frac{\phi + n + 1}{n} - 2}\Gamma\left(1 - \frac{\phi + n + 1}{2n} \right)\Gamma\left(\frac{\phi + n + 1}{2n} \right)\right]\\ & = \frac{1}{2n} \cdot \frac{1}{\Gamma\left(2 - \frac{\phi + n + 1}{n}\right)t^{-\left(\frac{\phi + n + 1}{n} - 2 + 1\right)} } \cdot \Gamma\left(1 - \frac{\phi + n + 1}{2n} \right)\Gamma\left(\frac{\phi + n + 1}{2n} \right) \end{align}

We can now solve $J_n(\phi)$:

\begin{equation} J_{n}(\phi) = \lim_{t\rightarrow 1^+} H_{n}(t,\phi) = \frac{\Gamma\left(1 - \frac{\phi + n + 1}{2n} \right)\Gamma\left(\frac{\phi + n + 1}{2n} \right) }{2n\:\Gamma\left(2 - \frac{\phi + n + 1}{n}\right) } \end{equation}

And finally we have

\begin{equation} I_{m,n} = \int_0^{\infty} \ln^m(x)\sin\left(x^n\right)\:dx = \lim_{\phi\rightarrow 0^+} \frac{d^m}{d\phi^m} \left[\frac{\Gamma\left(1 - \frac{\phi + n + 1}{2n} \right)\Gamma\left(\frac{\phi + n + 1}{2n} \right) }{2n\:\Gamma\left(2 - \frac{\phi + n + 1}{n}\right) } \right] \end{equation}

For example, using the example as linked above we have $m = 2$, $n = 2$:

\begin{equation} I_{2,2} = \int_0^{\infty} \ln^2(x)\sin\left(x^2\right)\:dx = \lim_{\phi\rightarrow 0^+} \frac{d^2}{d\phi^2} \left[\frac{\Gamma\left(1 - \frac{\phi + 2 + 1}{2\cdot 2} \right)\Gamma\left(\frac{\phi + 2 + 1}{2\cdot2} \right) }{2n\:\Gamma\left(2 - \frac{\phi + 2 + 1}{2}\right) } \right] \end{equation}

I was too lazy to do it by hand, but evaluated through WolframAlpha we observe that:

\begin{equation} I_{2,2} = \int_0^{\infty} \ln^2(x)\sin\left(x^2\right)\:dx = \frac{1}{32}\sqrt{\frac{\pi}{2}}(2\gamma-\pi+4\ln2)^2 \end{equation}

As required

  • 3
    You are leaps and bounds ahead of me in terms of integration skill at this point. Really great work David. – clathratus Jan 31 '19 at 16:04
  • 1
    @clathratus - Thank you for your kind words. It's just a matter of seeing where I can apply the general case I found a few weeks back. –  Feb 01 '19 at 09:50

4 Answers4

10

A method relying on the Mellin transform of the sine:

For $s>1$ and $z \in \mathbb{C}$ with $-s < \operatorname{Re} (z) < s$ we have $$ f_s (z) \equiv \int \limits_0^\infty x^{z-1} \sin(x^s) \, \mathrm{d} x = \frac{1}{s} \int \limits_0^\infty t^{\frac{z}{s}-1} \sin(t) \, \mathrm{d} t = \frac{1}{s} \mathcal{M}(\sin) \left(\frac{z}{s}\right) = \frac{1}{s} \sin \left(\frac{\pi z}{2s}\right) \operatorname{\Gamma} \left(\frac{z}{s}\right) $$ with the limit $f_s(0) = \frac{\pi}{2s}$. For $m \in \mathbb{N_0}$ and $s>1$ this implies \begin{align} I_{m,s} &\equiv \int \limits_0^\infty \ln^m(x) \sin(x^s) \, \mathrm{d} x = f_s^{(m)}(1) = \frac{1}{s} \frac{\mathrm{d}^m}{\mathrm{d} z^m} \left[\sin \left(\frac{\pi z}{2s}\right) \operatorname{\Gamma} \left(\frac{z}{s}\right)\right] \Bigg\vert_{z=1} \\ &= \frac{1}{s^{m+1}} \frac{\mathrm{d}^m}{\mathrm{d} x^m} \left[\sin \left(\frac{\pi }{2}x\right) \operatorname{\Gamma} \left(x\right)\right] \Bigg\vert_{x= 1/s} = \frac{1}{s^{m+1}} \sum \limits_{k=0}^m {m \choose k} \left(\frac{\pi}{2}\right)^k \sin^{(k)} \left(\frac{\pi}{2s}\right) \operatorname{\Gamma}^{(m-k)} \left(\frac{1}{s}\right) \, , \end{align} where the last step follows from the general Leibniz rule. The derivatives of the gamma function can be expressed in terms of polygamma functions using Faà di Bruno's formula, but otherwise that is probably as elementary as it gets.

In the special case $s=2$ we can use $$ \sin^{(k)} \left(\frac{\pi}{4}\right) = \frac{1}{\sqrt{2}} (-1)^{\lfloor k/2 \rfloor} $$ for $k \in \mathbb{N}_0$ and the values (obtained from the Legendre duplication formula) \begin{align} \operatorname{\Gamma} \left(\frac{1}{2}\right) &= \sqrt{\pi} \, , \\ \operatorname{\psi}^{(0)} \left(\frac{1}{2}\right) &= - \gamma - 2 \ln(2) \, , \\ \operatorname{\psi}^{(n)} \left(\frac{1}{2}\right) &= (-1)^{n-1} n! (2^{n+1}-1) \zeta(n+1) \, , \, n \in \mathbb{N} \, , \end{align} to simplify the final result. The complexity of Faà di Bruno's formula prevents us from finding a reasonably nice general expression for $(I_{m,2})_{m \in \mathbb{N}_0}$ , but at least we know that these integrals can be written in terms of $\pi$, $\ln(2)$, $\gamma$ and zeta values.

9

Using your own parameterized integral $J_n(\phi)$ we may use Ramanujan's Master Theorem.

Ramanujan's Master Theorem $($RMT$)$

Let $f(x)$ be an analytic function with a MacLaurin Expansion of the form $$f(x)=\sum_{k=0}^{\infty}\frac{\varphi(k)}{k!}(-x)^k$$then the Mellin Transform of this function is given by $$\int_0^{\infty}x^{s-1}f(x)dx=\Gamma(s)\varphi(-s)$$

For the purpose of exploiting this theorem we expand the sine function as its corresponding MacLaurin Series and enforce the substitution $x^n\mapsto x$ firstly and $x^2\mapsto x$ afterwards $($Note: the distinction between $x^n\mapsto x$ and $x^2\mapsto x$ instead of directly $x^{2n}\mapsto x$ is only chosen for simplicity$)$. This leads to

\begin{align*} J_n(\phi)=\int_0^\infty x^{\phi}\sin(x^n)\mathrm dx &= \int_0^\infty x^{\phi}\left[\sum_{k=0}^\infty(-1)^k\frac{(x^n)^{2k+1}}{(2k+1)!}\right]\mathrm dx\\ &=\int_0^\infty x^{\phi/n}\left[\sum_{k=0}^\infty(-1)^k\frac{x^{2k+1}}{(2k+1)!}\right]\frac{\mathrm dx}{nx^{1-1/n}}\\ &=\frac1n\int_0^\infty x^{(\phi+1)/n}\left[\sum_{k=0}^\infty(-1)^k\frac{x^{2k}}{(2k+1)!}\right]\mathrm dx\\ &=\frac1n\int_0^\infty x^{(\phi+1)/2n}\left[\sum_{k=0}^\infty(-1)^k\frac{x^k}{(2k+1)!}\right]\frac{\mathrm dx}{2x^{1/2}}\\ &=\frac1{2n}\int_0^\infty x^{(\phi+1)/2n-1/2}\sum_{k=0}^\infty\frac{\Gamma(k+1)/\Gamma(2k+2)}{k!}(-x)^k\mathrm dx \end{align*}

The new gained structure is cleary recognizable as possible application of the RMT. Therefore set $s=\frac{\phi+1}{2n}+\frac12$ and moreover $\varphi(k)=\frac{\Gamma(k+1)}{\Gamma(2k+2)}$. Thus, we get

\begin{align*} J_n(\phi)&=\frac1{2n}\int_0^\infty x^{(\phi+1)/2n-1/2}\sum_{k=0}^\infty\frac{\Gamma(k+1)/\Gamma(2k+2)}{k!}(-x)^k\mathrm dx\\ &=\frac1{2n}\Gamma\left(\frac{\phi+1}{2n}+\frac12\right)\frac{\Gamma\left(1-\left(\frac{\phi+1}{2n}+\frac12\right)\right)}{\Gamma\left(2-2\left(\frac{\phi+1}{2n}+\frac12\right)\right)}\\ &=\frac1{2n}\frac{\Gamma\left(\frac12+\frac{\phi+1}{2n}\right)\Gamma\left(\frac12-\frac{\phi+1}{2n}\right)}{\Gamma\left(1-\frac{\phi+1}n\right)}\\ &=\frac1{2n}\frac1{\Gamma\left(1-\frac{\phi+1}n\right)}\frac{\pi}{\sin\left(\frac{\phi+1}{2n}\pi+\frac\pi2\right)}\\ &=\frac1{n}\frac1{\Gamma\left(1-\frac{\phi+1}n\right)}\frac{\pi}{2\cos\left(\frac{\phi+1}{2n}\pi\right)}\frac{\sin\left(\frac{\phi+1}{2n}\pi\right)}{\sin\left(\frac{\phi+1}{2n}\pi\right)}\\ &=\frac1n\Gamma\left(\frac{\phi+1}n\right)\sin\left(\frac{\phi+1}{2n}\pi\right) \end{align*}

$$\therefore~J_n(\phi)~=~\int_0^\infty x^{\phi}\sin(x^n)\mathrm dx~=~\frac1n\Gamma\left(\frac{\phi+1}n\right)\sin\left(\frac{\phi+1}{2n}\pi\right)$$

From hereon we can deduce the same formulae ComplexYetTrivial's answer contains, and which he already did quite well by invoking Leibniz rule and Faà di Bruno's formula. The crucial point of this post is to present another possible derivation in order to obtain the Mellin Transform of the sine function. In my opionion using the RMT explains the close connection to the Gamma Function quite well. Of course, one has to be careful with the choice of $\phi$ and $n$ hence an occuring negative integer value within on of the Gamma Functions in the nominator would cause an indefinite expression.

$$\therefore~I_{m,n}~=~\int_0^\infty \ln^m(x)\sin(x^n)\mathrm dx~=~\lim_{\phi\to0}\frac{\mathrm d^m}{\mathrm d\phi^m}\left[\frac1n\Gamma\left(\frac{\phi+1}n\right)\sin\left(\frac{\phi+1}{2n}\pi\right)\right]$$

mrtaurho
  • 16,663
  • For your final expression, is it meant to be the mth derivative? –  Feb 01 '19 at 00:17
  • 1
    @DavidG Yes, of course. I forgot to write down the $m$. I will fix this right now. – mrtaurho Feb 01 '19 at 06:14
  • Just wanted to check (worried I may have missed something). Btw, love your solution (+1) –  Feb 01 '19 at 09:46
2

Let $y=x^n$, then $$ \begin{aligned} \int_0^{\infty} \ln ^m x \sin \left(x^n\right) d x& =\int_0^{\infty} \ln ^m\left(y^{\frac{1}{n}}\right) \sin y \cdot \frac{1}{n} y^{\frac{1}{n}-1} d y \\ & =\frac{1}{n^{m+1}} \int_0^{\infty} y^{\frac{1}{n}-1} \ln ^m y \sin y d y \end{aligned} $$ Meanwhile, $$ \begin{aligned} \int_0^{\infty} y^{a-1} \sin y d y & =-\operatorname{Im} \int_0^{\infty} y^{a-1} e^{-y i} d y \\ & =-\Im\left(\frac{\Gamma(a)}{i^a}\right) \\ & =-\Im\left(\Gamma(a) e^{-\frac{\pi a}{2} i}\right)\\&=\Gamma(a) \sin \frac{\pi a}{2} \end{aligned} $$ Hence $$ \begin{aligned} I & =\left.\frac{1}{n^{m+1}} \frac{\partial^m}{\partial a^m} \int_0^{\infty} y^{a-1} \sin yd y\right|_{a=\frac{1}{n}} \\ & =\left.\frac{1}{n^{m+1}} \frac{\partial^m}{\partial a^m}\left(\Gamma(a) \sin \frac{\pi a}{2}\right)\right|_{a=\frac{1}{n}} \end{aligned} $$ By Leibniz’s Rule, we have $$ \boxed{\int_0^{\infty} \ln ^m x \sin \left(x^n\right) d x =\frac{1}{n^{m+1}} \sum_{k=0}^m\binom{m}{k} \frac{\pi^k}{2^k} \Gamma^{(n-k)}\left(\frac{1}{n}\right) \sin \left(\frac{\pi}{2}\left(k+\frac{1}{n}\right)\right)} $$

Lai
  • 31,615
0

I would like to expand more on the answer @Lai has given, particularly justifying the step of:

$$\frac{d^m}{da^m}\int_0^{\infty}x^{a-1}\sin (x) dx = \int_0^{\infty}x^{a-1}(\ln (x))^m\sin (x) dx$$

because Leibniz Rule on Improper Integrals requires extra care, and at minimum one wants these additional conditions (because we're interchanging a derivative and a limit):

  1. $\int_0^{\infty}h(a,x) dx$ converges pointwise
  2. $\int_0^{\infty}\frac{d}{da}h(a,x)dx$ uniformly converges for all $a$ defined

where $h(a,x) = \frac{d^{m-1}}{da^{m-1}}x^{a-1}\sin (x)$ here

A stronger version can be used here (since uniform convergence implies pointwise convergence):

  1. $\int_0^{\infty} x^{a-1}\sin (x) dx$ converges pointwise
  2. $\int_0^{\infty} x^{a-1}(\ln (x))^m\sin (x) dx$ uniformly converges for all $a$ defined and natural $m\geq 1$

I am going to restrict $a \in \big(0,\frac12\big]$ after the following section (I'll explain why later)

$\\$

The Preparation:

Suppose $a \in (0,1)$

$\implies \int_0^\infty t^{a-1} \sin(t)\,dt = \mathrm{Im}(i^a \Gamma(a)) = \Gamma(a) \sin\left( \frac{\pi a}{2} \right)$

Hence, the integral $\int_0^\infty t^{a-1} \sin(t)\,dt$ converges pointwise for all $a \in (0,1)$

[The actual domain of convergence is $(-1,1)$. Moreover, this can be analytically continued to any complex $a$ except the non-positive integers via RMT]

Now additionally consider $x > 0$,

$I(a,x) = \int_0^x t^{a-1} \sin(t)\,dt$

Hence,

$I(a,x) = \Gamma(a) \sin\left( \frac{\pi a}{2} \right) + \left( - \int_x^\infty t^{a-1} \sin(t)\,dt \right) = \Gamma(a) \sin\left( \frac{\pi a}{2} \right) + I^*(a,x)$

$\implies \int x^{a-1} \sin(x)\,dx = I^*(a,x) + C$ in this domain

Also,

$|I^*(a,x)| = \left| \left[ -t^{a-1} \cos(t) \right]_x^\infty + (a-1) \int_x^\infty t^{a-2} \cos(t)\,dt \right|$

$\leq x^{a-1} |\cos(x)| + |a-1| \int_x^\infty t^{a-2} |\cos(t)|\,dt$

$\leq x^{a-1} + (1-a) \int_x^\infty t^{a-2}\,dt$

$= 2x^{a-1}$

And lastly, we have

$\Gamma(a,x) = \int_x^\infty u^{a-1} e^{-u}\,du = x^{a-1} e^{-x} \int_0^\infty \left(1 + \frac{v}{x} \right)^{a-1} e^{-v}\,dv$

Hence,

$\frac{\Gamma(a,x)}{x^{a-1} e^{-x}} = \int_0^\infty \left(1 + \frac{v}{x} \right)^{a-1} e^{-v}\,dv \leq \int_0^\infty e^{-v}\,dv = 1$

$\implies \Gamma(a,x) \leq x^{a-1} e^{-x}$

$\\$

The Base Case:

Let $g_m(a,x) = x^{a-1} (\ln(x))^m \sin(x)$ for natural $m \geq 1$

Consider $a \in \left(0, \frac{1}{2} \right]$

We note that $g_m(a,x)$ is continuous on the compact region $\left[0, \frac12\right] ×[0,R]$ for all natural $m \geq 1$ when we set $g_m(a,0) = 0$, and hence it is bounded which implies it’s integrable (in $x$ here). The same is the case with $f(a,x) = x^{a-1} \sin(x)$

We now consider $R > 1$

Then,

$\left| \int_0^R g_1(a,x) dx - \int_0^\infty g_1(a,x) dx \right| = \left| \int_R^\infty g_1(a,x) dx \right|$

$= \left| \left[ \ln(x) I^*(a,x) \right]_{x=R}^{x=\infty} - \int_R^\infty \frac{1}{x} I^*(a,x) dx \right|$

$= \left| \lim_{x \to \infty} \left( \ln(x) I^*(a,x) \right) + \ln(R) \int_R^\infty t^{a-1} \sin(t) dt + \int_R^\infty \int_x^\infty \frac{t^{a-1} \sin(t)}{x} dt dx \right|$

$\leq \ln(R)\left|\int_R^\infty t^{a-1} \sin(t) dt\right| + \int_R^\infty \frac{1}{x}\left| \int_x^\infty t^{a-1} \sin(t) dt\right| dx$

$\leq 2 \ln(R) R^{a-1} + 2\int_R^{\infty} x^{a-2}dx$

$\leq 2 \ln(R) R^{a-1} + \frac{2}{1 - a} R^{a - 1} = 2 (\ln(R))^1 R^{a - 1} + \frac{2(1)}{1 - a} (\ln R)^{1 - 1} R^{a - 1} = T_1(R)$

Hence,

$\sup_{a \in (0, \frac{1}{2}]} \left| \int_0^R g_1(a,x) dx - \int_0^\infty g_1(a,x) dx \right|$

$\leq 2(\ln(R)) R^{-\frac{1}{2}} + 4(1)(\ln(R))^{1 - 1} R^{-\frac{1}{2}} = T_1^*(R)$

Also, $\lim_{R \to \infty} T_1^*(R) = 0$

Hence,

$\forall \varepsilon > 0, \exists R_0 > 1$ s.t. $\forall R > R_0, T_1^*(R) < \varepsilon$

$\implies \sup_{a \in (0, \frac{1}{2}]} \left| \int_0^R g_1(a,x) dx - \int_0^\infty g_1(a,x) dx \right| < \varepsilon$

$\implies \int_0^R g_1(a,x) dx \rightrightarrows \int_0^\infty g_1(a,x) dx$ on $\left(0, \frac{1}{2} \right]$, let this be our base case

$\\$

The Inductive Step:

Now assume,

$\sup_{a \in (0, \frac{1}{2}]} \left| \int_0^R g_m(a,x) dx - \int_0^\infty g_m(a,x) dx \right|$

$\leq 2(\ln(R))^m R^{-\frac{1}{2}} + 4m(\ln(R))^{m - 1} R^{-\frac{1}{2}} = T_m^*(R)$

Then,

$\left| \int_0^R g_{m+1}(a,x) dx - \int_0^\infty g_{m+1}(a,x) dx \right| = \left| \int_R^\infty g_{m+1}(a,x) dx \right|$

$= \left| [(\ln(x))^{m+1} I^*(a,x) ]_{x=R}^{x=\infty} - (m+1) \int_R^\infty \frac{1}{x} (\ln(x))^m I^*(a,x) dx \right|$

$\leq (\ln(R))^{m+1} \left|\int_R^\infty t^{a-1} \sin(t)dt\right| + (m+1) \int_R^\infty \frac{(\ln(x))^m}{x} \left| \int_x^\infty t^{a-1} \sin(t)\,dt \right| dx$

$\leq 2(\ln(R))^{m+1} R^{a-1} + 2(m+1) \int_R^\infty (\ln(x))^m x^{a-2} dx$

$= 2(\ln(R))^{m+1} R^{a-1} + \frac{2(m+1)}{(1 - a)^{m+1}} \int_{(1-a)\ln(R)}^\infty u^m e^{-u} du$

$= 2(\ln(R))^{m+1} R^{a-1} + \frac{2(m+1)}{(1 - a)^{m+1}} \Gamma(m+1, (1 - a)\ln(R))$

$\leq 2(\ln(R))^{m+1} R^{a-1} + \frac{2(m+1)}{(1 - a)^{m+1}} ((1 - a)\ln(R))^m e^{-(1 - a)\ln(R)}$

$= 2(\ln(R))^{m+1} R^{a-1} + \frac{2(m+1)}{1 - a} (\ln(R))^m R^{a - 1} = T_{m+1}(R)$

Hence,

$\sup_{a \in (0, \frac{1}{2}]} \left| \int_0^R g_{m+1}(a,x) dx - \int_0^\infty g_{m+1}(a,x) dx \right|$

$\leq 2(\ln(R))^{m+1} R^{-\frac{1}{2}} + 4(m+1)(\ln(R))^m R^{-\frac{1}{2}} = T_{m+1}^*(R)$

And, we again have,

$\lim_{R \to \infty} T_{m+1}^*(R) = 0$

Thus, by induction,

$\forall \varepsilon > 0, \exists R_0 > 1$ s.t. $\forall R > R_0, T_m^*(R) < \varepsilon$

$\implies \sup_{a \in (0, \frac{1}{2}]} \left| \int_0^R g_m(a,x) dx - \int_0^\infty g_m(a,x) dx \right| < \varepsilon$

$\implies \int_0^R g_m(a,x) dx \rightrightarrows \int_0^\infty g_m(a,x) dx$ on $\left(0, \frac{1}{2} \right]$

$\\$

So we have successfully met the two conditions. The reason I set $a \in \big(0,\frac12\big]$ is because our $a$ is actually $\frac1n$ in the original integral, and at $n=1$, the integral:

$$\int_0^{\infty}(\ln (x))^m\sin (x)dx$$

diverges for any natural $m\geq1$ (yes even the oscillatory cancellations fail here unexpectedly). To see why, one may use the help of the inequality for all $x>0$:

$$\sin (x) > x - \frac{x^3}6$$

So this is why $a \in \big(0,\frac12\big]$

Therefore,

$\frac{d^m}{da^m} \int_0^{\infty} f(a,x)dx = \frac{d^m}{da^m}\lim_{R \rightarrow \infty}\int_0^R f(a,x)dx = \lim_{R \rightarrow \infty}\int_0^R g_m(a,x)dx = \int_0^{\infty}g_m(a,x)dx$

And the rest of the proof given by @Lai follows.

And expanding a bit more on the final closed form, we have:

$$I_{m,n} = \frac{1}{n^m}\Gamma\left(1+\frac{1}{n}\right)\sum_{k=0}^{m}{m \choose k}\frac{\pi^k}{2^k}B_{m-k}\left(\psi_0\left(\frac{1}{n}\right),\dots,\psi_{m-k-1}\left(\frac{1}{n}\right)\right)\sin\left(\frac{\pi}{2n}(1+kn)\right)$$

where $B_j(\psi_0, \psi_1, \dots, \psi_{n-1})$ is jth-complete Bell polynomial with $\psi_i$ being ith-polygamma function. You can search up tables for Bell polynomials online and easily compute $I_{m,n} = \int_0^{\infty}(\ln (x))^m\sin (x^n)dx$ for natural $m \geq1$ and $n > 1$

DCT was not used to show uniform convergence of $\int_0^{\infty}g_m(a,x)dx$ here (generalised Leibniz Rule) since it is not absolutely convergent for any $m \geq 1$. However, this proof can be shortened more by using van der Corput's lemma, and it gives a tighter bound on the tail: $2(\ln (R))^mR^{-\frac12}$