Elementary proof of the Fourier series of $f(x)=x$ Is there an elementary proof or an intuitive explanation of the following formula that can be understood if you know the definition of sin?
$$x = -2\sum_{n=1}^{\infty}\frac{(-1)^n}{n}\sin(nx)$$
 A: Let $ n\in\mathbb{N} $, and $ x\in\left[0,\pi\right) $, (Since $ \sin $ is odd, the result can be generalised for all $ x\in\left(-\pi,\pi\right) $, but for now let us work with positive $ x $s) we have the following : \begin{aligned} \sum_{k=1}^{n}{\frac{\left(-1\right)^{k}}{k}\sin{\left(kx\right)}}&=2\int_{0}^{\frac{x}{2}}{\sum_{k=1}^{n}{\left(-1\right)^{k}\cos{\left(2ky\right)}}\,\mathrm{d}y}\\ &=\int_{0}^{\frac{x}{2}}{\left(\left(-1\right)^{n}\frac{\cos{\left(2n+1\right)y}}{\cos{y}}-1\right)\,\mathrm{d}y}\\ \sum_{k=1}^{n}{\frac{\left(-1\right)^{k}}{k}\sin{\left(kx\right)}}&=-\frac{x}{2}+\left(-1\right)^{n}\int_{0}^{\frac{x}{2}}{\sec{y}\cos{\left(2n+1\right)y}\,\mathrm{d}y} \end{aligned}
Since $ \varphi = \sec $ is $ \mathcal{C}^{1} $ on $ \left[0,\frac{x}{2}\right] $, then $ \int_{0}^{\frac{x}{2}}{\varphi\left(y\right)\cos{\left(2n+1\right)y}\,\mathrm{d}y}\underset{n\to +\infty}{\longrightarrow}0 $, thus : $$ \sum_{n=1}^{+\infty}{\frac{\left(-1\right)^{n}}{n}\sin{\left(nx\right)}}=\lim_{n\to +\infty}{\sum_{k=1}^{n}{\frac{\left(-1\right)^{k}}{k}\sin{\left(kx\right)}}}=-\frac{x}{2} $$
Hence, for all $ x\in\left(-\pi,\pi\right),\ \sum\limits_{n=1}^{+\infty}{\frac{\left(-1\right)^{n}}{n}\sin{\left(nx\right)}}=-\frac{x}{2} $.
