How to plot $f(x) = 1 + \sum \limits _{n = 1}^{\infty} \frac{2 \cdot (-1)^{n + 1}}{n}\sin (nx)$?

72 Views Asked by At

It seems $f(x)$ is a periodic function, since it is a composition of periodic functions, but how do I find how it looks like on a single period domain?

Well, you can actually plot different partial sums and then they will probably converge to some function $F(x)$, but it's not a formal solution.

In fact, $f(x)$ is a Fourier series of $x + 1$ on $[-\pi, +\pi]$.

1

There are 1 best solutions below

3
On BEST ANSWER

Disregarding potential convergence issues, $$ \sum_{n\geq 1}\frac{(-1)^{n+1}}{n}\sin(nx) = \text{Im}\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}e^{inx}=\text{Im}\log(1+e^{ix})=\text{Arg}(1+e^{ix}) $$ hence over the interval $(-\pi,\pi)$ the LHS equals $\frac{x}{2}$, and $f(x)$ is the $2\pi$-periodic continuation of $x+1$ over $(-\pi,\pi)$. By comparing the partial sums of the series with its pointwise limit, we may notice Gibbs phenomenon. In the following diagram the purple graph is the partial sum up to $n=10$:

$\hspace{1cm}$enter image description here

The lack of uniform convergence can be stated as

$$ \lim_{N\to +\infty}\sup_{x\in(-\pi+\pi/N,\pi-\pi/N)}\left|x-2\sum_{n=1}^{N}\frac{(-1)^{n+1}}{n}\sin(nx)\right|=\frac{\text{Si}(\pi)}{\pi}\approx 0.5895.$$