[Math] How to make a function periodic

periodic functionspolynomialstrigonometry

I have a nice little equation here, $f\left(x\right)=\frac{4}{\pi ^2}\left(x+\frac{\pi }{2}\right)^2-1$, which ever so nicely approximates (with somewhat good accuracy), a period of the sine function, and then goes to nothingness (because it's a parabola). Using the inverse of the function I can get the other period of the sine function.

How do I "combine" these two equations (the equation and it's inverse) to make one periodic function representing $\sin\left(x\right)$?

This desmos graph may help.

Best Answer

Define it to be periodic. Let $y=x \pmod {2 \pi}$, then $$f(x)=\begin {cases} \frac 4{\pi^2}\left(y-\frac \pi 2\right)^2-1&0 \le y \le \pi\\-\frac 4{\pi^2}\left(y-\frac {3\pi} 2\right)^2-1&\pi \le y \le 2\pi\end {cases}$$ This is a fine function. It returns a unique value for each input.

Related Question