[Math] Fourier series of $f(x)=x$

fourier analysisfourier seriesreal-analysis

I want to find the Fourier series of the periodic function defined on $[0,1]$ by $f(x)=x$:

enter image description here

The fourier series is:
$$S(x)=\frac{a_0}{2}+\sum_{n=1}^\infty a_n \cos(2 \pi n x)+b_n \sin(2 \pi n x),$$
where
$$a_n=2\int_\frac{-1}{2}^\frac{1}{2}f(x)\cos(2 \pi n x)dx=2\int_0^1f(x)\cos(2 \pi n x)dx=2\int_0^1x\cos(2 \pi n x)dx=0$$
and
$$b_n=2\int_0^1x\sin(2 \pi n x)dx=\frac{-1}{n \pi}.$$
But my function $f$ is not odd, nor even. I don't know where's the problem.

Best Answer

There is no problem. Notice that $f(x)-\frac{1}{2}$ $\mathbf{is}$ an odd function, so that's why the the $a_0$ term is $1$ and why the other cosine terms vanish.

Related Question