So I'm practicing some Fourier series problems and I've stumbled upon this:
For a function: $$f(x)=x\cdot sgn(\sin(2x)) \quad \quad \text{where } x \in(0, \pi)$$
(a) Write a function as a Fourier sine series on the interval $(-\pi, \pi)$
(b) Write a function as a Fourier cosine series on the inverval $(-\pi, \pi)$
At the time I had no idea what Fourier sine/cosine series was (just knew what a Fourier series was in general). Then I googled it and and found a couple of definitions which state the following:
- If a function is odd then $a_n=0$ and the Fourier series collapses to $f(x)=\sum_{n=1}^{\infty}b_n\sin(nx)$
- If a function is even then $b_n=0$ and the Fourier series collapses to $f(x) = \frac{a_0}{2}+\sum_{n=0}^{\infty}a_n\cos(nx)$
I guess it's obvious what my confusion is here. How does the problem expect me to write both for the same function, since the function is either even or odd? What I've managed to do so far is to convert the function to a piecewise form:
$$ f(x)=\begin{cases} 0 ,& x = \frac{\pi}{2} \\ x, & x \in(0, \frac{\pi}{2})\\ -x & x \in(\frac{\pi}{2},\pi) \end{cases} $$
And from here I'd have no problem finding the Fourier series in general, but that's not what's asked here.
So any ideas on what is meant here?
Thanks.