Half range Fourier series

In mathematics, a half range Fourier series is a Fourier series defined on an interval $$[0,L]$$ instead of the more common $$[-L,L]$$, with the implication that the analyzed function $$f(x), x\in[0,L]$$ should be extended to $$[-L,0]$$ as either an even (f(-x)=f(x)) or odd function (f(-x)=-f(x)). This allows the expansion of the function in a series solely of sines (odd) or cosines (even). The choice between odd and even is typically motivated by boundary conditions associated with a differential equation satisfied by $$f(x)$$.

Example

Calculate the half range Fourier sine series for the function $$f(x)=\cos(x)$$ where $$0<x<\pi$$.

Since we are calculating a sine series, $$ a_n=0\   \quad     \forall n$$ Now, $$ b_n= \frac{2}{\pi} \int_0^\pi \cos(x)\sin(nx)\,\mathrm{d}x = \frac{2n((-1)^n+1)}{\pi(n^2-1)}\quad     \forall n\ge 2 $$

When n is odd, $$ b_n=0$$ When n is even, $$b_n={4n \over \pi(n^2-1)} $$ thus $$b_{2k}={8k \over \pi(4k^2-1)} $$

With the special case $$b_1=0$$, hence the required Fourier sine series is

$$\cos(x) = {{8 \over \pi} \sum_{n=1}^{\infty} {n \over(4n^2-1)}\sin(2nx)} $$