Is the function $f(x)=\int_0^{\infty} \left[ 1 - a^x \sin \left( \frac{1}{a^x} \right) \right] da$ writable in a nicer way? I was idly exploring properties of this strange function exploiting wolframalpha and I can't understand it. Some calculus seems to show that this function is defined only for $x>\frac{1}{2}$ (if $x \le \frac{1}{2}$ the integral diverges) and has a minimum near $1$ (maybe in $1$?). Maybe for bigger $x$ the function has limit $1$. For $x > 1$, $f(x)$ seems takes the form $\xi(x) \Gamma \left( 1 - \frac{1}{x} \right)$ (but $\Gamma$ function is surely present even in points smaller than 1, for example $f \left( \frac{3}{5} \right) = \frac{9\sqrt{3}}{32} \Gamma \left( \frac{1}{3} \right) \approx 1,3 $) where $\xi(x)$ satisfies 
$\xi \left( \frac{4}{3} \right) = \frac{2}{7} \sqrt{2 - \sqrt{2}} $
$\xi \left( \frac{3}{2} \right) =\frac{3}{10}$
$\xi \left( 2 \right) = \frac{\sqrt{2}}{3} $
$\xi \left( 3 \right) = \frac{3\sqrt{3}}{8} $
$\xi \left( 4 \right) = \frac{2}{5} \sqrt{2 + \sqrt{2}} $
$\xi \left( 5 \right) = \frac{5}{12} \sqrt{\frac{5+\sqrt{5}}{2}} $
$\xi \left( 6 \right) = \frac{3}{7} \sqrt{2+\sqrt{3}} $
... I can't see a pattern and I have no idea of how wolframalpha was able to solve these integrals (but it can't solve the general integral, it solves only if I assign a value to $x$). In addiction $f(1)$ has the simple value $\frac{\pi}{4}$, this suggests an charming way of seeing $\pi$: it is the area under this pathological function


 A: The substitution $u = a^{-x}$ yields
$$ f(x) = \int \limits_0^\infty [1 - a^x \sin(a^{-x})] \, \mathrm{d} a = \frac{1}{x} \int \limits_0^\infty \frac{u - \sin(u)}{u^{2 + \frac{1}{x}}} \, \mathrm{d} u \, .$$
The integrand behaves like $u^{1 - \frac{1}{x}}$ near $u = 0$, so $x > \frac{1}{2}$ is indeed necessary (and sufficient) for the integral to converge. Now we can integrate by parts twice to obtain
$$ f(x) = \frac{1}{1+x} \int \limits_0^\infty \frac{1 - \cos(u)}{u^{1+\frac{1}{x}}} \, \mathrm{d} u = \frac{x}{1+x} \int \limits_0^\infty \frac{\sin(u)}{u^{\frac{1}{x}}} \, \mathrm{d} u \, .$$
The remaining integral has already been calculated here and we find the dependence on the gamma function you have predicted:
$$ f(x) = \frac{x}{1+x} \cos\left(\frac{\pi}{2x}\right) \operatorname{\Gamma} \left(1-\frac{1}{x}\right) \, .$$
Euler's reflection formula and the recurrence relation allow us to rewrite the result as
$$ f(x) = \frac{\pi}{2 x \sin\left(\frac{\pi}{2x}\right) \operatorname{\Gamma} \left(2+\frac{1}{x}\right)} = \frac{1}{\operatorname{sinc}\left(\frac{\pi}{2x}\right) \operatorname{\Gamma} \left(2+\frac{1}{x}\right)} \, , $$
from which $f(1) = \frac{\pi}{4}$ is obvious. We also see that $\lim_{x \to \infty} f(x) = 1$ holds. The minimum is located at $x \simeq 1.084$.
