[Math] Some doubts regarding half range cosine series.

fourier seriesself-learning

I am learning half range sine and cosine series of a given function. My understanding is this:

If instead of a symmetric interval $[-L,L]$ you are provided by an interval $[0,L]$ then you will have to extend the graph to $2L$ to come up with a function that is either even or odd depending on how you extend the graph. If the 'half' graph was reflected about the $y$-axis you have a Cosine series and if you reflect it about the origin you have a Sine series

So the catch is 'how you extend the graph' when there is only half the interval.

I saw a practice sum here. The site provides a symmetric interval from $[-\pi,\pi]$. The half range series is the same as Fourier series.

Does this not defeat the purpose of half range series because I already know that the function is even or odd? There is no need to extend the graph on my own.

Please clarify 🙂

Best Answer

I already know that the function is even or odd

Not so fast. Recall that a function is determined not just by a formula (or some other assignment of $y$ to $x$), but also by its domain. That is, $$f(x)=x\quad \text{for }\ x\in\mathbb R \tag1$$ and
$$f(x)=x\quad \text{for }\ x\in [0,\pi] \tag2$$ are two different functions. The function (1) is odd, because it satisfies $f(-x)=-f(x)$ for every $x$ in its domain. The function (2) is neither odd nor even, because $f(-x)$ is not necessarily defined for $x\in[0,\pi]$.

If we extend function (2) to an interval $[-\pi,\pi]$, it may become even or odd (or neither), depending on how we do it: $$f(x)=|x|\quad \text{for }\ x\in [-\pi,\pi] \tag3$$ $$f(x)=x\quad \text{for }\ x\in [-\pi,\pi] \tag4$$ $$f(x)=2x-|x| \quad \text{for }\ x\in [-\pi,\pi] \tag5$$ Here, (3) is even, (4) is odd, (5) is neither even nor odd. All are different functions, from each other and from (2).

The Fourier series of (3) is of the form $\sum a_n \cos nx$. The Fourier series of (4) is of the form $\sum b_n\sin nx$.

Does this not defeat the purpose of half range series

I think the series of either kind serve their purpose of representing our function, even if we are only interested in the interval $[0,\pi]$. You may think of the sine series as being more natural (because it's odd) and therefore preferable for representing the function on $[0,\pi]$. Then you're in for a surprise.

I compared the performance of the cosine partial sum $$\frac{\pi}{2}-\frac{4}{\pi} \cos x-\frac{4}{9\pi}\cos 3x$$ and of the sine partial sum $$2\sin x-\sin 2x+\frac23 \sin 3x$$ in approximating $f(x)=x$ on $[0,\pi]$. This is what cosines do:

cosines

and this is what the sines do:

sines

The second approximation, using same number of terms, is just horrible. The underlying reason is that besides the odd/even extension, we also have $2\pi$-periodic extension going on. The periodic extension of (3) is continuous, while the periodic extension of (4) is not. The discontinuity of periodic extension at $\pi$ is responsible for the behavior of the series there.

Related Question