Fourier Series – Difference Between Real and Complex

complex integrationcomplex-analysisfourier analysisfourier seriesfourier transform

I'm working on fourier series and I'm trying to compute the fourier transformation for the $2\pi$-periodic function of $f(x)=x^2$ with $x \in [-\pi,\pi]$.

Now with the real way, that is $$f(x) \sim \frac{a_{0}}{2}+\sum\limits_{n=1}^{\infty}a_{n}\cos(nx)+b_{n}\sin(nx)$$ and I found $$f(x) \sim \frac{\pi^2}{3}+\sum\limits_{n=1}^{\infty} \frac{4}{n^2}(-1)^{n}\cos(nx).$$

Now I also tried to compute with the imaginary way, that is with $$f(x) \sim c_{0}+\sum\limits_{n=-\infty}^{\infty}c_{n} e^{inx},$$ with $$c_{n}=\frac{1}{2\pi} \int\limits_{-\pi}^{\pi}f(x)e^{-inx},$$ and I found $$f(x) \sim \frac{\pi^2}{3}+\sum\limits_{n=1}^{\infty} \frac{2}{n^2} (-1)^{n} e^{inx},$$
which doesn't seem to be the same. I'm sure about the real computation, any suggestions where I go wrong with the imaginary part?

Best Answer

With $f(x) = x^2$, the complex Fourier series should be indexed by the integers. That is, $$ f(x) \sim c_0 + \sum_{n=-\infty}^{\infty} c_n \mathrm{e}^{inx}, $$ where the Fourier coefficients are given by $$ \frac{1}{2\pi} \int_{-\pi}^{\pi} x^2 \mathrm{e}^{-inx}\, \mathrm{d} x = \begin{cases} \frac{2}{n^2}(-1)^n & \text{if $n\ne 0$, and} \\ \frac{\pi^2}{3} & \text{if $n=0$.} \end{cases}$$ (I get this after two integration by part steps–I'm leaving off the details here, as you seemed to have worked them out correctly in your work.)

Via little bit of manipulation, this becomes \begin{align*} f(x) &\sim \sum_{n=-\infty}^{\infty} c_n \mathrm{e}^{inx} \\ &= c_0 + \sum_{n=-\infty}^{-1} c_{n} \mathrm{e}^{inx} + \sum_{n=1}^{\infty} c_{n} \mathrm{e}^{inx} \\ &= c_0 + \sum_{n=1}^{\infty} c_{-n} \mathrm{e}^{-inx} + \sum_{n=1}^{\infty} c_{n} \mathrm{e}^{inx} \\ &= \frac{\pi^2}{3} + \sum_{n=1}^{\infty} \frac{2}{(-n)^2} (-1)^{-n}\mathrm{e}^{-inx} + \sum_{n=1}^{\infty} \frac{2}{n^2} (-1)^{n}\mathrm{e}^{inx} \\ &= \frac{\pi^2}{3} + \sum_{n=1}^{\infty} \frac{2}{n^2} (-1)^n\left( \mathrm{e}^{inx} + \mathrm{e}^{-inx} \right) \\ &= \frac{\pi^2}{3} + \sum_{n=1}^{\infty} \frac{4}{n^2} (-1)^n \left( \frac{\mathrm{e}^{inx} + \mathrm{e}^{-inx}}{2} \right) \\ &= \frac{\pi^2}{3} + \sum_{n=1}^{\infty} \frac{4}{n^2} (-1)^n \cos(nx), \end{align*} which is the result you were hoping to get.

Related Question