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

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

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:

enter image description here

Do you see the "corridors"?

enter image description here

They long for explanation.


Solution 1:

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$).

enter image description here

The other patterns are similarly obtained with a phase shift (such as the values at half-integers, corresponding to $\cos a'n^2$).

Solution 2:

[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

  1. its periodicity

  2. the symmetry of the period

  3. its recurring patterns

All these can be explained straight forwardly in a similar way:

Periodicity

enter image description here

$$\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

enter image description here

$$\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$:

enter image description here enter image description here enter image description here

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:

enter image description here

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.