4

Plotting the series $$\displaystyle y = \sum_{k} \frac{\sin kx }{k}$$

In the limit it would look like

enter image description here

Taking a finite number of terms, I want to understand what is the reason for the jiggling at the extremes, while there the jiggling in the middle is so small its not noticable.

enter image description here

I truncated the sum to $1,2,3\; \mbox{and}\;4$ terms but cannot deduce much of a reason. enter image description here

The "jiggling" was noticeable here because the sum is linear in the limit, however, for an expression like $$p(x) = x\prod_k\Big(1-\frac{x^2}{k^2\pi^2}\Big) $$

Does the truncated expression oscillate back and forth the limit?

kuch nahi
  • 6,789
  • 10
    http://en.wikipedia.org/wiki/Gibbs_phenomenon – Qiaochu Yuan Aug 06 '11 at 18:51
  • @Qiaochu so for the second part, the answer is no? As $\sin$ is a continouous function being approximated by continuous functions, the Gibbs phenomenon should not occur. – kuch nahi Aug 06 '11 at 19:02
  • I don't understand the second question. – Qiaochu Yuan Aug 06 '11 at 19:05
  • Hmm. The Gibbs phenomenon wouldn't apply to the second question, which is if the "partial products" would jiggle around the limiting value (of $\sin x$) (Gibbs phenomenon is for Fourier series apparently). – kuch nahi Aug 06 '11 at 19:07
  • 1
    In the full product, $p(x)=\sin(x)$. The partial products are not periodic, and are unbounded as $x\to\infty$. They get better for a wider range of x as more terms are incorporated into the product, but there are no discontiuities at which to observe anything like a Gibbs phenomenon. – robjohn Aug 06 '11 at 23:02
  • IIRC, Gibbs explained why this happens after Albert Michelson observed it. The same Michelson of Michaelson--Morley fame. But I could be wrong..... – Michael Hardy Aug 07 '11 at 00:46
  • 2
    It is gratifying to see cited a Wikipedia article whose initial version I created in November 2003---a time when the few sensible people who'd heard of Wikipedia knew that it would never be of any value. – Michael Hardy Aug 07 '11 at 00:51
  • @Michael Thanks for creating the article, though as far as I remember Wikipedia was already appearing in the first two results on google in 2003 for most topics. (I was in 9th grade and had my first computer) Pagerank had already judged it to be a credible place by then :) – kuch nahi Aug 07 '11 at 01:18
  • I remember Wikipedia showing up in similar positions in Google searches then too. I think it might have reached that point in 2002. I think in those days, Google was used mostly be literate people rather than by everyone. – Michael Hardy Aug 07 '11 at 17:04

2 Answers2

6

As Qiaochu Yuan commented, this is called the Gibbs phenomenon. It happens at discontinuities because of the behavior of the Dirichlet kernel $$ D_n(x)=\sum_{k=-n}^{n}e^{ikx}=\frac{\sin((n+\frac{1}{2})x)}{\sin(\frac{x}{2})} $$ When you truncate the Fourier series of a function, $f(x)$, at the $n^{th}$ term, you get back that function convolved with the Dirichlet kernel $$ D_n*f(x)=\int_{-\pi}^\pi f(y) D_n(x-y) dy $$ Here are plots of the Dirichlet kernel for $n=3$ and its integral.

Dirichlet Kernel and Gibbs phenomenon

Note how the integral goes from $0$ to $1$, but it wiggles because of the wavy nature of the Dirichlet kernel. This wiggle is the root of the Gibbs phenomenon. As $n\to\infty$, the kernel approaches a periodic Dirac delta distribution and its integral has a steeper slope and smaller (but tighter and more numerous) wiggles.

robjohn
  • 345,667
  • 1
    I should mention that since we are using $e^{ikx}$ on $\mathbb{R}/2\pi\mathbb{Z}$ instead of $e^{2\pi ikx}$ on $\mathbb{R}/\mathbb{Z}$, we need to throw in a factor of $\frac{1}{2\pi}$ when convolving with $D_n$. This factor has been incorporated in the plot of the integral. – robjohn Aug 07 '11 at 11:15
6

It happens that in this case, the reason becomes physically obvious if you look at it the right way. Focus on the truncated portion...the part you are throwing away. In the case of sin(kx)/k, if k is 100 or more, you effectively have a whole bunch of equal sine waves with slightly different frequencies, all in phase at a single point. It is pretty clear that this sum resonate strongly when the waves are in phase, and gradually fade to zero as they go out of phase.

If you believe that the Fourrier series adds up to what it's supposed to, then it's pretty clear that when you take away the very high frequency residue, you should expect this ringing effect around the sharp corners.

Marty Green
  • 1,917