$f(x) = x$ , $f(x+2\pi) = f(x) $ on $ [-\pi , \pi] $
How do I know that this function is even or odd? My book says odd, but I don't understand how to work this out?
also why does $a_0 = 0$ and $a_n = 0$?
since its an odd function I thought we use the even extension?
i.e $$ a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos(nx)dx $$
but the answer is
$$ b_{n} = \frac{-2}{n}\cos(n\pi) = \frac{2(-1)^{n+1}}{n} $$
The integral of an odd function over symmetric limits is zero. To see this, we observe
$$\begin{align} \int_{-a}^af(x)dx&=\int_{-a}^0f(x)dx+\int_{0}^af(x)dx\tag1\\\\ &=-\int_{0}^af(x)dx+\int_{0}^af(x)dx\tag2\\\\ &=0 \end{align}$$
where we used the substitution $x \to -x$ in going from $(1)$ to $(2)$.
We also have that the product of an odd function and an even function is an odd function. We can show this as follows. Let $f$ be even and let $g$ be odd and let $h=fg$. Then
$$h(-x)=f(-x)g(-x)=f(x)(-g(x))=-h(x)$$
as was to be shown.
For the problem at hand, note that $\cos nx$ is even about $x=0$ and $\sin nx$ is odd about $x=0$. We also note that $x$ is odd about $x=0$. Thus, we have
$$a_n=\frac{1}{\pi}\int_{-\pi}^{\pi}x \cos (nx)\,dx=0$$