User:LucasVB/Iterated trigonometric functions

Iterated trigonometric functions are functions built by using trigonometric functions recursively. The first useful one I stumbled upon was the iterated sine function, which I defined as follows:

This function is interesting in that it arbitrarily approaches a continuous and smooth square wave, without any ringing artifacts, if you append to it a normalization factor as i tends to infinity (this is important otherwise it'll converge to zero).

I was wondering if I could approach other primitive waveforms (such as triangle and sawtooth waves) with a similar method. I found that is close to a smooth triangle wave, but I couldn't manage to make it arbitrarily close. looks like a sawtooth wave, but it gets nasty as the tangent goes to infinity.

Interestingly, iterating 7 times gets pretty close of the square sine function, but it still doesn't get arbitrarily close to it.

On the other hand, iterating cosine and tangent alone gave uninteresting results.