dinospamoni
- 90
- 0
Homework Statement
I'm trying to find a Fourier series for the piecewise function where f(x)=
0 \in -\pi \leq x \leq 0
-1 \in 0 \leq x \leq \frac{\pi}{2}
1 \in \frac{\pi}{2} \leq x \leq \pi
Homework Equations
a_{n} = \frac{1}{\pi} \int_{0}^{2\pi}\cos(nx)y(x)\,dx
b_{n} = \frac{1}{\pi} \int_{0}^{2\pi}\sin(nx)y(x)\,dx
The Attempt at a Solution
I found the pattern that every even a is 0, so that becomes
a_{m} = \sum_{m=1}^{\infty}\frac{(-1)^{m}2}{(2m-1)\pi}
and the b coefficients are 0 when n is odd and 0 for every other even n, so that becomes
b_{m} = \sum_{m=1}^{\infty}\frac{-2}{\frac{4m-2}{2}\pi}
however when I plot this, the plot between -pi and -pi/2 is switched with the plot between pi/2 and pi
I attached a picture for reference along with a plot of f(x)
Any ideas of where i went wrong?
Attachments
Last edited: