This question brought to my attention the Glasser function $G(x)=\int_0^x \sin(t\sin t)\,\mathrm{d}t$.
Surely there are many variations and generalizations we could look into, but this one seems to have a name already so it's a nice place to start.
The MathWorld article says this is problem 785 listed in a 1990 volume of Nieuw Archief voor Wiskunde (New Archive for Mathematics), which is probably only available physically overseas. It's also listed as problem 12767 in Genautica's compilation of 20,000 math problems, with a defunct hyperlink to umr.edu.
Anyway, look at the graph. I'd classify the crests/valleys (i.e. local maxima and minima resp.) into two types: major and minor. A major valley always immediately precedes a major crest. There are zero minor crests or valleys between the first and second major crests, one between the second and third major crest, two between the third and fourth major crests, and so on.
According to the MathWorld article:
- This valley-crest pattern holds indefinitely.
- We have the asymptotic $G(x)\sim 2\sqrt{x/\pi}$
Question. How do we justify these two properties?
The extrema occur where $G'(x)=\sin(x\sin x)=0$. I made a table of all solutions in the interval $[0,20]$, labelled the extrema (MC = major crest, MV = major valley, mc = minor crest, mv = minor valley), and tagged each $x$ with the integer value of $k$ in $x\sin x=k\pi$. The first thing that jumped out to me is how the values where $k=0$ are not the major extrema (which was my first guess before I checked out the second's $x$ coordinate), but rather just before the middle of the minor extrema! Indeed, from left to right, the value of $k$ (as a function of $x$) bounces down and up and down and up and so on, exactly one more each time. Dunno how to prove any of this, though.
I'm not actually sure how to analytically even define what's a major extrema vs. a minor one.
Indeed, an asymptotic series would be even more welcome than just the asymptotic. The only situation I've encountered for such asymptotic series involved judicious choices of integration-by-parts, but I have no idea what kind of parts to use for such a strange integrand.
Also interesting is the constant $\sqrt{\pi}/2$ is the Gaussian integral $\int_0^\infty e^{-t^2}\,\mathrm{d}t$. Relevant?
From the graph (especially extending out to to $x=60$ or beyond), it seems like we could write $G(x)=g(x)+\phi(x)+\psi(x)$, where:
- $g(x)$ is an increasing step function (like the prime counting function) whose jumps occur between adjacent major valley/crests and whose level heights are about the midpoint of the sequence of minor valleys/crests between major ones;
- $\phi(x)$ is oscillatory, with shrinking amplitude but otherwise about constant frequency, representing the major valleys/crests; and
- $\psi(x)$ is oscillatory with shrinking amplitude and linearly increasing frequency (so to speak), representing the minor valleys/crests.

