The functions:
f(x) = -1 when -2 < x <0 and
f(x) = 1 when 0 < x < 2
What I've done:
- Concluding that the period = p = 2 (edit: I've got it wrong, p should be 4, edited the way I compute $b_1$ below)
- Graphing the function, you can tell that it is an odd function in which $a_n = 0$ and $b_n$ nonzero
- Finding $a_0, a_1, b_1, b_2$, in which I always got zero (although $b_n$ shouldn't be zero)
- The formulas I used for the fourier coefficients are from Wikipedia:
How do I do the computing for $b_1$ (edited for p = 2):
$b_1$= $(1/2)(\int_{-2}^0$ $-sin$ (pi x) dx + $\int_{0}^{2}$ sin (pi x) dx$)$
= $(1/pi) (cos((pi)x)) /_{-2}^0$ + $(-1/pi) (cos((pi)x)) /_{0}^2$
= $(1/2)$(($1/pi$ $cos(0)$ - $1/pi$ $cos(2pi)$) + ($(-1/pi)$ $cos(2pi)$ + $1/pi$ $cos(0))$)
= $(1/2)$$($$2/pi$ - $(2/pi)$$cos(2pi)$$)$
= $(1/2)$$(0)$
= 0
Please find the errors and correct me!
