I'm reading a lecture about Fourier series ,

and it says that you can represent any continuous function as Fourier series.

There's a given example:

Let $f(x) = x$. $f(x) \approx \sum_{n=1}^\infty \frac{2(-1)^{n+1}}{n}\sin(nx).$

So I can understand that $5 = f(5) = \sum_{n=1}^\infty \frac{2(-1)^{n+1}}{n}\sin(5n)$

According to wolframalpha, the sum of this series is $\approx -1.283$

What is wrong here ..?

  • 1
    $\begingroup$ Here is a nice visualization of this series converging on the interval $(-\pi,\pi)$: sosmath.com/fourier/pic/pic01.gif. Notice that the series is already a disaster at the edges. $\endgroup$ – Slade Jan 22 '14 at 18:02

This Fourier series represents the function in the interval $(-\pi,\pi)$ and converges everywhere to $f$ in that interval.

As you can already see from the formula, the Fourier series is periodic with period $2\pi$, it can therefore impossibly represent $f(x)=x$ on the entire real axis.

Note that already for $x=\pm \pi$ it doesn't represent $f$ anymore since $\sin(\pm n \pi)=0$ for all natural numbers $n$.

As noted in the comment by ccorn, this also explains the value you got. Since $3\pi>5>\pi$ you are in the period $(\pi,3\pi)$, therefore the value of the Fourier series there should be $5-2\pi\approx-1.283$.

  • 3
    $\begingroup$ (+1) This also explains the sum as $5-2\pi$. $\endgroup$ – ccorn Jan 22 '14 at 18:02
  • $\begingroup$ Thank you very much for answering! If I understand, Fourier series represent only the $[-\pi , \pi]$ domain of the function? $\endgroup$ – Billie Jan 23 '14 at 7:38
  • 1
    $\begingroup$ Actually only $(-\pi,\pi)$, without the endpoints as noted. $\endgroup$ – J.R. Jan 23 '14 at 9:18
  • $\begingroup$ Ok, thank you very much! $\endgroup$ – Billie Jan 23 '14 at 9:49

Fourier Series are used when considering periodic functions, i.e. functions which repeat after a given interval. Both sine and cosine are periodic functions; they repeat every $2\pi$.

The Fourier Series that you have given above is for the "$2\pi$-periodic extension" of function $\mathrm{f}(x)=x$. This graph is just $y=x$ when $-\pi < x < \pi$, but then it repeates over and over:

enter image description here

The Fourier series you give above approximates this periodic function. Below are plots of the first five and then first 20 terms of the Fourier Series:

enter image description here enter image description here

The periodic extension does not have the property that $\mathrm{f}(5)=5$. When $x$ is bigger than $\pi$, the function repeats. We have $\mathrm{f}(x) = \mathrm{f}(x\pm 2\pi)$. The Fourier Series that you give has the property that $\mathrm{f}(5) = \mathrm{f}(5-2\pi) = 5-2\pi \approx -1.2831853$


For $x\neq k\pi$ , $k\in\mathbb{Z}$ , we have

$$\sum_1^\infty\bigg[2\,(-1)^{n+1}\frac{\sin nx}n\bigg]=i\ln e^{-ix}\quad\iff\quad\sum_1^\infty\bigg[2\,(-1)^{n+1}\frac{\sin 5n}n\bigg]=5-2\pi$$

The idea is that $\ \ln e^{i\alpha}=i\alpha\ $ only when $\alpha\in(-\pi,\pi]$, otherwise, it's a periodic function. Basically, you have to first subtract $\pi$ from $\alpha$ (thus determining the offset from the end of the interval), then calculate its remainder when divided through $2\pi$ (which is the length of the interval), and subtract $\pi$ yet again (since the interval starts at $-\pi$). Most falsehoods are in reality half-truths: The trouble with your formula wasn't so much that it was completely wrong, but rather that it was only local, limited to the interval $(-\pi,\pi]$.

  • 1
    $\begingroup$ Better restrict to $(-\pi,\pi)$ (both ends open) because at $\pm\pi$ the series yields $0$ while the logarithm does not. In fact, the series equation fails when $x$ is an odd multiple of $\pi$. $\endgroup$ – ccorn Jan 23 '14 at 1:06
  • $\begingroup$ @ccorn: Why necessarily odd ? $\endgroup$ – Lucian Jan 23 '14 at 11:28
  • $\begingroup$ At even $x/\pi$, the series is continuous and agrees with the RHS. At odd $x/\pi$ the series is noncontinuous and accordingly evaluates to the mean value of its left-sided and right-sided limits (which is zero here, as all the sines evaluate to $0$). The logarithm never makes such a compromise, it always selects one branch so that $\exp\log y = y$ for all nonzero $y$. $\endgroup$ – ccorn Jan 23 '14 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.