Extend a function 2pi periodically and calculate fourier

1.1k Views Asked by At

I have the function $$f(x)= \begin{cases} \frac{\pi}{2}+x & x \in (-\pi,0] \\ \frac{\pi}{2}-x & x \in (0,\pi]\\ \end{cases} $$

I need to extend it $2\pi$ periodically and then justify that

$$b_n=0, a_1=?, a_2=0$$

I understand the formula of a Fourier series; I have the formula for $a_0, a_n$, and $b_n$; but I am unsure how to extend and substitute in $f(x)$ if there are two different possibilities?

Many thanks.

2

There are 2 best solutions below

0
On

I am not completely sure what your question is, so I'm sorry if I misunderstand you.

You have to integrate over the entire period, i.e on the interval $[-\pi, \pi]$ (the function is $2\pi$ periodic and therefore the interval should have length $2\pi$). Hence you have that

\begin{align} a_n &= \frac1\pi\int_{-\pi}^\pi f(x)\cos (n x)\,\mathrm{d}x\\ b_n &= \frac1\pi\int_{-\pi}^\pi f(x)\sin(nx)\,\mathrm{d}x. \end{align}

Remember that you can split up the integral if that makes it easier for you, i.e.

\begin{align}\int_{-\pi}^\pi f(x) \cos(nx)\,\mathrm{d}x &=\int_{-\pi}^0 f(x) \cos(nx)\,\mathrm{d}x +\int_{0}^\pi f(x) \cos(nx)\,\mathrm{d}x\\ &=\int_{-\pi}^0 \left(\frac\pi 2 + x\right) \cos(nx)\,\mathrm{d}x +\int_{0}^\pi \left(\frac\pi 2 - x\right) \cos(nx)\,\mathrm{d}x. \end{align}

2
On

The periodic extension of $f(x)$ is $$ f_p(x)=\sum_{n\in\Bbb Z} f(x-2n\pi)=\arcsin(\cos x) $$ The function is even and then $a_0=0$ and $b_n=0$.

\begin{align} a_n&=\frac{1}{\pi}\int_{-\pi}^\pi f(x)\cos(nx)\,\mathrm dx\\ &=\frac{1}{\pi}\int_{-\pi}^0 \left(\frac{\pi}{2}+x\right)\cos(nx)\,\mathrm dx+\frac{1}{\pi}\int_{0}^\pi \left(\frac{\pi}{2}-x\right)\cos(nx)\,\mathrm dx\\ &=\frac{1}{2}\int_{-\pi}^\pi \cos(nx)\,\mathrm dx+\frac{1}{\pi}\int_{-\pi}^0 x\cos(nx)\,\mathrm dx-\frac{1}{\pi}\int_{0}^\pi x\cos(nx)\,\mathrm dx\\ &=\frac{\sin(\pi n)}{n}-\frac{2}{\pi}\int_{0}^\pi x\cos(nx)\,\mathrm dx\\ &=\frac{\sin(\pi n)}{n}-\frac{2}{\pi}\frac{\pi n \sin(\pi n)+\cos(\pi n)-1}{n^2}\\ &=-\frac{2}{\pi}\frac{(-1)^n-1}{n^2} \end{align} observing that $\sin(\pi n)=0$ and $\cos(\pi n)=(-1)^n$.

For $n=2k$ we have $(-1)^{2k}-1=1-1=0$, that is $a_{2k}=0$. For $n=2k+1$ we have $(-1)^{2k+1}-1=-1-1=-2$, that is $a_{2k+1}=\frac{4}{\pi (2k+1)^2}$.

Thus $$ a_n=\begin{cases}0 &\text{for $n$ even}\\ \frac{4}{\pi n^2}&\text{for $n$ odd} \end{cases} $$ that is

$$ f_p(x)= \sum_{n=1, n\,\text{odd}}^\infty a_n \cos(nx)=\sum_{n=0}^\infty a_{2n+1} \cos((2n+1)x)=\sum_{n=0}^\infty \frac{4}{\pi (2n+1)^2} \,\cos((2n+1)x) $$