[Math] Sine series of $\pi/2$

fourier series

I'm studying Fourier series and came across this peculiar problem. I just studied (along with proper reasoning) that if $f(x)$ is an even function, then the fourier series has only Cosine terms and if it's an odd function then only Sine terms.

Now we here have an even function, and we're asked to find the Sine terms whereas it's expansion has only Cosine terms.

The question is: Show that the sine series of the constant function $f(x) = \pi/4$ is:

$$
\sin x+ \frac{1}{3}\sin 3x + \frac{1}{5}\sin5x + \ldots, \quad 0<x<\pi
$$

What am I missing here?

Best Answer

The relation between odd/even and sine/cosine is for an interval that is symmetric about $0$, e.g. $[-\pi,\pi]$. If you want a sine series of $f(x)$ on $[0,\pi]$, you could extend it to an odd function on $[-\pi , \pi]$ by $f(-x) = -f(x)$, and then the ordinary Fourier series of that is a sine series. Don't worry about the fact that $f(-x) = -f(x)$ doesn't work at $x=0$ if $f(0)\ne 0$, because the value of a function at a single point doesn't affect its Fourier series (since the coefficients are given by definite integrals). If you wanted a cosine series, you would extend it to be an even function by $f(-x) = f(x)$. So an arbitrary (integrable) function on $[0,\pi]$ will have a Fourier sine series $$ \sum_{j=1}^\infty a_j \sin(j x)$$ as well as a Fourier cosine series $$ \sum_{j=0}^\infty b_j \cos(j x)$$

Related Question