what is the fourier series for function $f(x) = \cos(x) $ if $-\pi < x < 0$ and f(x) = $0$ if $0 < x < \pi$?

198 Views Asked by At

I have done the calculations and $$ a_{0} = \frac{1}{2\pi} \int_{-\pi}^{0} cos(x) dx = 0 $$ $$ a_{n} = \frac{1}{\pi} \int_{-\pi}^{0} cos(x)\times cos(nx) dx = \frac{1}{2\pi} \int_{-\pi}^{0} cos((1+n)x) + cos((1+n)x) = 0 $$ $$ b_{n} = \frac{1}{\pi} \int_{-\pi}^{0} cos(x)\times sin(nx) dx = \frac{1}{2\pi} \int_{-\pi}^{0} sin((n+1)x) + sin((n-1)x) = \frac{-n\times (cos(\pi n) + 1)}{\pi(n^2-1)} $$ and we can express $cos(\pi n)$ as $(-1)^n$ and if $n$ is odd then the $b_n$ coefficient will be zero but if it's even then $b_n$ will be in the form $$ n \rightarrow 2m $$ $$ b_{2m} = \frac{-(2m)\times 2}{\pi((2m)^2 -1))} = \frac{-4m}{\pi(4m^2 -1)} $$ and the fourier series for the given function will be in the form $$ f(x) = \Sigma_{m = 1}^{\infty} \frac{-4m}{\pi(4m^2 - 1)} \times sin(2mx) $$ but this is wrong. It repeats $cos (x)$ fomr $-\pi < x < 0$ with a period of $\pi$ which not what the function is and the range is also half of the original function. Where am I making a mistake ?