1

Given that $f(x+4) = f(x)$ and

$f(x) = -1$ if $-2 < x < 0$, and

$f(x)=1$ if $0 < x < 2$

Find the Fourier series.

I tried it out but I get all $0$ for $a_0$, $a_n$ and $b_n$. Can anyone help me out? I can attach the working if you need it.

1 Answers1

1

Since $f(x)$ is odd, you should get $a_n =0$ for all $n \ge 0$. The $a_n$ coefficients correspond to the $\cos$ terms which represent the even part of $f(x)$. However, you should not get $b_n = 0$. We see that $$\int_{-2}^2 f(x) \sin\left(\frac{n\pi x}{2}\right)dx = 2 \int^2_0 \sin\left(\frac{n\pi x}{2}\right)dx = 2 \left[-\frac{2}{n\pi} \cos\left(\frac{n\pi x}{2}\right)\right]_{x=0}^{x=2} = -\frac{4}{n\pi}((-1)^n - 1),$$ which is non-zero when $n$ is odd. The coefficients $b_n$ are $\frac 1 2$ of this integral, so $$b_n = -\frac{4}{n\pi} \frac{((-1)^n- 1)}{2} = \left\{\begin{matrix}\tfrac{4}{n\pi}, & n \text{ odd}, \\ 0, & n \text{ even}. \end{matrix} \right.$$

In the integral, I used $$\int_{-2}^2 f(x) \sin\left(\frac{n\pi x}{2}\right)dx = 2 \int^2_0 f(x) \sin\left(\frac{n\pi x}{2}\right)dx$$ wihch holds since $f(x)$ is odd and thus $f(x) \sin(\alpha x)$ is even for any $\alpha \in \mathbb R$ and then we can plug in $f(x) = 1$ on the interval $0 \le x \le 2$.

User8128
  • 15,485
  • 1
  • 18
  • 31
  • Could you explain why you have $b_n = \frac{4}{n\pi}$ when n is odd. I have that answer only if n is even because I am integrating it piecewise and I get $2 - 2cos(nx)$. That is 0 if n is odd but it is 2 if n is even. – codecode Feb 20 '18 at 02:27