Help me understand this equality for square waves that I accidentally found

51 Views Asked by At

So I was playing around on desmos when I discovered that the equation $f(x) = \tanh(a\sin(\pi x))$ produces a graph eerily similar to the square wave produced by the Fourier series $g(x) = \frac{4}{\pi}\Sigma^{\infty}_{n=1}(\frac{1}{2n-1}\sin(2n\pi x - \pi x))$ when $a$ approaches infinity. I'm very new to this level of math so I might be missing something obvious. Still, when graphed on top of each other the equations produce nearly similar plots (discounting the imperfections by the truncated Fourier series). Graph of g(x) and f(x) overlayed on top of each other. Furthermore, the graph of $y(x)=f(x)-g(x)$ gets closer and closer to zero for $\forall x$ as $a$ and the amount of terms in the Fourier series gets bigger and bigger. I'm guessing this is probably nothing but this is the first time I've made my own connection in math, so I'm excited either way. Thanks in advance for anyone who takes the time to look at this :)

1

There are 1 best solutions below

0
On

Nice observation. Basically it comes down to the fact that you are multiplying by $a$ and then letting $a\to\infty$. So

  • if $x$ is an integer then $\sin\pi x=0$ and $\tanh(a\sin\pi x))=0$;
  • if $x$ increases along the number line then, except at integers, $\sin\pi x$ alternates between positive and negative...
  • ...so if $a\to\infty$, then $a\sin\pi x$ alternates between $+\infty$ and $-\infty$...
  • ...and so $\tanh(a\sin\pi x)$ alternates between $+1$ and $-1$.