Hidden patterns in $\sin(a x^2)$ I discovered unexpected patterns in the plot of the function
$$f(x) = \sin(a\ x^2)$$
with $a = \pi/b$, $b=50000$ and integer arguments $x$ ranging from $0$ to $100000$. It's easy to understand that there is some sort of local symmetry in the plot but the existence of intricate global patterns like these






astonished me.
Is there a somehow simple explanation of these regular patterns that emerge when combining such "incommensurate" functions like $\text {sine}$ and squaring? Especially of their specific shapes, their increasing distinctness and the distances between them?

Added: This pattern I found only today somewhere in the middle of the plot:

Do you see the "corridors"?

They long for explanation.
 A: [To check it all out, you may want to visit this interactive page.]
There are several aspects of the plot of $f(x) = \sin(a x^2)$ for integer arguments $x$, that need explanation, especially

*

*its periodicity


*the symmetry of the period


*its recurring patterns
All these can be explained straight forwardly in a similar way:
Periodicity

$$\sin(a x^2) = \sin(a (c + x)^2) = \sin(a (c^2 + 2cx + x^2)) = \sin(ac^2 + 2acx + a x^2) =\sin(a x^2)$$
if $ac^2 = 2\pi m$ and $ac = \pi$ when $x$ is an integer. With $a = \pi/b$ this is fulfilled for $c = b$, provided $b$ is even. Here, $b=500$.
Symmetry of the period

$$\sin(a x^2) = \sin(a (b - x)^2) = \sin(a (b^2 - 2bx + x^2)) = \sin(ab^2 - 2abx + a x^2) = \sin(a x^2)$$
Recurring patterns
The most prominent recurring pattern is the first peak of $f(x) = \sin(a x^2)$, e.g. for $b = 5000$:
  
Let's take as an example the third of these patterns which is found exactly in the middle of the period of $f(x) = \sin(a x^2)$, i.e. at $x_0 = b/2$.
Enlarged, it looks like this:

We find:
$$\sin(a (2x)^2) = \sin(a (x_0 + 2x)^2) = \sin(a (x_0^2 + 4x_0x + 4x^2)) = $$
$$\sin(ax_0^2 +4ax_0x + 4ax^2) = \sin(\pi b/4 + 2\pi bx + 4a x^2) =  \sin(4a x^2)$$
which holds when $b$ is divisible by $8$. A similar calculation shows that in this case
$$\sin(a (2x+1)^2) = -\sin(a (x_0 + 2x+1)^2)$$
This is still not the whole story to be told, but a beginning.
A: This is the phenomenon known as aliasing, caused to the fact that you are sampling a fast-varying signal with a too low frequency. It tends to create replicas of the original signal, but dilated in time.
When $a$ is close to $2m\pi$, we have at integers
$$\sin an^2=\sin(a-2m\pi)n^2$$
which is a replica of the original function with the smaller coefficient $a'=a-2m\pi$, and this is similar to a time dilation with
$$n'=\sqrt{\frac{a'}a}n$$ so that
$$\sin an^2=\sin an'^2.$$
As you can check on the plot, the blue and green curve coincide at integers ($a=6, a'=6-2\pi$).

The other patterns are similarly obtained with a phase shift (such as the values at half-integers, corresponding to $\cos a'n^2$).
A: I found aliasing in a log table.   Just use Excel to plot the error in a four place table with E(x)= Round(Log(x),4)-Log(x) for all 9000 values from 1 to 10.  The values of the error will vary from -0.5E-4 ro +0.5E-4.  The plot will have white vertical stripes where the slope of the log function is 1/4, 1/5, etc.

A: You are plotting one part of divisibility. Interesting things happen when the modulo of the factors align.
See https://www.desmos.com/calculator/ls1kp8i78n
