When I came across the integral $$\int_0^{\infty} \frac{e^{-x^2} \sin \left(x^2\right)}{x^2} d x,$$ I didn’t know how to deal with it. After struggling, I thought of Feynman’s trick and Euler formula and tried by letting $$I(a)=\int_0^{\infty} \frac{e^{-x^2} \sin \left(a x^2\right)}{x^2} d x$$ with $I(0)=0.$ Differentiating $I(a)$ w.r.t. $a$ yields $$ I^{\prime}(a)=\int_0^{\infty} e^{-x^2} \cos \left(a x^2\right) d x $$ Inevitably, I used the Euler formula $e^{i x}=\cos x+i \sin x$ to group the functions in terms of exponential function. $$ \begin{aligned} I^{\prime}(a) & =\int_0^{\infty} e^{-x^2} \cos \left(a x^2\right) d x \\ & =\operatorname{Re} \int_0^{\infty} e^{-x^2} e^{i a x^2} d x \\ & =\operatorname{Re} \int_0^{\infty} e^{-(1-i a) x^2} d x \end{aligned} $$ which is a Gaussian integral: $\int_{-\infty}^{\infty} e^{-a(x+b)^2} d x=\sqrt{\frac{\pi}{a}}$ for any $Re(a)>0$. $$ \begin{aligned} I’(a) &=\operatorname{Re}\left(\frac{\sqrt{\pi}}{2 \sqrt{1-i a}}\right)\\ I(a)&=\frac{\sqrt{\pi}}{2} \operatorname{Re}\left[\frac{(1-i a)^{\frac{1}{2}}}{-\frac{1}{2} i}\right]\\ \therefore \int_0^{\infty} \frac{e^{-x^2} \sin \left(x^2\right)}{x^2} d x&= \sqrt{\pi}\operatorname{Re}\left[i \sqrt{\sqrt{2} e^{-\frac{\pi i}{4}}}\right]\\& = \sqrt{\sqrt{2} \pi} \operatorname{Re}\left[i\left(\cos \frac{\pi}{8}-i \sin \frac{\pi}{8}\right)\right]\\&= \sqrt{\sqrt{2} \pi} \sin \frac{\pi}{8} \end{aligned} $$ As a bonus, $$\int_0^{\infty} \frac{e^{-x^2} \sin \left(x^2\right)}{x^2} d x = \sqrt{\sqrt{2} \pi} \cos \frac{\pi}{8} $$
My Question :Can we generalise the method to the integral$$ I_n=\int_0^{\infty} \frac{e^{-x^n} \sin \left(x^n\right)}{x^n} d x? $$
Fortunately, the answer is positive and decent as: $$ \int_0^{\infty} \frac{e^{-x^n} \sin \left(x^n\right)}{x^n} d x= \frac{2^{\frac{n-1}{2 n}}}{n-1} \Gamma\left(\frac{1}{n}\right) \sin \left(\frac{\pi(n-1)}{4 n}\right) $$ where $n$ is any real number greater than $1$.
Proof: Replacing the number 2 in the original integral by $n$ gives $$ I_n^{\prime}(a)=\operatorname{Re} \int_0^{\infty} e^{-(1-i a) x^n} d x $$ Letting $(1-i a) x^n \mapsto x$ transforms the derivative into
$$ \begin{aligned} I_n ^{\prime}(a) & =\operatorname{Re}\left[\frac{1}{n(1-i a)^{\frac{1}{n}}} \int_0^{\infty} x^{\frac{1}{n}-1} e^{-x} d x\right] \\ & =\frac{1}{n} \operatorname{Re}\left[\frac{1}{(1-i a)^{\frac{1}{2}}}\Gamma\left(\frac{1}{n}\right)\right] \\ & =\frac{1}{n} \Gamma\left(\frac{1}{n}\right) \operatorname{Re}\left[\frac{1}{(1-i a)^{\frac{1}{n}}}\right] \end{aligned} $$ Integrating back yields
$$ \begin{aligned} I_n(1)-I_n(0) & =\frac{1}{n} \Gamma\left(\frac{1}{n}\right) \operatorname{Re} \int_0^1(1-i a)^{-\frac{1}{n}} d a \\ I(1)& =\frac{1}{n} \Gamma\left(\frac{1}{n}\right) \operatorname{Re}\left[\frac{(1-i a)^{-\frac{1}{n}+1}}{-i\left(\frac{1}{n}+1\right)}\right]_0^1 \\ & =\frac{1}{n-1} \Gamma\left(\frac{1}{n}\right) \operatorname{Re}\left(i(1-i)^{\frac{n-1}{n}}\right) \end{aligned} $$ Now we can conclude that
$$ \begin{aligned} I& =\frac{1}{n-1} \Gamma\left(\frac{1}{n}\right) \operatorname{Re}\left[i\left(\sqrt{2} e^{-\frac{\pi}{4}}\right)^{\frac{n-1}{n}}\right] \\ & =\frac{1}{n-1} \Gamma\left(\frac{1}{n}\right) \operatorname{Re}\left[i 2^{\frac{n-1}{2 n}} e^{-\frac{\pi(n-1)}{4 n}}\right] \\ & =\frac{2^{\frac{n-1}{2 n}}}{n-1} \Gamma\left(\frac{1}{n}\right) \sin \left(\frac{\pi(n-1)}{4 n}\right) \end{aligned} $$
Any comments and alternative methods are highly appreciated.